From 3a90b78a037df3eb9098d4fddb1289ed8ee21329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Thu, 6 Apr 2017 16:03:29 +0200 Subject: LINT: Switch whitelist check from egrep to awk Bonus: make CI happy with the last rules fix --- util/travis/lint.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'util/travis') 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" -- cgit v1.2.3