cppcheck: use file list, add -j option, and handle build dir#1
Draft
mdeweerd wants to merge 1 commit into
Draft
Conversation
mdeweerd
force-pushed
the
vibe/cppcheck-filelist-c62b93
branch
2 times, most recently
from
July 12, 2026 15:02
e4720ff to
4314db3
Compare
mdeweerd
force-pushed
the
vibe/cppcheck-filelist-c62b93
branch
4 times, most recently
from
July 20, 2026 14:00
fddd8b8 to
1b4abb7
Compare
- Add parallel processing support with -j option (defaults to # processors) - Implement temporary build directory for parallel processing (when -j > 1) - Update default arguments for cppcheck (unusedFunction check disabled, no need ot ignore) - Improve error handling and cleanup (cppcheck) - Update tests to verify parallel processing functionality
mdeweerd
force-pushed
the
vibe/cppcheck-filelist-c62b93
branch
from
July 21, 2026 08:31
1b4abb7 to
126c17f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In CI, I enabled
cppcheckcaching by adding the--cppcheck-build-diroption, but that did not work as every file was analysed in a separatecppcheckcall.The changes avoids splitting the analysis in multiple batches, and has all the files analysed in a single cppcheck call (which itself creates multiple subprocesses).
Summary of the changes
--file-listoption to pass multiple files to cppcheck in a single invocation-joption with number of available processors for parallel analysis--cppcheck-build-dirwhen using-j > 1to enableunusedFunctioncheck compatibilityunusedFunctionwarnings (now safe due to--cppcheck-build-dirhandling)tempfile.mkdtemp()shutil.rmtree()even on interruptionChanges
hooks/cppcheck.pyto use--file-listoption instead of running cppcheck once per file-j Noption with CPU count (only on multi-core systems)--cppcheck-build-dircreation when using-j > 1--suppress=unusedFunction(previously conditional)shutil.rmtree()tests/test_hooks.pyto handle cppcheck warning messagesExtra Info
--suppress=unusedFunction is no longer needed
As we add the
--cppcheck-build-dirwhen missing if-jis > 1, there is no longer an issue with the analysis.Verification
-jandunusedFunctionconflicts