Skip to content

Commit

Permalink
Clang format: only show errors on non whitelisted files
Browse files Browse the repository at this point in the history
  • Loading branch information
nerzhul committed Apr 6, 2017
1 parent 671d37a commit 503e1d2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions util/travis/script.sh
Expand Up @@ -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
Expand Down

0 comments on commit 503e1d2

Please sign in to comment.