Skip to content

dir_only_contains

Every direct-child file of a directory matching select: must match at least one glob in allow:. Catches stray test data in src/.

- id: src-only-rs
kind: dir_only_contains
select: "src/*"
allow: ["*.rs", "README.md"]
level: error
OptionTypeRequiredDefaultDescription
allowstring or list of stringyesBasename glob(s) accepted as direct children. Anything else is a violation.
selectstringyesGlob selecting the directories to enumerate.

Plus the common level, id, and when fields. This rule analyses the whole repository, so it takes no paths. This table is generated from the JSON Schema; option types and defaults are authoritative.