Skip to main content

Module report

Module report 

Source
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). fix is { applicability: "safe"|"unsafe"|"suggest", edits: [{ line, col, end_line, end_col, text }] }. statistics is present only under --statistics, and diagnostics is 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; coverage with --coverage).
  • unused, resolve and adopt: htl::unused, htl::resolve and htl::adopt say 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§

CheckReport
CheckSummary
CoverageReport
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.
RuleStatistic
One row of htl check --statistics’s table, and of its --format json form: a rule with at least one finding this run, how many, and how many of those a fix covers.
TestCase
TestFile
TestReport
TestSummary

Functions§

emit
Print one document to stdout.