feat(cmd/crucible): machine-readable lint/diff output + diff exit-code gate#182
Merged
Merged
Conversation
…ode gate lint gains -format text|json|sarif; diff gains -format text|json and an opt-in -exit-code that exits non-zero when the recommended bump is major (at least one breaking change), so lint and diff results can drive CI gates and code-scanning. - JSON is built from CLI-local DTOs; the state/analysis and state/evolution types are unchanged. SARIF is 2.1.0 (lint only) and anchors the IR path as a physical location except for stdin input. - Exit codes preserved: lint still exits non-zero on findings in every format. - Flags are accepted in any position; both subcommands route through reorderArgs. Closes #172.
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.
Closes #172.
What
Makes
crucible lintanddiffconsumable by CI gates and code-scanning — they previously emitted human text only.lint -format text|json|sarif(defaulttext). SARIF is 2.1.0 (uploadable to GitHub code-scanning); each finding becomes a result withruleId=kind, mappedlevel, a logical location for the state/transition, and the IR path as a physical location (omitted for stdin-).diff -format text|json(defaulttext).diff -exit-code(opt-in): exits non-zero when the recommended bump ismajor(≥1 breaking change), so a diff can gate CI. Default behavior (always exit 0) is unchanged.Design notes
state/analysisandstate/evolutiontypes are untouched.lintstill exits non-zero on findings in every format (SARIF-upload-then-gate flows should ignore the exit code).reorderArgs).Verification
go build/go vet/go test(71 pass, 18 new) /golangci-lint(0 issues) — all green incmd/crucible.diff -exit-code(major→1, minor→0, no-flag→0), stdin SARIF carries no physical location, unknown/unsupported format → usage exit.