feat(version-scanner): support globbing and subpath patterns in ignore file#17539
feat(version-scanner): support globbing and subpath patterns in ignore file#17539chalmerlowe wants to merge 15 commits into
Conversation
…g under _safe_read_file
…nd hybrid packages
There was a problem hiding this comment.
Code Review
This pull request introduces a new _should_ignore helper function in version_scanner.py to handle wildcard and path-based ignore patterns during repository scanning, along with corresponding unit tests. The review feedback highlights critical correctness and performance issues in the implementation of _should_ignore. Specifically, it identifies a performance overhead from redundant string operations on every file, a trailing slash bug where directory-only patterns fail to match, and a leading slash anchoring bug that incorrectly matches subpaths. The reviewer provides actionable suggestions to resolve these issues by preprocessing and caching patterns using functools.lru_cache, introducing an is_dir parameter to distinguish files from directories, and adding robust test cases to verify these edge cases.
04f3d2d to
69e81ab
Compare
…on-generated-packages
69e81ab to
111c152
Compare
…loat versions, and argument validation
111c152 to
055975c
Compare
This PR upgrades the ignore engine of the version scanner to support wildcard patterns (like *.jpg and *.egg-info) and relative directory subpaths (like packages/pkg_a/.nox) in .scannerignore.