From 3aa0d557fddd5fdd3ae5afb34f73a5c7be463e3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SCC/=E6=A5=8A=E5=BF=97=E7=92=BF?= Date: Tue, 27 Feb 2024 21:54:09 +0800 Subject: [PATCH] Suppress Cppcheck constant check (#154) 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. --- scripts/pre-commit.hook | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/pre-commit.hook b/scripts/pre-commit.hook index b39b87bdf..f8467cc75 100755 --- a/scripts/pre-commit.hook +++ b/scripts/pre-commit.hook @@ -16,7 +16,8 @@ CPPCHECK_suppresses="--inline-suppr harness.c \ --suppress=nullPointer:qtest.c \ --suppress=returnDanglingLifetime:report.c \ --suppress=constParameterCallback:console.c \ ---suppress=constParameterPointer:console.c" +--suppress=constParameterPointer:console.c \ +--suppress=checkLevelNormal:log2_lshift16.h" CPPCHECK_OPTS="-I. --enable=all --error-exitcode=1 --force $CPPCHECK_suppresses $CPPCHECK_unmatched ." RETURN=0