Repository navigation
feat: readable output for scan, diff-logs and generate - #3
Merged
Merged
Conversation
Signed-off-by: Ilan Harel <[email protected]>
Same visual language as lint: category icons, grouped output with file:line and source snippets, summaries, colour. diff-logs previews each fix as an inserted line; generate prints a summary on stderr and leaves the policy on stdout byte-identical. --format human|json|compact, --color and --no-icons are shared by scan, generate, diff-logs and lint; compact keeps the previous output. Signed-off-by: Ilan Harel <[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.
What
scan,diff-logsand thegeneratesummary get the same readable treatment aslint(PR #2): multi-line grouped output,file:linewith a source snippet, category icons, counts and colour.--> file:lineand the source line. Footer:✔ 8 directives in 4 filesand counts by category.+line above the line--writewould use (with the file's own comment leader), plus= why:/= where:/= add:. Footer counts suggestions and names the follow-up--writecommand.-o FILEis byte-identical for every format. The readable summary goes to stderr: rules with endpoints, access, binaries and thefile:linethey came from, filesystem roots, providers (and unmapped), process, wrapped warnings.Flags (shared with lint)
--format human|json|compact(defaulthuman),--color auto|always|never(honoursNO_COLOR,CLICOLOR_FORCE,TERM=dumb; forgeneratethe colour decision follows stderr),--no-icons/--ascii(also automatic for non-UTF-8 locales).--format compactis the previous output, byte for byte (checked against the old binary for scan and diff-logs, and for generate's stderr).--jsonstays an alias for--format json(conflicts with--format).generate --format jsonprints a JSON summary on stderr.Other
src/render.rs(new) holds the three renderers;report.rsonly exposes a few helpers.docs/CLI.mdregenerated,AGENTS.mdnote; the AI skill now uses--format compactforscananddiff-logs(parsing).needless_late_inithit by the newer stable toolchain insrc/directive.rs(pre-existing on main).Checks
TOOLCHAIN=1.94 scripts/ci-local.shpasses (fmt, clippy -D warnings, 46 integration tests + unit + docs tests, docs check);cargo +stable clippy --all-targets -- -D warningsclean.tests/golden) for scan, diff-logs and generate summary; byte-identical policy for every format and with-o; compact/json stability; colour and ASCII flag/env matrix for all three commands.