make cppcheck suppressions file-level#224
Closed
cameroncuster wants to merge 1 commit into
Closed
Conversation
Member
Author
|
Closing — decided file-level suppressions hide too much; keeping suppressions line-pinned. |
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.
Drop the
:linecomponent 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.hppfiles, movingstruct BITfrom line 14 to 15, which un-matchedctuOneDefinitionRuleViolation:../library/data_structures_[l,r)/bit.hpp:14and turnedgrep_clangformat_cppcheckred ondev(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:
kactl/,hackpack-cpp/) that this repo doesn't edit anyway.Also deduplicates entries that collapsed to the same line after dropping line numbers (e.g. the three
constParameterentries formerge_sort_tree_updates.hpp), shrinking the list from 64 to 59 lines.No library code changes.