Skip to content

Commit 313f8ea

Browse files
authored
Merge pull request #14 from Jordymalone/suppress-hook
Eliminate unintended suppression
2 parents 01f97ef + e2372ba commit 313f8ea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/pre-commit.hook

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/usr/bin/env bash
22

3+
CPPCHECK_unmatched=
4+
for f in *.c *.h; do
5+
CPPCHECK_unmatched="$CPPCHECK_unmatched --suppress=unmatchedSuppression:$f"
6+
done
37
# http-parser was taken from Node.js, and we don't tend to validate it.
48
CPPCHECK_suppresses="--suppress=missingIncludeSystem \
59
--suppress=unusedFunction:http_parser.c \
@@ -8,7 +12,7 @@ CPPCHECK_suppresses="--suppress=missingIncludeSystem \
812
--suppress=unknownMacro:http_server.c \
913
--suppress=unusedStructMember:http_parser.h \
1014
--suppress=unusedStructMember:http_server.h"
11-
CPPCHECK_OPTS="-I. --enable=all --error-exitcode=1 --force $CPPCHECK_suppresses"
15+
CPPCHECK_OPTS="-I. --enable=all --error-exitcode=1 --force $CPPCHECK_suppresses $CPPCHECK_unmatched"
1216

1317
RETURN=0
1418
CLANG_FORMAT=$(which clang-format)

0 commit comments

Comments
 (0)