mirror of
https://github.com/minetest/minetest.git
synced 2024-09-12 00:26:50 +02:00
Clang format: only show errors on non whitelisted files
This commit is contained in:
parent
671d37adff
commit
503e1d2b7c
@ -22,19 +22,19 @@ function perform_lint() {
|
|||||||
d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true)
|
d=$(diff -u "$f" <(${CLANG_FORMAT} "$f") || true)
|
||||||
|
|
||||||
if ! [ -z "$d" ]; then
|
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}")
|
whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}")
|
||||||
|
|
||||||
# If file is not whitelisted, mark a failure
|
# If file is not whitelisted, mark a failure
|
||||||
if [ ${whitelisted} -eq 0 ]; then
|
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
|
fail=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user