feat(cli): implement json, json-pretty, and summary reporters#695
Merged
feat(cli): implement json, json-pretty, and summary reporters#695
Conversation
The CLI advertised these as valid --reporter values but they were not implemented, causing an error when used. Adds the three missing reporter variants with snapshot tests. JSON output shape aligned with Biome: summary object with numeric nanos duration, per-diagnostic message/category/location, command field, and zero-span fallback when source location is unavailable. Summary reporter reuses ConsoleTraversalSummary from terminal reporter and groups diagnostics by file with per-file error/warning counts. Closes #694 Co-Authored-By: Claude Opus 4.6 <[email protected]>
507245c to
11e9e49
Compare
Co-Authored-By: Claude Opus 4.6 <[email protected]>
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
Json,JsonPretty, andSummaryvariants toCliReporterenum and wires them throughReportModedispatchjson.rsreporter: outputs diagnostics as JSON with human-friendly line/column locationssummary.rsreporter: outputs only aggregate counts (errors, warnings, file stats, duration)Closes #694
Test plan
cargo test -p pgls_cli --test assert_check— all 9 tests passcargo clippy -p pgls_cli --all-targets --all-features— no new warnings--reporter json,--reporter json-pretty,--reporter summary