feat: add compact output format - #84
Open
choplin wants to merge 1 commit into
Open
Conversation
The default text output prints every passing check, the token tables, and the analysis sections for each skill. Validating a directory of skills produces hundreds of lines in which the few findings that need attention are buried. Add -o compact, which renders each skill as a single line naming it and its outcome, with any warnings and errors listed beneath it. Passing and informational findings, token counts, and the content and contamination analysis sections are omitted. Only the rendering changes: finding counts, the overall summary, and exit codes are still computed from the full report, and the other output formats are untouched.
choplin
force-pushed
the
feature/compact-output
branch
from
July 29, 2026 07:36
0404e01 to
25d15a3
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.
What this PR does
Adds
-o compact, a text output format that reduces each skill to a single line and lists only its warnings and errors.The default text output prints every passing check, the token tables, and the content and contamination analysis sections for each skill. That is the right default when you are working on one skill, but when running
checkover a directory of skills — the common pre-commit and CI case — it produces hundreds of lines in which the few findings that need attention are buried. Today the only way to get a terse view is-o jsonplus ajqfilter.Compact output looks like this:
Passing and informational findings, token counts, and the analysis sections are omitted. Separators are not drawn, so the per-skill lines read as a list.
Only the rendering changes. Finding counts, the overall summary, and exit codes are still computed from the full report, so
-o compactand-o textalways agree on pass/fail and on--strictbehaviour.Design notes
An output format rather than a
--compactflag. A boolean flag would raise the question of what--compact -o jsonmeans, and would need either an error or a documented precedence rule. Making compact a value of the existing--outputenum makes it mutually exclusive with the other renderers by construction, and matches how it is used in practice: it is a way to render a report, likemarkdown.--emit-annotationsstill composes with it, as with every other format.A separate renderer rather than a mode inside
Print.report/compact.gobuilds its own output fromtypes.Reportinstead of adding suppression branches to the existing renderer, which keeps the full text output exactly as it was.Level threshold is fixed at warning. An earlier draft exposed a
--min-levelflag so the threshold was configurable. It was dropped: the only threshold with a real use case is "show me what needs attention", anderror-only would hide warnings that still affect the exit code, which is a confusing thing to offer. If a use case for error-only output appears later, it can be added without changing this format.How to test
Covered by tests:
report/compact_test.go— a passing skill renders as exactly one line; warnings and errors are listed indented beneath the summary; pass and info findings, token counts and analysis sections are omitted; the icon reflects the worst level present; multi-skill output has no separators and keeps the overall summary.cmd/compact_integration_test.go— drives the built binary end to end, asserting the rendering above and that exit codes (0/1/2) are unaffected, plus a guard that the default text output is unchanged.Checklist
go test -race ./... -count=1)golangci-lint run)-o compactis additive and the existing formats are untouchedNote: CONTRIBUTING.md asks that new output formats be discussed in an issue first. I had already built this for my own use, so I am opening it as a concrete proposal rather than a request to write it — happy to move the discussion to an issue, or to close this if the direction does not fit the project.