From 4a6477ed645ce369e4a7fb2728c82fb7d3e5f985 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Wed, 18 Jul 2018 09:40:29 -0600 Subject: [PATCH] util/gitconfig: Make checkpatch non fatal in pre-commit hook We don't block commits for failing checkpatch in gerrit, and we shouldn't block them here. This allows checkpatch to still run, so users can see the issues, but won't prevent the commit. Adds a delay if checkpatch fails so that the issues can be seen. Change-Id: Ibd4e8bb74e0b02825dcdf16e233a061c4bb43f50 Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/27534 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- util/gitconfig/pre-commit | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/gitconfig/pre-commit b/util/gitconfig/pre-commit index 027eec0705..0644b7ff86 100755 --- a/util/gitconfig/pre-commit +++ b/util/gitconfig/pre-commit @@ -24,5 +24,6 @@ PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/) if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then echo echo "Running checkpatch" - printf "%s\n" "$PATCHDIFF" | util/lint/lint-007-checkpatch diff + printf "%s\n" "$PATCHDIFF" | util/lint/lint-007-checkpatch diff \ + || (echo "Please consider fixing these issues." ;sleep 5) ; true fi