Skip to content

make cppcheck suppressions file-level#224

Closed
cameroncuster wants to merge 1 commit into
devfrom
cppcheck-file-suppressions
Closed

make cppcheck suppressions file-level#224
cameroncuster wants to merge 1 commit into
devfrom
cppcheck-file-suppressions

Conversation

@cameroncuster

Copy link
Copy Markdown
Member

Drop the :line component from every cppcheck suppression, making them file-level.

Why

Line-pinned suppressions break whenever any edit shifts lines in a suppressed file — even a one-line doc comment. This just happened: #220 added a comment line to both bit.hpp files, moving struct BIT from line 14 to 15, which un-matched ctuOneDefinitionRuleViolation:../library/data_structures_[l,r)/bit.hpp:14 and turned grep_clangformat_cppcheck red on dev (fixed for that one entry via #222).

This PR applies the same fix to all 57 remaining line-pinned entries so no future line shift can break CI.

Tradeoff

A file-level suppression hides the given check ID for the whole file instead of one line. That's acceptable here:

  • Every entry is already scoped to both a specific check ID and a specific file — a new, genuinely different issue in that file would almost always have a different check ID and still be caught.
  • Roughly half the entries point into vendored submodules (kactl/, hackpack-cpp/) that this repo doesn't edit anyway.
  • The alternative (updating line numbers on every doc tweak) has already proven unmaintainable.

Also deduplicates entries that collapsed to the same line after dropping line numbers (e.g. the three constParameter entries for merge_sort_tree_updates.hpp), shrinking the list from 64 to 59 lines.

No library code changes.

@cameroncuster

Copy link
Copy Markdown
Member Author

Closing — decided file-level suppressions hide too much; keeping suppressions line-pinned.

@cameroncuster cameroncuster deleted the cppcheck-file-suppressions branch July 6, 2026 18:02
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.

1 participant