Skip to content

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

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

ilevkivskyi merged 1 commit into
python:masterfrom
cjwatson:gitignore-stop-at-top-level

Conversation

@cjwatson

@cjwatson cjwatson commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

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

@ilevkivskyi ilevkivskyi left a comment

Copy link
Copy Markdown
Member

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
@cjwatson
cjwatson deleted the gitignore-stop-at-top-level branch February 10, 2026 15:11
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