Skip to content

Discovery hard-codes excluded folders; only ignore files should exclude anything by default #71

Closed

Description

@Shinrai

Problem

By default every file should be processed. The consumer can exclude more (excludeFolders, --exclude-folder), and the only automatic exclusions should be what the project's ignore files say (.gitignore and the like).

Today discovery (src/core/file-discovery.mjs, src/constants.mjs) also skips names that no ignore file lists:

  • ALWAYS_IGNORE_FOLDERS = .git, node_modules at any depth;
  • ROOT_IGNORE_FOLDERS = dist, build, coverage, tmp, .next, .turbo at the project root.

And only the root .gitignore is read: nested .gitignore files, .git/info/exclude and git's global excludes file (core.excludesFile) are ignored, so the "ignore files decide" rule can't be relied on.

Expected

  • Nothing is excluded by name. A file is skipped only when an ignore file ignores it, or the consumer excluded it.
  • "Ignore files" means everything git itself honours: the root and nested .gitignore files, .git/info/exclude and core.excludesFile. Inside a git work tree, ask git (e.g. git ls-files --cached --others --exclude-standard, or git check-ignore) instead of re-implementing its rules; outside one, fall back to parsing the .gitignore files found under the root.
  • .git itself (git's own storage, never a project file) is still never walked.
  • gitignore: false keeps disabling ignore-file exclusion; explicit gitignore paths keep working.
  • The removed constants are part of the public surface only if exported from the package entry — check, and keep backward compatibility or document the change.

Tests

node_modules / dist / coverage included when not ignored and excluded when a .gitignore lists them; nested .gitignore; .git/info/exclude; core.excludesFile; non-git folder fallback; gitignore: false; .git never walked; consumer excludeFolders still applied.

Activity

  1. added
    type: bug
    priority: high
    area: core
    status: in progress
    status: implemented
    and removed
    status: in progress
    on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corepriority: highstatus: implementedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions