Repository navigation
Accept known findings through a baseline file - #77
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
Third item of #68: a repository with known findings can adopt the analyzer and fail only on new ones.
test: define the baseline file), implementation follows.findings/baseline.py: a finding's fingerprint is its file relative to the root, its rule, its function and the text of its line, never its line number, so code inserted above it does not make it new while a change to the line does.Baseline.of,save,load(JSON, schema 1, counted entries) andpartition, which consumes one entry per matching finding.--baseline PATHwith--check: the first run writes the file and passes; later runs set the recorded findings apart and exit 1 only for new ones. An unreadable file is a usage error.Report.baselinedandwith_baseline: the text report ends with1 finding, 3 baselined, the JSON report lists them underbaselined, the SARIF log marks every result'sbaselineState,neworunchanged.Part of #68.