KEMBAR78
Add an option to exclude everything in .gitignore by ilevkivskyi · Pull Request #18696 · python/mypy · GitHub
Skip to content

Conversation

ilevkivskyi
Copy link
Member

Fixes #12505

This is (somewhat surprisingly) one of the most upvoted issues, and looks like a simple thing to add. I essentially do what other tools do, but optimize for how we work with sources discovery (to avoid performance issues). I am making this opt-in for now, we can change this later if needed.

@github-actions

This comment has been minimized.

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

I think there are some edge cases this will not handle correctly, like nested gitignore where inner gitignore has a negated pattern. But this is pretty niche. I have a library that makes it easier to handle this stuff than pathspec (and is also faster), maybe I will open source

@ilevkivskyi
Copy link
Member Author

I think there are some edge cases this will not handle correctly, like nested gitignore where inner gitignore has a negated pattern.

This is very niche.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

django-stubs (https://github.com/typeddjango/django-stubs): 1.90x faster (46.9s -> 24.6s in a single noisy sample)

Tanjun (https://github.com/FasterSpeeding/Tanjun): 1.60x slower (77.8s -> 124.7s in a single noisy sample)

@ilevkivskyi ilevkivskyi merged commit a26d8d0 into python:master Feb 19, 2025
19 checks passed
@ilevkivskyi ilevkivskyi deleted the exclude-gitignore branch February 19, 2025 00:02
x612skm pushed a commit to x612skm/mypy-dev that referenced this pull request Feb 24, 2025
Fixes python#12505

This is (somewhat surprisingly) one of the most upvoted issues, and
looks like a simple thing to add. I essentially do what other tools do,
but optimize for how we work with sources discovery (to avoid
performance issues). I am making this opt-in for now, we can change this
later if needed.
@scorphus
Copy link

Assuming I'm not missing anything, when are we expected to get this released? Thanks!

@brianschubert
Copy link
Member

@scorphus I don’t think there’s a set timeline. For now you can watch the tracking issue for the next release for updates: #18739

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.

(🎁) A git/.gitignore exclude option

4 participants