diff options
Diffstat (limited to 'util')
-rwxr-xr-x | util/buildbot/buildwin32.sh | 8 | ||||
-rwxr-xr-x | util/buildbot/buildwin64.sh | 8 | ||||
-rw-r--r-- | util/ci/lint_autocorrect.sh | 45 |
3 files changed, 53 insertions, 8 deletions
diff --git a/util/buildbot/buildwin32.sh b/util/buildbot/buildwin32.sh index e62d32969..a4238fbd8 100755 --- a/util/buildbot/buildwin32.sh +++ b/util/buildbot/buildwin32.sh @@ -1,12 +1,12 @@ #!/bin/bash set -e -CORE_GIT=https://github.com/minetest/minetest +CORE_GIT=https://github.com/EliasFleckenstein03/dragonfireclient CORE_BRANCH=master -CORE_NAME=minetest -GAME_GIT=https://github.com/minetest/minetest_game +CORE_NAME=dragonfireclient +GAME_GIT=https://git.minetest.land/Wuzzy/MineClone2 GAME_BRANCH=master -GAME_NAME=minetest_game +GAME_NAME=mineclone2 dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ $# -ne 1 ]; then diff --git a/util/buildbot/buildwin64.sh b/util/buildbot/buildwin64.sh index 94e009c29..1b680cf5b 100755 --- a/util/buildbot/buildwin64.sh +++ b/util/buildbot/buildwin64.sh @@ -1,12 +1,12 @@ #!/bin/bash set -e -CORE_GIT=https://github.com/minetest/minetest +CORE_GIT=https://github.com/EliasFleckenstein03/dragonfireclient CORE_BRANCH=master -CORE_NAME=minetest -GAME_GIT=https://github.com/minetest/minetest_game +CORE_NAME=dragonfireclient +GAME_GIT=https://git.minetest.land/Wuzzy/MineClone2 GAME_BRANCH=master -GAME_NAME=minetest_game +GAME_NAME=mineclone2 dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" if [ $# -ne 1 ]; then diff --git a/util/ci/lint_autocorrect.sh b/util/ci/lint_autocorrect.sh new file mode 100644 index 000000000..6a8881231 --- /dev/null +++ b/util/ci/lint_autocorrect.sh @@ -0,0 +1,45 @@ +#! /bin/bash +function perform_lint() { + echo "Performing LINT..." + if [ -z "${CLANG_FORMAT}" ]; then + CLANG_FORMAT=clang-format + fi + echo "LINT: Using binary $CLANG_FORMAT" + CLANG_FORMAT_WHITELIST="util/ci/clang-format-whitelist.txt" + + files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')" + + local errorcount=0 + local fail=0 + for f in ${files_to_lint}; do + d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) + + if ! [ -z "$d" ]; then + whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST") + + # If file is not whitelisted, mark a failure + if [ -z "${whitelisted}" ]; then + errorcount=$((errorcount+1)) + + printf "The file %s is not compliant with the coding style" "$f" + if [ ${errorcount} -gt 50 ]; then + printf "\nToo many errors encountered previously, this diff is hidden.\n" + else + printf ":\n%s\n" "$d" + fi + + ${CLANG_FORMAT} -i "$f" + + fail=1 + fi + fi + done + + if [ "$fail" = 1 ]; then + echo "LINT reports failure." + exit 1 + fi + + echo "LINT OK" +} + |