Skip to content

feat: add automated static analysis with cppcheck and Coccinelle CI#174

Draft
buckleypaul wants to merge 2 commits into
HubbleNetwork:mainfrom
buckleypaul:feat/static-analysis-tooling
Draft

feat: add automated static analysis with cppcheck and Coccinelle CI#174
buckleypaul wants to merge 2 commits into
HubbleNetwork:mainfrom
buckleypaul:feat/static-analysis-tooling

Conversation

@buckleypaul

Copy link
Copy Markdown
Collaborator

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.

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>
@buckleypaul buckleypaul force-pushed the feat/static-analysis-tooling branch from 94e6a67 to f1d1bd3 Compare April 13, 2026 19:10
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 ceolin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants