From bf2bfe614cb6d8a5a7ecd9e1998d587560ec44f7 Mon Sep 17 00:00:00 2001 From: mayurrawte Date: Mon, 19 Oct 2026 17:01:30 +0530 Subject: [PATCH] fix: skip URL templates, URL paths and {placeholders} in the CLAUDE.md path check --- scripts/org_gate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/org_gate.py b/scripts/org_gate.py index 9e959a3..74b0a83 100644 --- a/scripts/org_gate.py +++ b/scripts/org_gate.py @@ -63,8 +63,8 @@ def main(): tracked = set(git("ls-files").splitlines()) paths = tracked | {"/".join(path.split("/")[:i]) + "/" for path in tracked for i in range(1, path.count("/") + 1)} for token in sorted(set(re.findall(r"`([^`\s]+)`", open("CLAUDE.md").read()))): - # Branch prefixes (feature/), placeholders (, YYYY), globs, path aliases (@/) and sibling repos (../) are not repo paths. - if re.search(r"[<*]|YYYY|^@|^\.\./", token) or re.fullmatch(r"[\w-]+/", token) or not ("/" in token or re.search(r"\.(py|ts|go|ya?ml|md|json|sh)$", token)): + # Branch prefixes (feature/), placeholders (, {lang}, YYYY), templates (${...}), URL paths (/api/), globs, path aliases (@/) and sibling repos (../) are not repo paths. + if re.search(r"[<*${]|YYYY|^@|^/|^\.\./", token) or re.fullmatch(r"[\w-]+/", token) or not ("/" in token or re.search(r"\.(py|ts|go|ya?ml|md|json|sh)$", token)): continue if not any(path == token or path.endswith("/" + token) for path in paths): problems.append(f"CLAUDE.md names {token}, which does not exist in the repo")