Skip to content

dir_exists

Directory counterpart of file_exists. Every match must correspond to a real directory in the walked tree.

- id: docs-dir-exists
kind: dir_exists
paths: "docs"
root_only: true
level: error

Optional root_only: true (like file_exists) requires the match to be a directory directly at the repository root, not nested. Optional git_tracked_only: true further requires that the directory contain at least one tracked file. A tree with a docs/ checked out from a stale clone where every file was later removed via git rm would fail under this stricter check. See The walker and .gitignore for the full semantics.

OptionTypeRequiredDefaultDescription
git_tracked_onlygit tracked only
root_onlybooleanfalseIf true, only a directory directly at the repository root satisfies the rule.

Plus the common paths, level, id, and when fields. This table is generated from the JSON Schema; option types and defaults are authoritative.