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
Generated files (protobuf/openapi/prisma output, *.gen.ts, bundled barrels) are a large structural-duplicate source: codegen emits near-identical shapes by design, so they cluster trivially and drown real findings. The only escape today is .gitignore (gitignoreMatcher in src/TypeScriptDuplicateFinder.ts) or --no-gitignore, neither of which targets generated code specifically — generated files are often committed and not gitignored.
Proposed change
Two complementary mechanisms:
Header sniff: skip a file in FileScanner.scanFile (src/FileScanner.ts) when its leading bytes match a common generated banner (e.g. // Code generated, @generated, eslint-disable + DO NOT EDIT, prettier-ignore codegen markers). Read the first ~1KB only.
Default behavior must stay opt-in or clearly documented — header sniff is low-risk (generated files rarely carry hand-written duplicates worth catching), but a default glob list changes output, so version it.
Acceptance
A file with a @generated banner is skipped; removing the banner restores scanning.
A *.gen.ts file is excluded under the default/opt-in glob, without touching .gitignore.
Related
Part of the false-positive-reduction set (#19-#24). Surfaced by a codex second-opinion on that set. Pairs with .dryrc ignore globs (#23).
Problem
Generated files (protobuf/openapi/prisma output,
*.gen.ts, bundled barrels) are a large structural-duplicate source: codegen emits near-identical shapes by design, so they cluster trivially and drown real findings. The only escape today is.gitignore(gitignoreMatcherinsrc/TypeScriptDuplicateFinder.ts) or--no-gitignore, neither of which targets generated code specifically — generated files are often committed and not gitignored.Proposed change
Two complementary mechanisms:
FileScanner.scanFile(src/FileScanner.ts) when its leading bytes match a common generated banner (e.g.// Code generated,@generated,eslint-disable+DO NOT EDIT,prettier-ignorecodegen markers). Read the first ~1KB only.**/*.gen.ts,**/__generated__/**,**/*.pb.ts), opt-out via flag, and extensible via the.dryrcignorelist (issue Config file (.dryrc) with ignore globs and per-path threshold/minNodes overrides #23 / plan 011).Default behavior must stay opt-in or clearly documented — header sniff is low-risk (generated files rarely carry hand-written duplicates worth catching), but a default glob list changes output, so version it.
Acceptance
@generatedbanner is skipped; removing the banner restores scanning.*.gen.tsfile is excluded under the default/opt-in glob, without touching.gitignore.Related
Part of the false-positive-reduction set (#19-#24). Surfaced by a codex second-opinion on that set. Pairs with
.dryrcignore globs (#23).