From c39e1e96c22e6eab3ea99bdd9d09a4ab203d4e9e Mon Sep 17 00:00:00 2001 From: Tomasz Kulasek Date: Mon, 8 Jul 2019 16:53:04 +0200 Subject: [PATCH] scripts/check_format: fix checking patch files This patch excludes *.patch files from some checks in check_format.sh: - trailing spaces, - POSIX includes Change-Id: Ic55ce7f4128ddc946d235b4ca487061075edc03b Signed-off-by: Tomasz Kulasek Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460939 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Reviewed-by: Paul Luse --- scripts/check_format.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index 4a724d42c..ded54d43a 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -122,7 +122,7 @@ fi rm -f comment.log echo -n "Checking for spaces before tabs..." -git grep --line-number $' \t' -- > whitespace.log || true +git grep --line-number $' \t' -- './*' ':!*.patch' > whitespace.log || true if [ -s whitespace.log ]; then echo " Spaces before tabs detected" cat whitespace.log @@ -171,7 +171,7 @@ rm -f badcunit.log echo -n "Checking blank lines at end of file..." -if ! git grep -I -l -e . -z | \ +if ! git grep -I -l -e . -z './*' ':!*.patch' | \ xargs -0 -P$(nproc) -n1 scripts/eofnl > eofnl.log; then echo " Incorrect end-of-file formatting detected" cat eofnl.log @@ -182,7 +182,7 @@ fi rm -f eofnl.log echo -n "Checking for POSIX includes..." -git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!include/linux/**' ':!lib/vhost/rte_vhost*/**' ':!scripts/posix.txt' > scripts/posix.log || true +git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!include/linux/**' ':!lib/vhost/rte_vhost*/**' ':!scripts/posix.txt' ':!*.patch' > scripts/posix.log || true if [ -s scripts/posix.log ]; then echo "POSIX includes detected. Please include spdk/stdinc.h instead." cat scripts/posix.log