Skip to content

feat: Make per_file rule support severities - #315

Open
furtib wants to merge 4 commits into
Ericsson:mainfrom
furtib:per-file-monolithic-parity
Open

furtib wants to merge 4 commits into
Ericsson:mainfrom
furtib:per-file-monolithic-parity

Conversation

@furtib

@furtib furtib commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Why:
We want complete feature parity between the monolithic and the per_file rule.
The per_file rule currently does not support the severities attribute.

The per_file rule should behave exactly the same during parsing, and when checking the severities, any difference between the two should be considered a bug, not a feature.
That's why, instead of rewriting the logic for parsing and checking severities, I have reused the well-tested monolithic implementation.

What:

  • Refactored necessary functions out of the codechecker script into a shared common library.
  • Created a parse step for the per_file rule, reusing the one used for the monolithic version.
  • Created a test step for the per_file rule, reusing the severity-checking function of the monolithic rule.

Addresses:
Fixes: #309
Fixes: #279

Depends on: #311

@furtib
furtib requested a review from Szelethus August 26, 2026 12:08
@furtib furtib self-assigned this Aug 26, 2026
@furtib furtib added the enhancement New feature or request label Aug 26, 2026
@furtib
furtib marked this pull request as draft August 26, 2026 12:09
@furtib
furtib force-pushed the per-file-monolithic-parity branch 3 times, most recently from d0ed96b to 62e14ca Compare August 27, 2026 08:33
@furtib
furtib force-pushed the per-file-monolithic-parity branch from 62e14ca to e2ad1f5 Compare August 27, 2026 09:15
@furtib
furtib marked this pull request as ready for review September 7, 2026 06:51

@Szelethus Szelethus 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.

So, much of this PR is completely trivial refactoring. I'd prefer to have the NFC parts land separately, because it'd make the review easier. Of substance, the patch looks mostly right, and I agree with the overall direction of reusing more code. Speaking of that, I wish we could resurrect #141...

Comment thread test/unit/caching/BUILD
Comment on lines +36 to +43
expected_action_count = 2,
file_to_modify = "secondary.cc",
target_name = "per_file_caching",
)

caching_test(
name = "caching_per_file_ctu_test",
expected_action_count = 2,
expected_action_count = 3,

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.

What are we seeing here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The parse action is a separate action, thus, the action count is increased, as expected.

This branch has not been deployed

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add severities attribute to per_file Add option to CodeChecker parse into the HTML format

2 participants