Skip to content

Stop looking for .gitignore at top level of working tree#20775

Merged
ilevkivskyi merged 1 commit intopython:masterfrom
cjwatson:gitignore-stop-at-top-level
Feb 9, 2026
Merged

Stop looking for .gitignore at top level of working tree#20775
ilevkivskyi merged 1 commit intopython:masterfrom
cjwatson:gitignore-stop-at-top-level

Conversation

@cjwatson
Copy link
Contributor

@cjwatson cjwatson commented Feb 9, 2026

I have a checkout where I'm using the new exclude_gitignore facility introduced in #18696, and where a parent directory has a .gitignore file that happens to match the full path of the checkout. I just spent quite some time being very confused about why mypy reported success despite the code having obvious typing errors. Unlike git itself, mypy didn't stop looking for .gitignore files at the top level of the working tree; now it does.

I have a checkout where I'm using the new `exclude_gitignore` facility
introduced in python#18696, and where a parent directory has a `.gitignore`
file that happens to match the full path of the checkout.  I just spent
quite some time being very confused about why mypy reported success
despite the code having obvious typing errors.  Unlike git itself, mypy
didn't stop looking for `.gitignore` files at the top level of the
working tree; now it does.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

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

Copy link
Member

@ilevkivskyi ilevkivskyi left a comment

Choose a reason for hiding this comment

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

OK, if this is how this behaves, we should match that.

@ilevkivskyi ilevkivskyi merged commit 8a91c09 into python:master Feb 9, 2026
23 checks passed
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