mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Clang format: only show errors on non whitelisted files
This commit is contained in:
@@ -22,6 +22,10 @@ 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
|
||||||
|
whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}")
|
||||||
|
|
||||||
|
# If file is not whitelisted, mark a failure
|
||||||
|
if [ ${whitelisted} -eq 0 ]; then
|
||||||
errorcount=$((errorcount+1))
|
errorcount=$((errorcount+1))
|
||||||
|
|
||||||
printf "The file %s is not compliant with the coding style" "$f"
|
printf "The file %s is not compliant with the coding style" "$f"
|
||||||
@@ -31,10 +35,6 @@ function perform_lint() {
|
|||||||
printf ":\n%s\n" "$d"
|
printf ":\n%s\n" "$d"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
whitelisted=$(egrep -c "^${f}" "${CLANG_FORMAT_WHITELIST}")
|
|
||||||
|
|
||||||
# If file is not whitelisted, mark a failure
|
|
||||||
if [ ${whitelisted} -eq 0 ]; then
|
|
||||||
fail=1
|
fail=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user