fix(test-all): scan only tracked files via git grep#185
Open
matkatmusic wants to merge 1 commit intosantifer:mainfrom
Open
fix(test-all): scan only tracked files via git grep#185matkatmusic wants to merge 1 commit intosantifer:mainfrom
matkatmusic wants to merge 1 commit intosantifer:mainfrom
Conversation
The personal-data-leak and absolute-path checks used bare `grep -rn .`
which walks the entire working directory, only excluding 3 hardcoded
paths. This produced two problems:
1. False positives on untracked files. Any local-only file with a
`/Users/` path or a stray "Santiago" — debate artifacts from
/octo:debate, AI scratch dirs, plan drafts, Todos/ — would fail the
test even though they could never reach a commit. The test exists
to block bad commits, but it was punishing files git would never
ship.
2. Silent misses on tracked files. Brace expansion in
`--include="*.{md,yml,...}"` apparently failed to match the i18n
READMEs santifer added in v1.3.0 (README.es.md, README.ja.md,
README.ko-KR.md, README.pt-BR.md), so the leak check was running
green while 36+ legitimate matches in those files went unscanned.
Fix: replace `grep -rn` with `git grep -n`. git grep only sees files
in the index, so:
- untracked files can never false-positive
- .gitignore is honored automatically
- the manual `| grep -v node_modules | grep -v .git/ | grep -v go.sum`
pipeline disappears (git grep already excludes these)
- the i18n READMEs get scanned for the first time
Side effect: surfaces the previously-hidden matches in localized
READMEs and v1.3.0 community files (CODE_OF_CONDUCT, SECURITY,
SUPPORT, dashboard credits). Added these to `allowedFiles` so they
warn-clean — they all legitimately credit the maintainer.
Verification:
- node test-all.mjs --quick → 63 passed, 0 failed, 0 warnings
- Planted /Users/santifer/test in tracked doctor.mjs → still fails ✅
- Planted /Users/foo in untracked debates/test/test.md → no false positive ✅
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Closes #184.
Summary
The personal-data-leak check and absolute-path check in `test-all.mjs` use bare `grep -rn .`, which walks the entire working directory and only excludes a few hardcoded paths. This causes two opposite-sign bugs documented in #184:
Approach
Replace `grep -rn` with `git grep -n` in both checks. `git grep` only sees files in the index, so:
Side effect: 36+ previously-hidden matches surfaced
The more thorough scan picks up legitimate maintainer credits in v1.3.0 community files. Added them to `allowedFiles`:
These are all legitimate references to Santiago / santifer.io as the maintainer, so they're correctly classified as allowed rather than suppressed.
Verification
Diff stats: `+25 -6` in a single file. No new dependencies.
Test plan
Notes
🤖 Generated with Claude Code