Skip to content

checks list every check the validator can report

kac checks [--json] [--no-color]
Option What it does
--json Emit the check catalogue as JSON.
--no-color Turn colour off. NO_COLOR in the environment does the same.

What it does

checks prints every check the validator can report against your corpus. Read it to see what CI will hold that corpus to, and to find out whether the check you were about to add already exists.

kac reads the list from that corpus's own .schema/, so there is no second catalogue to keep in step. A corpus that declares a type of its own sees that type's checks here without any change to the tool. Checks says where a check comes from.

checks opens no record and reports no fault in one. validate runs these against documents.

Examples

The catalogue

kac checks

One check to a line, with the severity it reports at and what it proves, and a tally at the foot:

  error    schema-unknown-key             Every key in a schema file is one the loader reads.
  error    frontmatter-parses             The frontmatter block is present and parses as a YAML mapping.
  error    unknown-key                    Every frontmatter key is a universal field, a type field, or a reserved ADO key.
  warning  deprecated-has-successor       A deprecated tool states what replaces it.

164 checks: 101 error(s), 61 warning(s), 2 info.

Only an error fails the build. A warning is something to act on. An info reports something true that is nobody's fault, such as a version your own range holds back.

The catalogue as data

kac checks --json

One object per check, and nothing else on stdout. The tool's own test suite reads this form, and checks that every reachable check has a fixture that trips it.

A search for an existing check

kac checks | grep -i expiry

The catalogue is flat and keyed by id, so a grep over it answers faster than reading .schema/:

  warning  expiry                         An active deviation is still inside its review date.
  warning  draft-expiry                   A draft deviation is still inside its review date.

Known limits

A run also compares the catalogue against the rows generate writes onto each type page. A mismatch is reported on stderr and exits 1, whether or not you asked for --json.

A rule with no compiled expr: does not appear under its own rule id. A rule implemented in C# reports under the check id it emits, which the catalogue lists. A rule with no severity runs nothing, so checks does not list it. A rule with no severity: says where it appears.

Checks is the page for adding a check.