Skip to content

fix(modulefinder): use subpath instead of relative_path in fscache.isdir check in matches_gitignore - #21781

Open
amir-rezaei wants to merge 1 commit into
python:masterfrom
amir-rezaei:fix/matches-gitignore-nested-directory-isdir-check
Open

fix(modulefinder): use subpath instead of relative_path in fscache.isdir check in matches_gitignore#21781
amir-rezaei wants to merge 1 commit into
python:masterfrom
amir-rezaei:fix/matches-gitignore-nested-directory-isdir-check

Conversation

@amir-rezaei

Copy link
Copy Markdown

Description

This PR resolves issue #21760 by passing subpath to fscache.isdir() in matches_gitignore() in mypy/modulefinder.py.

Details

  • Fixes directory-only pattern matching (e.g. build/, sub/) when using nested .gitignore files with --exclude-gitignore.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

2 participants