mirror of
https://github.com/Egonex-AI/Understand-Anything.git
synced 2026-06-22 10:58:03 +08:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user