chore: limit pre-push mypy to .py/.pyi files - #120760
Open
armenzg wants to merge 1 commit into
Open
Conversation
Align file selection with CI discovery so extensionless bin/ scripts are not passed to mypy. Co-authored-by: Cursor <cursoragent@cursor.com>
armenzg
marked this pull request as ready for review
July 28, 2026 17:54
joshuarli
requested changes
Jul 28, 2026
joshuarli
left a comment
Member
There was a problem hiding this comment.
shouldn't we just be ignoring bin/ instead?
Member
Author
That would also work. What would you prefer? |
Member
ignoring bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This happened to me because the pre-commit push hook gets triggered for
bin/scripts while the CI does not get triggered by this, thus, when someone touchesbin/files and I merge master I get all their untyped changes.Summary
files: \.pyi?$to the pre-push mypy hook so only extension-bearing Python files are typechecked..py/.pyidiscovery and avoids__main__collisions from extensionlessbin/scripts.Test plan
SENTRY_MYPY_PRE_PUSH=1 .venv/bin/prek run mypy --files bin/mock-event --stage pre-pushskips the extensionless scriptSENTRY_MYPY_PRE_PUSH=1 .venv/bin/prek run mypy --files <some>.py --stage pre-pushstill runs mypybin/scripts no longer fails mypy solely due to those pathsMade with Cursor