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 <tomaszx.kulasek@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/460939 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
parent
4171d1f552
commit
c39e1e96c2
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user