Skip to content

fix(git-diff): drop the dead eslint.rc config pattern and test every entry - #106

Merged
adityankale190895 merged 3 commits into
DiffCI:mainfrom
sarankumar1325:fix/config-patterns-dead-eslint-rc
Nov 11, 2026
Merged

adityankale190895 merged 3 commits into
DiffCI:mainfrom
sarankumar1325:fix/config-patterns-dead-eslint-rc

Conversation

@sarankumar1325

@sarankumar1325 sarankumar1325 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #100

CONFIG_PATTERNS in src/git/git-diff.ts contained /^eslint\.rc/, which matches a file name ESLint never reads. The legacy config files are .eslintrc, .eslintrc.json and so on, and the next entry, /^\.eslint/, already covers them. This PR removes the dead entry. It also removes /^(npm|pnpm|yarn)-lock\./, which was dead in the same way: npm and Yarn write no npm-lock.* or yarn-lock.* file, and pnpm-lock.yaml already has its own entry. Fallback behaviour for real files does not change.

To make it testable, CONFIG_PATTERNS is now exported, with a comment saying the export is for tests.

Tests

New file tests/repo/config-patterns.test.ts:

  • A table pairs each entry with one real file name, in order (for example next.config.mjs, .eslintrc.json, Dockerfile.dev, uv.lock), and checks that every entry matches its example.
  • The table must be the same length as CONFIG_PATTERNS. That way, a new entry without an example fails, and so does an entry that stops matching anything.
  • No entry matches eslint.rc, npm-lock.json or yarn-lock.yaml. These checks fail without the removals.

npm test gives 846 passed. npm run typecheck is clean.

…entry

/^eslint\.rc/ matched no file ESLint reads; the legacy .eslintrc* files are
already covered by /^\.eslint/. A table test now pairs each CONFIG_PATTERNS
entry with one real file name, so the next dead pattern is caught too.

Fixes DiffCI#100

Signed-off-by: sarankumar1325 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T05:30:01.196709Z 022b2e4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 022b2e4319

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/repo/config-patterns.test.ts Outdated
"yarn.lock",
"pnpm-lock.yaml",
"bun.lockb",
"npm-lock.json",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use an npm-supported name for this fixture

npm-lock.json is not a filename npm reads; this repository recognizes package-lock.json and npm-shrinkwrap.json as npm lockfiles (src/repo/lockfiles.ts:10). This fixture therefore makes /^(npm|pnpm|yarn)-lock\./ pass using a fabricated npm filename, so the new guard against dead config-pattern entries still blesses the unsupported npm-lock arm. Remove or rework that arm, or validate it with an actually supported filename.

Useful? React with 👍 / 👎.

sarankumar1325 and others added 2 commits November 11, 2026 11:19
/^(npm|pnpm|yarn)-lock\./ matched no lockfile npm or Yarn writes, and
pnpm-lock.yaml already has its own entry. The table test used a made-up
npm-lock.json to keep it alive; it now checks that name matches nothing.

Signed-off-by: sarankumar1325 <[email protected]>
@adityankale190895
adityankale190895 merged commit 348cc34 into DiffCI:main Nov 11, 2026
11 checks passed
adityankale190895 added a commit that referenced this pull request Nov 11, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityankale190895 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CONFIG_PATTERNS: remove the dead eslint.rc entry and test every pattern

2 participants