Skip to content

CLI-05: Validate a whole directory

Passing a directory validates every markdown file the discovered config routes, aggregating findings.

Builds on: CLI-02: Read a single human finding with line:col

A terminal session: the command as you’d run it, followed by the output it prints; trailing comments note the exit status.

Terminal window
# validate a whole tree; findings aggregate across files, ordered by path then line
markdown-contract validate ./planning --contract planning.contract.yaml
Scanned 2 files; 2 matched, 0 unmatched
notes/note.md:3 error frontmatter/unknown-key unknown frontmatter key ‘reviewer’
tasks/T-9001.md:4 error frontmatter/enum frontmatter field ‘status’ must be one of ‘planning/draft’, ‘planning/proposed’, ‘planning/needs-definition’, ‘planning/backlog’, ‘open/ready’, ‘in-progress’, ‘in-progress/blocked’, ‘closed/done’, ‘closed/superseded’, ‘closed/partially-superseded’, ‘closed/obsoleted’, ‘closed/relocated’, ‘closed/no-repro’, ‘closed/wontdo’
2 finding(s): 2 error, 0 warn, 0 report
# exit status: 1 (error-level findings)
  • validate <dir>
  • runner aggregates findings across files
  • findings deterministically ordered by path then line