fix(standardize-repo): scan only non-ignored files for template markers#22
Merged
Merged
Conversation
verify-applied.sh's "unrendered template markers" check recursively grepped the whole tree (excluding only .git/node_modules), so an applied iac repo false-failed on vendored dependencies in gitignored dirs — .venv ships Ansible's own .j2/jinja plugin docs and .terraform caches provider source. `task verify` and gitleaks (which respects .gitignore) both pass; only this structural check tripped. Enumerate files the way gitleaks does — honoring .gitignore — via `git ls-files --cached --others --exclude-standard`, covering tracked AND untracked-but-not-ignored files so a freshly rendered, not-yet-staged repo is still fully checked. The recursive-grep fallback (with explicit excludes for .venv/.terraform/.task/.worktrees/dist) remains for non-git targets. Verified: PASS on a real applied repo (sommerlawn-infra) that previously false-failed; still catches real leaks in both tracked and untracked files; correctly ignores a gitignored leak. shellcheck --severity=error and shfmt -i 4 clean. Surfaced applying harmon-init to sommerlawn-infra. Co-Authored-By: Claude Opus 4.8 (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.
Summary
verify-applied.sh's "unrendered template markers" check recursively greppedthe whole tree (excluding only
.git/node_modules). markdownlint-cli2 isn't theonly tool blind to
.gitignore— this grep was too, so an applied iac repofalse-failed on vendored dependencies in gitignored dirs:
.venvships Ansible's own.j2/jinja plugin docs,.terraformcaches providersource.
task verifyandgitleaks(which respects.gitignore) both pass — onlythis structural check tripped.
Fix
Enumerate files the way gitleaks does — honoring
.gitignore— viagit ls-files --cached --others --exclude-standard. That covers tracked ANDuntracked-but-not-ignored files, so a freshly-rendered, not-yet-staged repo (the
common case right after
copier copy, beforegit add) is still fully checked.A recursive-grep fallback (with explicit
.venv/.terraform/.task/.worktrees/distexcludes) remains for non-git targets.
This fixes the root cause rather than enumerating individual dirs to skip — any
gitignored path is now correctly out of scope, matching gitleaks.
Test plan
sommerlawn/sommerlawn-infra) that previouslyfalse-failed. ✅
[[ project_name ]]→ caught (validates the--otherspath){{ author_full_name }}→ caught (--cachedpath).gitignore)shellcheck --severity=error --exclude=SC3037 --exclude=SC2148clean;shfmt -i 4clean; bash 3.2 portable. ✅Context
Surfaced applying harmon-init to
sommerlawn-infra. Companion toevanharmon1/harmon-init#84 (the same false-positive hit the template's
lint:markdownglob, fixed there).🤖 Generated with Claude Code