From d919a0cf00ed97ff95aa6bc1792f6cea9b74679c Mon Sep 17 00:00:00 2001 From: "claude[bot]" Date: Tue, 21 Apr 2026 12:28:26 +0000 Subject: [PATCH] fix: log skipped invalid gitignore patterns to stderr Silent pass on re.error hid invalid .gitignore patterns from users, making it impossible to diagnose unexpected file-exclusion behavior. Now logs a warning to stderr so users can see which patterns were skipped and why. Co-Authored-By: Claude Code --- .../skills/understand-domain/extract-domain-context.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/understand-anything-plugin/skills/understand-domain/extract-domain-context.py b/understand-anything-plugin/skills/understand-domain/extract-domain-context.py index 99d82d9..061206a 100755 --- a/understand-anything-plugin/skills/understand-domain/extract-domain-context.py +++ b/understand-anything-plugin/skills/understand-domain/extract-domain-context.py @@ -133,8 +133,8 @@ def parse_gitignore(project_root: Path) -> list[re.Pattern[str]]: regex = regex.rstrip("/") + "(/|$)" try: patterns.append(re.compile(regex)) - except re.error: - pass + except re.error as e: + print(f"Warning: skipping invalid gitignore pattern '{line}': {e}", file=sys.stderr) return patterns