Skip to content

chore(linter): For sarif tests, scrub the version number to avoid breaking snapshots#22125

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix-sarif-snaps
May 5, 2026
Merged

chore(linter): For sarif tests, scrub the version number to avoid breaking snapshots#22125
graphite-app[bot] merged 1 commit intomainfrom
fix-sarif-snaps

Conversation

@connorshea
Copy link
Copy Markdown
Member

@connorshea connorshea commented May 5, 2026

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.

Copilot AI review requested due to automatic review settings May 5, 2026 02:27
@connorshea connorshea requested a review from camc314 as a code owner May 5, 2026 02:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / semanticVersion fields 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.

Comment thread apps/oxlint/src/tester.rs Outdated
Comment thread apps/oxlint/src/tester.rs Outdated
Copy link
Copy Markdown
Member

@camchenry camchenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me!

@camchenry camchenry added the 0-merge Merge with Graphite Merge Queue label May 5, 2026
Copy link
Copy Markdown
Member

camchenry commented May 5, 2026

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.
@graphite-app graphite-app Bot force-pushed the fix-sarif-snaps branch from 6a619f9 to 17bf08d Compare May 5, 2026 02:55
@graphite-app graphite-app Bot merged commit 17bf08d into main May 5, 2026
25 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label May 5, 2026
@graphite-app graphite-app Bot deleted the fix-sarif-snaps branch May 5, 2026 02:58
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.

3 participants