feat: add automated static analysis with cppcheck and Coccinelle CI#174
Draft
buckleypaul wants to merge 2 commits into
Draft
feat: add automated static analysis with cppcheck and Coccinelle CI#174buckleypaul wants to merge 2 commits into
buckleypaul wants to merge 2 commits into
Conversation
Add a unified `tools/analyze` script that runs cppcheck and the existing Coccinelle semantic patches against src/, include/, port/, and samples/. A new GitHub Actions workflow enforces zero new findings on pull requests. Existing cppcheck findings are baselined in a suppressions file so CI enforces only new regressions. The coccicheck typo on line 75 is also fixed. Signed-off-by: Paul Buckley <paul@hubble.com>
94e6a67 to
f1d1bd3
Compare
Compare analysis results between base and PR branches so that only new findings block the build. Existing codebase findings are filtered out automatically, which lets Coccinelle be enforced for new code even though the baseline has unfixed warnings. The workflow checks out both branches, runs cppcheck + Coccinelle on each, diffs the results with a line-agnostic matching strategy, and posts a single auto-updating comment on the PR summarising new and fixed findings. Signed-off-by: Paul Buckley <paul@hubble.com>
ceolin
requested changes
Apr 14, 2026
ceolin
left a comment
Collaborator
There was a problem hiding this comment.
-1 to prevent it from being merged in a hurry.
Too much generated machinery for something that requires deeper thoughts. Some items:
- It is not really good maintain suppression for all tools we may use in the repository.
- suppress changes should be analyzed in details
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.
Add a unified
tools/analyzescript that runs cppcheck and the existing Coccinelle semantic patches against src/, include/, port/, and samples/. A new GitHub Actions workflow enforces zero new findings on pull requests.Existing cppcheck findings are baselined in a suppressions file so CI enforces only new regressions. The coccicheck typo on line 75 is also fixed.