-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Mypy could be clearer that an invalid type comment or annotation prevents it from scanning the rest of the project #3850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
With the |
PS. Next time you have an update like this, please don't just rewrite the initial comment -- just add another. Re:
Did you not get that error with other invocations, or did you initially not think it worth mentioning? With the current state of your branch I see it when I run either of these:
With I agree with @ilevkivskyi that we should mark "blocker" errors more clearly in the output -- perhaps "error:" should be replaced with "FATAL:"? |
Yeah, I didn't find it worth mentioning. |
I'm working on it |
It looks like GitHub doesn't allow assigning issues to non-core members, but I hope no-one else will start working on this. |
@ilevkivskyi if someone else starts, I will contact with him/her |
I just added #9674 which will change the error summary when we encounter fatal / blocking errors. I'm going to go ahead and close, but let me know if you think this isn't enough. |
Uh oh!
There was an error while loading. Please reload this page.
TL;DR: some errors prevent
mypy
from further checking the project and this should be clearly stated in the log.I was trying to add
mypy
type-checks to a big Python project. The branch I reproduced this problem on is: https://github.com/marmistrz/golem/blob/mypy-quirksThere's a defective function here which is properly linted with
But now any of these:
doesn't yield that result (the variants
golem
and-p golem
yield other errors but not this,-m golem
yields no results)What's more interesting, if I run
the same error, in
golem/model.py
is detected! Even anxargs
invocation failed...What was the problem? The second error message!
The annotation was indeed incorrect:
The second error made
mypy
abort further checking. It should be stated more clearly that this error prevents further scanning (e.g. even with capitals). This is very important when introducing incremental linting (only banning new findings) and it really puzzled me for some time that my mistake was not detected.The text was updated successfully, but these errors were encountered: