Findings as JSON or SARIF
validate-03 · CLI transcript
The same run renders for machines: --format json emits the raw findings array, --format sarif feeds code-scanning uploads.
Builds on: Read a finding, fix the doc
The artifact
Section titled “The artifact”A terminal session: the command as you’d run it, followed by the output it prints; trailing comments note the exit status.
# the raw Finding[] for your own toolingmarkdown-contract validate ./decisions --format json[ { "id": "structure/section-missing", "level": "error", "path": "D-0007.md", "message": "required section ‘Decision’ is missing", "pos": { "line": 12, "col": 1 } }]
# SARIF 2.1.0 for code scanningmarkdown-contract validate ./decisions --format sarif > results.sarif# exit status: 1 either way — the format changes the report, never the verdictWhat it exercises
Section titled “What it exercises”--format json (raw Finding[])--format sarif (SARIF 2.1.0)format-independent exit codes
Continue
Section titled “Continue”- Previous: Read a finding, fix the doc
- Next: Bind a contract directly, scope the run
- Group: Validate from the terminal · All examples
- Reference: CLI reference