Keep a root node_modules out of the vault - #953
Conversation
`.gitignore` ignores `**/node_modules/**`, then re-includes markdown at any depth with `!*.md` -- a pattern with no slash, so it matches everywhere. Git takes the last matching rule, so the re-include wins and every README.md inside node_modules is stageable. That is CORRECT for THE-GEMSTONE/node_modules, which is vendored content this vault tracks on purpose: 49 .md files, preserved deliberately in #939. It is wrong for a root node_modules, which npm regenerates from package-lock.json and which nobody should commit. Measured with `git add --dry-run node_modules/`: 2 files leak with main's dependencies today (prettier only) 466 files leak with the eight devDependencies #950 adds Both are vendored README files. One `git add -A` after an `npm install` puts them in the repo. The new rule is last in the file and must stay last -- it only beats the markdown re-include by coming after it. The leading slash anchors it to the repo root. Verified, all four cases: root node_modules markdown -> now ignored (was: !*.md at line 159) `git add --dry-run node_modules/` -> 0 files (was: 2 here, 466 with #950) THE-GEMSTONE/.../lib.md -> still tracked, unchanged CONSTITUTION.md -> unaffected tracked file count -> 38,424, unchanged This is a shared surface, so it is a proposal rather than something folded into another PR: it stands alone and changes nothing until merged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBV6TkrwsZhcwkh1b6NUHs
|
Warning Review limit reached
Next review available in: 45 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's guide (collapsed on small PRs)Reviewer's Guide.gitignore is updated to ensure markdown files under a root-level node_modules are ignored while preserving tracking of vendored markdown files under THE-GEMSTONE/node_modules, with an explanatory comment about rule ordering and root anchoring. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Up to standards ✅🟢 Issues
|
|
Insufficient balance to process this code review. Please add funds or upgrade your plan in billing. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
Copilot: the six entries were unanchored basename patterns, so git applied them at any depth. Measured before the fix: some/deep/dir/.pylintrc text: set .codex/skills/ruleset.xml text: set sub/.bandit text: set That directly contradicts this PR's own claim -- "no pattern, so no file outside the named six can be affected." A .gitattributes pattern with no slash is a basename match, exactly like .gitignore. Which is the same trap I documented in #953 one PR earlier, in the other direction. Each entry now carries a leading slash. Verified after: root .bandit/.pylintrc/.remarkrc/.shellcheckrc/.stylelintrc/ruleset.xml text: set (unchanged) some/deep/dir/.pylintrc text: unspecified (was: set) .codex/skills/ruleset.xml text: unspecified (was: set) sub/.bandit text: unspecified (was: set) RSS.xml text: unspecified (unchanged) The comment now explains the anchoring alongside the `*.xml` note, since the two traps have the same root cause: git pattern matching is path-anchored only when the pattern contains a slash. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EBV6TkrwsZhcwkh1b6NUHs
|
PING! |
Pull Request Summary by devActivityMetricsAchievements
|
AGENT PR TEMPLATE
Agent: Claude Code (
agent:claude-code)Date: 2026-08-11
Branch:
claude/gitignore-node-modules-qzt7le→mainChanges Made
One rule appended to
.gitignore, plus the comment explaining why it must stay last..gitignore:101ignores**/node_modules/**..gitignore:159then re-includes markdown with!*.md— no slash, so it matches at any depth. Git takes the last matching pattern, so the re-include wins and everyREADME.mdinside anynode_modulesis stageable:That is correct for
THE-GEMSTONE/node_modules— vendored content this vault tracks on purpose, 49.mdfiles, preserved deliberately in #939. It is wrong for a rootnode_modules, which npm regenerates frompackage-lock.jsonand which nobody should commit.Measured, both ways
git add --dry-run node_modules/after a realnpm ci:All vendored README files. One
git add -Aafter annpm installputs them in the repo — which is exactly why I staged #950 file-by-file rather than with-A.Verified, all four cases
node_modules/**/*.md!*.md)git add --dry-run node_modules/THE-GEMSTONE/node_modules/whatwg-encoding/lib/lib.mdCONSTITUTION.mdThe leading slash is what makes the third row true — it anchors the rule to the repo root, so the vendored tree is untouched.
Why this is its own PR
.gitignoreis a shared surface, and the file's own header says to tread lightly there and to verify withcheck-ignorerather than eyeball it. So this stands alone as a proposal rather than being folded into #950: it changes nothing until you merge it, and the verification above is the evidence you'd want before doing so.The hazard is live regardless of whether #950 merges — anyone who runs
npm installat the root and thengit add -Ahits it today, just at 2 files instead of 466.Related Work
Blockers
Checklist:
git check-ignore --no-indexon all four cases above andgit add --dry-run node_modules/before and after, against a realnpm citree.check_portable_paths.pypasses.Risk Level:
One file and one rule, but
.gitignoreis load-bearing here and a wrong pattern silently untracks content. Hence the four-case verification rather than a claim.Labels to apply:
agent:claude-codehttps://claude.ai/code/session_01EBV6TkrwsZhcwkh1b6NUHs
Generated by Claude Code
Summary by Sourcery
Build: