We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3e2923d + 060d9c6 commit 6bf04dbCopy full SHA for 6bf04db
scripts/pre-commit.hook
@@ -4,7 +4,7 @@ CPPCHECK_suppresses="--suppress=missingIncludeSystem \
4
--suppress=unusedFunction:http_parser.c \
5
--suppress=duplicateBreak:http_parser.c \
6
--suppress=shadowVariable:http_parser.c"
7
-CPPCHECK_OPTS="-I. --enable=all --error-exitcode=1 --force $CPPCHECK_suppresses ."
+CPPCHECK_OPTS="-I. --enable=all --error-exitcode=1 --force $CPPCHECK_suppresses"
8
9
RETURN=0
10
CLANG_FORMAT=$(which clang-format)
@@ -76,7 +76,9 @@ do
76
done
77
78
# static analysis
79
-$CPPCHECK $CPPCHECK_OPTS >/dev/null
+git ls-tree --full-tree -r --name-only HEAD | \
80
+ grep -v compat | grep -E "\.(c|cc|cpp|h|hh|hpp)\$" | \
81
+ xargs $CPPCHECK $CPPCHECK_OPTS >/dev/null
82
if [ $? -ne 0 ]; then
83
RETURN=1
84
echo "" >&2
0 commit comments