chore(linter): For sarif tests, scrub the version number to avoid breaking snapshots#22125
Merged
graphite-app[bot] merged 1 commit intomainfrom May 5, 2026
Merged
chore(linter): For sarif tests, scrub the version number to avoid breaking snapshots#22125graphite-app[bot] merged 1 commit intomainfrom
graphite-app[bot] merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates oxlint’s snapshot test harness to make SARIF snapshots resilient to version bumps by scrubbing the tool version fields out of SARIF output.
Changes:
- Detect SARIF snapshot runs and post-process output to replace the
version/semanticVersionfields with<variable>. - Update existing SARIF CLI output snapshots to reflect the scrubbed version fields.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/oxlint/src/tester.rs | Adds SARIF detection and a regex-based scrubber for version / semanticVersion in snapshot output. |
| apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format=sarif test.js@oxlint.snap | Updates SARIF snapshot to use <variable> for version fields. |
| apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format=sarif parser-error.js@oxlint.snap | Updates SARIF snapshot to use <variable> for version fields. |
| apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format=sarif ok.js@oxlint.snap | Updates SARIF snapshot to use <variable> for version fields. |
| apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format=sarif --report-unused-disable-directives disable-directive.js@oxlint.snap | Updates SARIF snapshot to use <variable> for version fields. |
Member
Merge activity
|
…aking snapshots (#22125) This probably isn't the best way to do it, but *shrug* it works. I considered skipping the is_sarif check but it seems better than running the regex on every test snapshot. Generated with Claude Code, reviewed by me.
6a619f9 to
17bf08d
Compare
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.
This probably isn't the best way to do it, but shrug it works. I considered skipping the is_sarif check but it seems better than running the regex on every test snapshot.
Generated with Claude Code, reviewed by me.