File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353
5454# Public-repo hygiene content check — flag dangerous flags / unsafe shortcuts
5555# (Markdown docs included — these strings should never appear in published docs)
56- HYGIENE_CONTENT_FILES=$( git diff --cached --name-only --diff-filter=ACM | grep -v -E ' (\.gitleaks\.toml$|\.husky/|\.github/workflows/|docs/exec-plans/)' || true)
56+ # Allowlist must mirror scripts/validate/public_repo_hygiene.py CONTENT_RULES
57+ # allowlist_paths: files that legitimately describe the rule by literal name.
58+ HYGIENE_CONTENT_FILES=$( git diff --cached --name-only --diff-filter=ACM | grep -v -E ' (\.gitleaks\.toml$|\.husky/|\.github/workflows/|docs/exec-plans/|^tests/.*\.(py|yaml|yml)$|^scripts/validate/public_repo_hygiene\.py$|^docs/internal-docs\.md$|^docs/public-repo-policy\.md$|^docs/security/hygiene-verify\.md$)' || true)
5759if [ -n " $HYGIENE_CONTENT_FILES " ]; then
5860 HYGIENE_MATCHES=$( echo " $HYGIENE_CONTENT_FILES " | while IFS= read -r f; do grep -nEH ' dangerously-skip-permissions' " $f " 2> /dev/null; done || true)
5961 if [ -n " $HYGIENE_MATCHES " ]; then
Original file line number Diff line number Diff line change @@ -82,6 +82,10 @@ class Rule:
8282 re .compile (r"^\.husky/" ),
8383 re .compile (r"^\.github/workflows/" ),
8484 re .compile (r"^scripts/validate/public_repo_hygiene\.py$" ),
85+ # Hygiene docs that legitimately describe the rule by literal name.
86+ re .compile (r"^docs/internal-docs\.md$" ),
87+ re .compile (r"^docs/public-repo-policy\.md$" ),
88+ re .compile (r"^docs/security/hygiene-verify\.md$" ),
8589 ),
8690 ),
8791)
You can’t perform that action at this time.
0 commit comments