Skip to content

CLI-07: Carve out files with --exclude

–exclude drops matching files from the run, here skipping archived entities.

Builds on: CLI-06: Narrow the run with –include

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

Terminal window
# drop matching files; the failing archived doc is excluded, leaving a clean tree
markdown-contract validate ./planning --exclude '**/archive/**' --contract planning.contract.yaml
Scanned 2 files; 1 matched, 1 unmatched
No findings.
# exit status: 0 (nothing left fails)
  • --exclude glob (run-root-relative)
  • runner exclude filter
  • exit 0 when nothing left fails