You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 01fc911
Browse filesBrowse the repository at this point in the historyBrowse files
fix: discover each file once when includeFolders overlap
discoverFiles() walked every includeFolders entry independently and
concatenated the results, so a file under two entries ("." next to
"src", "src" next to "src/core", duplicate or differently spelled
entries) was returned, and then processed with its git lookups, once
per entry. slothlet's include list discovered 1920 paths for 963 files.
Each root is now stat'ed and canonicalized (realpath) up front, and a
root is dropped before any walk when another root already covers it:
the same folder, or a folder inside it that the outer walk actually
descends into. A folder the outer walk never enters (under node_modules
or a root build folder) keeps being walked on its own, as before.
Surviving roots are walked in input order, so non-overlapping inputs
keep their existing output order, and the result is de-duplicated by
path as a final guard.
Fixes#59
-`includeFolders?: string[]` - project-relative folders to scan
96
+
-`includeFolders?: string[]` - project-relative folders to scan. Overlapping entries are collapsed, so every file is scanned once however the folders nest or are spelled (`"."` next to `"src"`, `"src"` next to `"src/core"`, `"./src"` next to `"src/"`)
97
97
-`excludeFolders?: string[]` - folder names or relative paths to exclude
98
98
-`gitignore?: boolean | string | string[]` - respect `.gitignore` during discovery. `false` disables; a path or array of paths loads those ignore files; anything else / omitted auto-detects `<projectRoot>/.gitignore`. Matched files and directories are skipped.
99
99
-`projectName?: string`
@@ -138,6 +138,7 @@ const result = await fixHeaders({
138
138
## Notes
139
139
140
140
-`excludeFolders` supports both folder-name and nested path matching.
141
+
-`includeFolders` entries never double-count a file. A folder that lies inside another include is not walked a second time; the exception is a folder the outer walk never enters (for example one under `node_modules` or under a root build folder such as `dist`), which keeps being walked on its own because it was named explicitly.
141
142
- Built-in ignores are scoped: `.git` and `node_modules` are skipped at **any depth**, while build/cache directories (`dist`, `build`, `coverage`, `tmp`, `.next`, `.turbo`) are skipped **only at the project root** — so a source directory that happens to share a name (for example `tools/build`) is still processed.
142
143
- With `gitignore` enabled (the default, auto-detecting the project's `.gitignore`), anything the project ignores is skipped during discovery — generated paths are excluded by the project's own rules without hard-coding names. Pass `gitignore: false` to disable, or a path/array to use specific ignore files.
143
144
- For monorepos, each file resolves metadata from the closest detector config in its parent tree.
0 commit comments