-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Document exit codes for mypy and dmypy #6003
Comments
Hi. Should I raise a separate issue for a non-conformity with the above guidelines?
I believe that should be a |
Thanks -- in general that would be recommended, but in this case it's so
simple that I'll just prepare a fix.
|
This is in line with the recommendation from python#6003. (It is called if there's something wrong with a filename.)
This is in line with the recommendation from #6003. (It is called if there's something wrong with a filename.)
Hi, I noticed that adding a Mypy If Mypy exit codes ever get documented as discussed in this issue, could we ensure that the documentation also addresses the expected impact of |
That's bad. Bugs in mypy plugins can also make it crash with status 1, e.g. typeddjango/django-stubs#760 crashes with 1. It's the default exit code when Python exits with an unhandled exception, so it's not a good choice for applications to distinguish between "there were type errors" and "mypy crashed" I was relying on the exit code in the PyCharm plugin, but since it's unreliable, seems like I need to implement some more complicated heuristic. |
I'm seeing the same -- it would be really nice to have an easier way to make the distinction between a crash and errors. |
I totally agree: a list of type errors are not errors in mypy, but in the code being checked. In fact, having that output is the expected behavior. So returning with anything other than 0 should indicate that mypy was not able to perform its goal, or at least not completely. |
It is certainly useful to be able to make the distinction between "finished with no errors", and "finished with errors" for a linter. It makes scripting and CI integration easier for catching regressions. For my purposes, I would also like to see a distinction between "finished with errors" and "crashed without finishing". |
But isn't that distinction is already made by having an output? As listing type errors is the only goal here, empty list means no errors. I think this is the easiest way to use it as an input of some other tool, e.g. in CI integration, and particularly in a shell script. |
See #5982. The rough idea is to exit with:
The text was updated successfully, but these errors were encountered: