Skip to content

Config file (.dryrc) with ignore globs and per-path threshold/minNodes overrides #23

Description

@Dominik-O22

Problem

Options.parse (src/Options.ts L73) is CLI-only, and the only path filtering is .gitignore (TypeScriptDuplicateFinder.gitignoreMatcher). Consequences:

  • No persisted, repo-checked-in ignore globs independent of .gitignore.
  • One global threshold/minNodes/minLines for the whole scan — you can't run tests/** looser than src/**, even though test arrange-blocks are a known noise source (≈half the clusters on the abholer run).

Proposed change

Load a config file (.dryrc / dry.config.json) and merge it under CLI precedence:

  1. In Options (or a small loader feeding Options.from), read the config from cwd; CLI flags override config, config overrides Options.defaults().
  2. Support ignore: string[] globs applied in addition to .gitignore in typeScriptFiles (reuse the existing ignore dependency).
  3. Support overrides: [{ paths: glob, threshold?, minNodes?, minLines? }]. Plumb per-path config into clustersFor/matchingPairs (FileScanner is already per-file, so per-file threshold/minNodes is tractable; document the rule for a pair spanning two override scopes — e.g. use the stricter of the two).

Acceptance

  • A config setting minNodes: 30 for tests/** and 20 for src/** produces the expected per-tree filtering in a single run.
  • ignore globs exclude matching files without touching .gitignore.
  • CLI flags still override config values.

Related

The umbrella config surface for the false-positive-reduction set; per-path excludeKinds/minDistinctKinds from the sibling issues can ride on the same overrides mechanism.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions