fix(linter): add summary output to GitHub formatter#20404
Merged
camc314 merged 2 commits intooxc-project:mainfrom Mar 16, 2026
Merged
fix(linter): add summary output to GitHub formatter#20404camc314 merged 2 commits intooxc-project:mainfrom
camc314 merged 2 commits intooxc-project:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates oxlint’s GitHub Actions output formatter so it always emits a summary line even when there are zero diagnostics, aligning behavior with other formatters and preventing downstream tools from failing on empty stdout in CI.
Changes:
- Expose
get_diagnostic_result_outputto sibling formatters (pub(super)) for reuse. - Make the GitHub reporter’s
finish()return the standard summary string instead ofNone. - Update/add unit + snapshot tests to assert the presence of the summary output for GitHub formatting.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/oxlint/src/output_formatter/default.rs | Makes the shared summary-rendering helper available to sibling formatters. |
| apps/oxlint/src/output_formatter/github.rs | Ensures finish() always returns the standard summary output; updates/extends unit tests. |
| apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format=github ok.js@oxlint.snap | Snapshot now includes the summary line for the zero-diagnostics GitHub formatter run. |
| apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format=github test.js@oxlint.snap | Snapshot includes the summary line after GitHub annotations. |
| apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format=github parser-error.js@oxlint.snap | Snapshot includes the summary line for the parser-error GitHub formatter run. |
| apps/oxlint/src/snapshots/fixtures__cli__output_formatter_diagnostic_--format=github --report-unused-disable-directives disable-directive.js@oxlint.snap | Snapshot includes the summary line for unused-disable-directives output in GitHub format. |
This was referenced Mar 23, 2026
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.
Fixes #20402
Summary
get_diagnostic_result_output()fromdefault.rssofinish()returnsFound X warnings and Y errors.instead ofNoneChanges
default.rsget_diagnostic_result_outputvisibility topub(super)github.rsfinish()returnsSome(get_diagnostic_result_output(result))instead ofNone; update existing test + add new test::warning/::errorannotations are unaffected. The summary line simply appears in the CI log.Test plan
reporter_finishasserts summary content instead ofNone)reporter_finish_with_errorsadded for non-zero diagnosticsGITHUB_ACTIONS=true ./target/debug/oxlint --format githuboutputs summary on 0 diagnosticsjust readypassesThis PR was developed with assistance from AI tools (Claude).
All changes have been reviewed and tested.