Skip to content

CLI-06: Narrow the run with --include

–include scopes a directory run to a glob, validating only the matching subset.

Builds on: CLI-05: Validate a whole directory

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

Terminal window
# narrow the same run to a glob: only files matching tasks/**/*.md are validated
markdown-contract validate ./planning --include 'tasks/**/*.md' --contract planning.contract.yaml
Scanned 2 files; 1 matched, 1 unmatched
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’
1 finding(s): 1 error, 0 warn, 0 report
# exit status: 1 (error-level findings)
  • --include glob (run-root-relative; --glob is its alias)
  • runner include filter