Expand description
--format json: the same facts the text output prints, as one JSON document on
stdout (text goes to stderr, so the two never mix), and the same exit code as in text
mode. Field names are stable; new fields may be added, existing ones are not renamed.
check:{ files, patched, diagnostics: [{ severity: "error"|"warning"|"lint", file, line, col, rule?, message, fix?, required_by?, origin? }], summary: { errors, warnings, lints, denied, strict, ok, cached, replayed }, statistics?: [{ rule, count, fixable, unsafe_fixable }] }(CheckReport,CheckSummary,RuleStatistic,htl::Diagnostic).fixis{ applicability: "safe"|"unsafe"|"suggest", edits: [{ line, col, end_line, end_col, text }] }.statisticsis present only under--statistics, anddiagnosticsis then empty: the two never both carry the run’s findings.test:{ files: [{ path, ok, diagnostics, error?, file_level, passed, failed, failures, tests: [{ name, ok, ms }], duration_ms, snapshots_written, snapshots_updated }], summary: { files, files_run, passed, failed, files_with_errors, replayed, duration_ms, ok, seed }, coverage?: { modules: [{ path, executed, total, unexecuted: [[first, last]], never_ran?: [{ name, line }] }], executed, total } }(TestFile,TestSummary;coveragewith--coverage).unused,resolveandadopt:htl::unused,htl::resolveandhtl::adoptsay their shapes.
GitHub Actions annotations from a check, for instance:
htl check . --format json | jq -r '.diagnostics[] |
"::\(if .severity == "error" then "error" else "warning" end) file=\(.file),line=\(.line),col=\(.col)::\(.message)"'Structs§
- Check
Report - Check
Summary - Coverage
Report - What a whole run covered: the modules it entered, and the totals over them.
- Diagnostic
- One
error:/warning:/lint:finding, split into its parts. - FixApplied
- FixFile
- FixReport
- FixSkipped
- FixSummary
- Out
- Where a diagnostic goes once the run has decided to say it: printed as it comes
(text) or kept for the document (json) — or, under
--statistics, neither, since the table it asked for is the tally alone. - Rule
Statistic - One row of
htl check --statistics’s table, and of its--format jsonform: a rule with at least one finding this run, how many, and how many of those a fix covers. - Test
Case - Test
File - Test
Report - Test
Summary
Functions§
- emit
- Print one document to stdout.