From cec5179a7eeff005cdd04840701bd11813f8c9b7 Mon Sep 17 00:00:00 2001 From: scc Date: Fri, 1 Mar 2024 01:28:04 +0800 Subject: [PATCH] Suppress Cppcheck checking level Refine the pre-commit hook to enforce a minimum Cppcheck version of 1.90, alerting users with an error message and providing guidance on compiling Cppcheck from source if their version is outdated. Additionally, upgrade the hook for "--check-level=exhaustive" option against Cppcheck versions 2.11 and above, ensuring a comprehensive analysis. This adjustment leverages the enhanced capabilities available from version 2.11, promoting more detailed code quality checks. This commit is aiming for fixing commit #3aa0d55's misinformed title. We just add comments to explain why this changes. --- scripts/pre-commit.hook | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/pre-commit.hook b/scripts/pre-commit.hook index f8467cc75..4f45a7628 100755 --- a/scripts/pre-commit.hook +++ b/scripts/pre-commit.hook @@ -5,6 +5,8 @@ for f in *.c; do CPPCHECK_unmatched="$CPPCHECK_unmatched --suppress=unmatchedSuppression:$f" done +# We suppress the checkLevelNormal warning for Cppcheck versions 2.11 and above. +# Please refer to issues/153 for more details. CPPCHECK_suppresses="--inline-suppr harness.c \ --suppress=missingIncludeSystem \ --suppress=noValidConfiguration \