Skip to content

fix(standardize-repo): scan only non-ignored files for template markers#22

Merged
evanharmon1 merged 1 commit into
mainfrom
fix/verify-applied-skip-gitignored
Jun 23, 2026
Merged

fix(standardize-repo): scan only non-ignored files for template markers#22
evanharmon1 merged 1 commit into
mainfrom
fix/verify-applied-skip-gitignored

Conversation

@evanharmon1

Copy link
Copy Markdown
Owner

Summary

verify-applied.sh's "unrendered template markers" check recursively grepped
the whole tree (excluding only .git/node_modules). markdownlint-cli2 isn't the
only tool blind to .gitignore — this grep was too, so an applied iac repo
false-failed on vendored dependencies in gitignored dirs:

FAIL: unrendered template markers found in:
    ./.venv/lib/python3.14/site-packages/ansible/plugins/filter/to_nice_yaml.yml
    ./.venv/.../ansible/galaxy/data/default/role/meta/main.yml.j2
    ...

.venv ships Ansible's own .j2/jinja plugin docs, .terraform caches provider
source. task verify and gitleaks (which respects .gitignore) both pass — only
this structural check tripped.

Fix

Enumerate files the way gitleaks does — honoring .gitignore — via
git ls-files --cached --others --exclude-standard. That covers tracked AND
untracked-but-not-ignored
files, so a freshly-rendered, not-yet-staged repo (the
common case right after copier copy, before git add) is still fully checked.
A recursive-grep fallback (with explicit .venv/.terraform/.task/.worktrees/dist
excludes) 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

  • PASS on a real applied repo (sommerlawn/sommerlawn-infra) that previously
    false-failed. ✅
  • Still catches real leaks — regression-tested:
    • untracked file with [[ project_name ]] → caught (validates the --others path)
    • tracked file with {{ author_full_name }} → caught (--cached path)
    • the same leak but gitignored → correctly not flagged (respects .gitignore)
  • shellcheck --severity=error --exclude=SC3037 --exclude=SC2148 clean; shfmt -i 4 clean; bash 3.2 portable. ✅

Context

Surfaced applying harmon-init to sommerlawn-infra. Companion to
evanharmon1/harmon-init#84 (the same false-positive hit the template's
lint:markdown glob, fixed there).

🤖 Generated with Claude Code

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>
@evanharmon1 evanharmon1 merged commit 3416e67 into main Jun 23, 2026
4 of 8 checks passed
@evanharmon1 evanharmon1 deleted the fix/verify-applied-skip-gitignored branch June 23, 2026 19:28
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.

1 participant