Skip to content

feat(version-scanner): support globbing and subpath patterns in ignore file#17539

Open
chalmerlowe wants to merge 15 commits into
mainfrom
feat/version-scanner-pr2
Open

feat(version-scanner): support globbing and subpath patterns in ignore file#17539
chalmerlowe wants to merge 15 commits into
mainfrom
feat/version-scanner-pr2

Conversation

@chalmerlowe

Copy link
Copy Markdown
Contributor

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread scripts/version_scanner/version_scanner.py Outdated
Comment thread scripts/version_scanner/version_scanner.py
Comment thread scripts/version_scanner/version_scanner.py
Comment thread scripts/version_scanner/tests/unit/test_version_scanner.py Outdated
@chalmerlowe chalmerlowe force-pushed the feat/version-scanner-pr2 branch from 04f3d2d to 69e81ab Compare June 23, 2026 15:21
@chalmerlowe chalmerlowe force-pushed the feat/version-scanner-pr2 branch from 69e81ab to 111c152 Compare June 23, 2026 15:31
@chalmerlowe chalmerlowe force-pushed the feat/version-scanner-pr2 branch from 111c152 to 055975c Compare June 23, 2026 15:57
Base automatically changed from feat/version-scanner-pr1 to main June 23, 2026 16:23
@chalmerlowe chalmerlowe marked this pull request as ready for review June 24, 2026 18:58
@chalmerlowe chalmerlowe requested a review from a team as a code owner June 24, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant