From d4ed12972706b43ba73b5749ccb75f75ecc14a50 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sat, 11 Sep 2021 02:42:51 -0700 Subject: [PATCH] pre-commit: skip some checks on idl2wrs.c. Some checks intended for dissectors don't work well on dissector *generators*, as they see stuff such as "value_string %s[]" in a format string used to generate dissector code and get upset because the purported value_string doesn't end with {0, NULL} (the generator *does* put a {0, NULL} at the end, but the checker isn't clever enough to figure that out). --- tools/pre-commit | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/pre-commit b/tools/pre-commit index 51740eb6ef..3c7df2bf3e 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -83,6 +83,15 @@ echo "$COMMIT_FILES" | $PYBIN "$bad_alloc_patterns" CHECK_FILES=$( echo "$CHECK_FILES" | tr -d '\r' ) for FILE in $CHECK_FILES; do + # Skip some special cases + FILE_BASENAME="$( basename "$FILE" )" + # This should only be done on code that's part of one or more + # Wireshark programs; idl2wrs.c is a developer tool, not a + # Wireshark program, so these tests don't apply. + if test "$FILE_BASENAME" = "idl2wrs.c" + then + continue + fi #Check if checkhf is good ./tools/checkhf.pl "$FILE" || exit_status=1