util/lint: make clang-format non-fatal

The current clang-format configuration is completely broken. It forces
one to change the code style of patches before pushing them, only to
find out that checkpatch now complains about it. This means newcomers
get scared away, and developers only get angered and frustrated about
it, and end up working around clang-format's requirements anyway.

For now, make clang-format's complaints non-fatal, reducing them to text
noise. However, since clang-format is currently unusable, reverting it
out would be preferred.

Change-Id: Iffa8934efa1c27c04e10545f66d8f9976e74c367
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35176
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Angel Pons 2019-08-31 02:46:42 +02:00 committed by Patrick Georgi
parent 42b4e4e1dd
commit ce828b6ae8
2 changed files with 7 additions and 4 deletions

View File

@ -137,7 +137,10 @@ cat "$patch"
printf "\nYou can apply these changes with:\n git apply $patch\n"
printf "(may need to be called from the root directory of your repository)\n"
printf "Aborting commit. Apply changes and commit again or skip checking with"
printf " --no-verify (not recommended).\n"
exit 1
# FIXME: clang-format is currently unusable, so don't abort the commit.
# printf "Aborting commit. Apply changes and commit again or skip checking with"
# printf " --no-verify (not recommended).\n"
# exit 1
exit 0

View File

@ -33,6 +33,6 @@ if [ $(clang-format $files_to_check | wc -l) -gt 0 ]; then
if [ "$(git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff)" != "" ]; then
echo "Coding style mismatch. The following patch fixes it:"
git diff --no-prefix HEAD~..HEAD -- $files_to_check | clang-format-diff
exit 1
exit 0
fi
fi