ALL-FILE0001 · empty_directories
Detect empty directories after repository Git ignores.
This is a deterministic rule for all languages. Read its implementation.
Definition
Section titled “Definition”Report a directory the repository walk met that holds no unignored content. Files and subdirectories both count, including a placeholder or a local Git ignore file. An empty directory is a decision nobody finished, either a package that was emptied without being deleted or a placeholder whose reason nobody wrote down, and every reader who meets it has to work out which.
The provider walks the tree rather than deriving directories from the files it parsed, which is the only way a directory holding no source can be seen at all. Version control stores files rather than folders, so a placeholder is itself the entry that makes an intentionally empty folder nonempty to this rule.
Evidence
Section titled “Evidence”Each finding names one repository-relative directory holding nothing visible, together with the count of content entries it holds. The result reports whether this directory is empty after Git ignores.
Exceptions
Section titled “Exceptions”A directory Git ignores is never scanned and its subtree is never entered, so ignored build trees, caches, and environments never reach this rule at all. A dotted directory the repository does not ignore is ordinary project layout and is judged like any other directory.
A directory a project retains on purpose is nonempty because the placeholder inside it is an ordinary unignored entry. No filename vocabulary is built into discovery.
Examples
Section titled “Examples”An empty src/unused directory that nothing ignores or retains returns true, and so does a
logs directory holding only a Git-ignored __pycache__. An unignored empty .workspace
returns true, a fixtures directory holding one .gitkeep returns false because that
placeholder retains it, and a tests/fixtures directory holding one file returns false.
References
Section titled “References”- Cites “Git documentation”, gitignore patterns. Open reference