Checks#
Each check instance has a kind and the keys that check type requires. A check
instance can be attached to a collection under collections.<name>.checks, or
to a raw filesystem scope under filesystemChecks[].checks when the check
type supports the filesystem target. 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_fieldConfiguration Sites#
Collection-attached checks run after a file belongs to a collection. They can use collection schemas, variants, item selectors, and collection-wide sibling sets:
collections:
posts:
path: content/posts
checks:
- kind: markdown_requires_h1
- kind: filesystem_name_case
style: kebabFilesystem-attached checks run from filesystem base config. They select files
with include and exclude globs and do not require collections to exist:
filesystemChecks:
- name: docs
path: docs/content
include: ["**/*.md"]
parseFailures: warning
checks:
- kind: filesystem_name_case
style: kebab
- kind: filesystem_name_matches_field
field: titlekatalyst check with no selector runs filesystem scopes first, then collection
checks. katalyst check <collection> and katalyst check <collection>/<item>
run collection checks only. Filesystem scopes reject check types that do not
list filesystem in configurableIn.
Document-aware filesystem checks parse selected files only when needed.
parseFailures: error is the default and fails the run on parse errors.
parseFailures: warning reports the parse error as advisory and skips
document-aware checks for that file.
Text 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.