diff options
author | Loïc Blot <loic.blot@unix-experience.fr> | 2017-04-06 16:03:29 +0200 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2017-04-06 23:21:40 +0200 |
commit | 3a90b78a037df3eb9098d4fddb1289ed8ee21329 (patch) | |
tree | 33db5306cb406f6e8f3388a957f1f2d400d7d082 /util | |
parent | 88b9b9652ab77f91eaa7c6e40b8a48e3a35a7948 (diff) | |
download | minetest-3a90b78a037df3eb9098d4fddb1289ed8ee21329.tar.gz minetest-3a90b78a037df3eb9098d4fddb1289ed8ee21329.tar.bz2 minetest-3a90b78a037df3eb9098d4fddb1289ed8ee21329.zip |
LINT: Switch whitelist check from egrep to awk
Bonus: make CI happy with the last rules fix
Diffstat (limited to 'util')
-rw-r--r-- | util/travis/lint.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/util/travis/lint.sh b/util/travis/lint.sh index c1df2d5fa..4e816bd94 100644 --- a/util/travis/lint.sh +++ b/util/travis/lint.sh @@ -6,6 +6,7 @@ function perform_lint() { else CLANG_FORMAT=clang-format fi + echo "LINT: Using binary $CLANG_FORMAT" CLANG_FORMAT_WHITELIST="util/travis/clang-format-whitelist.txt" if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then @@ -22,10 +23,10 @@ function perform_lint() { d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) if ! [ -z "$d" ]; then - whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") + whitelisted=$(awk '$1 == "'$f'" { print 1 }' "$CLANG_FORMAT_WHITELIST") # If file is not whitelisted, mark a failure - if [ ${whitelisted} -eq 0 ]; then + if [ -z ${whitelisted} ]; then errorcount=$((errorcount+1)) printf "The file %s is not compliant with the coding style" "$f" |