Checks#
Each entry in a collection’s checks: list has a kind and the keys that
check type requires. Every check type is documented one per page in the
check types reference:
checks:
- kind: object
schema: book
- kind: object_field_type
field: year
type: integer
- kind: markdown_title_matches_h1
- kind: filesystem_name_matches_fieldText rules#
The text_* check types lint the item body as raw text, independent of
markdown structure, and also apply to plain-text items (a .txt file or a
markdown file with no frontmatter). Each is evaluated against a set of spans
chosen by target:
target | Spans |
|---|---|
body (default) | the entire body as one multiline string |
line | each body line |
first-line | the first non-blank body line |
matched-lines | each body line matching select: <regex> |
text_requiresandtext_forbidstake a Gopattern, matched unanchored (it must appear somewhere in a span: unlikefilesystem_name_regex, which anchors with^...$).text_requiresalso takesmatch: any(default, at least one span matches) ormatch: all(every span must match).text_denylisttakesvalues:, a list of literal substrings; regex metacharacters are inert.text_forbidsmay declare afix:: a replacement template ($1,${name}capture syntax) applied to the matched text bykatalyst fix. The fix re-checks its own work and fails rather than writing a file the rule would still reject.text_requiresandtext_denylistare report-only.
Object-schema resolution precedence#
When an item is checked against an object schema, the schema is chosen highest-precedence first:
--schema <path>flag (applies to every selected item).- Inline
schema: <name>key in the item’s frontmatter. - The collection’s
objectcheck (fromschema:or an explicit entry), plus the matched variant’s schema: both apply, additively.
Markdown and filesystem checks always come from the collection (and the matched
variant), even when --schema is used.