-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Problem: get_tree() hardcodes an ignore list (.git, pycache, node_modules, .venv) and provides no way for callers to exclude additional project-specific directories
Why it matters: Large directories (e.g., node_modules, build, dist) make tree output verbose and slow, especially in CI or file-manager UIs. Users need project-specific control without forking the function.
Proposed solution: Add an optional ignore_patterns parameter (list[str] or None). If provided, use it; otherwise, fall back to the current default set. Support glob-style patterns via fnmatch so users can pass exact names or wildcards. Update the docstring and examples accordingly.
Notes: Maintain backward compatibility by keeping the current default when ignore_patterns=None. The module’s README already suggests customizing ignore_list for project-specific skips. This change formalizes that capability without breaking existing code.