checkpatch: exclude util/crossgcc/patches

These files are supposed to contain trailing whitespace due to the patch
format. Also use the exclusion list in the pre-commit hook.

Change-Id: I8816c05ea703964a332915a0675096836957b242
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-on: https://review.coreboot.org/26695
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Martin Roth <martinroth@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Georgi 2018-05-30 15:54:08 +02:00 committed by Patrick Georgi
parent 9110c17668
commit 5486786495
2 changed files with 10 additions and 2 deletions

View File

@ -24,5 +24,5 @@ PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/)
if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then
echo echo
echo "Running checkpatch" echo "Running checkpatch"
printf "%s\n" "$PATCHDIFF" | util/lint/checkpatch.pl --no-signoff -q - printf "%s\n" "$PATCHDIFF" | util/lint/lint-007-checkpatch diff
fi fi

View File

@ -21,13 +21,21 @@ INCLUDED_FILES='.*\.[ch]\|Kconfig.*$'
EXCLUDED_DIRS="^payloads/libpayload/util/kconfig\|\ EXCLUDED_DIRS="^payloads/libpayload/util/kconfig\|\
^payloads/libpayload/curses/PDCurses\|\ ^payloads/libpayload/curses/PDCurses\|\
^util/crossgcc/patches\|\
^util/kconfig\|\ ^util/kconfig\|\
^src/vendorcode\|\ ^src/vendorcode\|\
^Documentation" ^Documentation"
# Space separated list of directories to test # default: test src and util
if [ "$1" = "" ]; then if [ "$1" = "" ]; then
INCLUDED_DIRS="src util" INCLUDED_DIRS="src util"
# special mode: take diff from stdin, but exclude the dirs
elif [ "$1" = "diff" ]; then
args=$( echo $EXCLUDED_DIRS | \
sed -e 's,\\|, ,g' -e 's,\^,--exclude=,g' )
util/lint/checkpatch.pl --quiet --no-signoff $args -
exit $?
# Space separated list of directories to test
else else
INCLUDED_DIRS="$1" INCLUDED_DIRS="$1"
fi fi