diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2017-04-06 08:42:52 +0200 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2017-04-06 08:42:52 +0200 |
commit | 503e1d2b7c800a76a161541d90b799e9786adbd9 (patch) | |
tree | d11390e47cf10c5b03bb49a216bc941fd3010786 /util/travis/script.sh | |
parent | 671d37adffcfb4d4b5e41d8c1e625cf25b87f637 (diff) | |
download | minetest-503e1d2b7c800a76a161541d90b799e9786adbd9.tar.gz minetest-503e1d2b7c800a76a161541d90b799e9786adbd9.tar.bz2 minetest-503e1d2b7c800a76a161541d90b799e9786adbd9.zip |
Clang format: only show errors on non whitelisted files
Diffstat (limited to 'util/travis/script.sh')
-rwxr-xr-x | util/travis/script.sh | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/util/travis/script.sh b/util/travis/script.sh index 4a12df5f6..44057352d 100755 --- a/util/travis/script.sh +++ b/util/travis/script.sh @@ -22,19 +22,19 @@ function perform_lint() { d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true) if ! [ -z "$d" ]; 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 - whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}") # If file is not whitelisted, mark a failure if [ ${whitelisted} -eq 0 ]; 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 + fail=1 fi fi |