Repository navigation
Silence a finding with an inline coretrace ignore comment - #76
Merged
Merged
Conversation
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.
Summary
Second item of #68: a finding can be silenced where it stands.
test: define inline suppressions), implementation follows.findings/suppressions.py:# coretrace: ignoreon a finding's line suppresses every finding there,# coretrace: ignore[rule, rule]the listed rules only. Python sources are tokenized, so a string that merely contains the marker is not a suppression; other text files (requirements files) are read line by line with the same comment syntax.partitionsplits findings into kept and suppressed, reading each file once.analyze_fileandanalyze_project, after the policy, so cached modules and project plugins are covered alike;FileAnalysis.suppressedandProjectAnalysis.suppressedcarry the silenced findings.Report.suppressed: the text report ends withno findings, 1 suppressed, the JSON report lists them undersuppressed, the SARIF log emits them as results withsuppressions: [{"kind": "inSource"}], which is how code scanning services show a dismissed alert. The exit status counts kept findings only.Part of #68.