fix(gitignore): anchor "coverage/" to repo root (unblocks src/coverage/, packages/*/coverage/)#10
Open
mschreib28 wants to merge 1 commit into
Open
fix(gitignore): anchor "coverage/" to repo root (unblocks src/coverage/, packages/*/coverage/)#10mschreib28 wants to merge 1 commit into
mschreib28 wants to merge 1 commit into
Conversation
The unanchored "coverage/" rule (intended to ignore the test-output directory at repo root) silently matches any "coverage/" directory in the tree. This bit a real PR: src/coverage/ was added but never made it into the commit because git add silently dropped the files. The PR shipped with the test importing a module that didn't exist. Anchor the rule to "/coverage/" so it only ignores root-level test output, allowing src/coverage/, packages/*/coverage/, etc. to be committed normally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary\n\nThe
coverage/rule on line 21 of.gitignoreis unanchored — it matches anycoverage/directory in the tree, not just the test-output one at the repo root. This is a real footgun: when adding asrc/coverage/module (orpackages/*/coverage/in a monorepo),git addsilently drops the files with no warning.\n\nThis bit me on PR colbymchenry#124 — thesrc/coverage/module was written and tested locally, but never made it into the commit becausegit add src/coverage/was silently swallowed. The PR shipped with__tests__/coverage.test.tsimporting a module that didn't exist; whoever rebases or merges it hits a build failure that's confusing to debug.\n\nThe fix anchors the rule to the repo root:/coverage/. This still ignores the test-outputcoverage/at root (the original intent) while allowing source paths likesrc/coverage/to be committed normally.\n\n## Test plan\n\n- [x]git check-ignore -v src/coverage/foo.ts→ no longer matches\n- [x]git check-ignore -v coverage/lcov.info→ still matches the root-level rule\n- [x] No code changes; behavior is purely the gitignore semantics\n\nIndependent of the issue colbymchenry#120 merge guide — this can land any time and helps every future PR that touches anything namedcoverage/outside the repo root.\n\n🤖 Generated with Claude Code\nCopied from colbymchenry/codegraph#127