Return 0 if there are only notes and no errors#13879
Return 0 if there are only notes and no errors#13879ilevkivskyi merged 2 commits intopython:masterfrom
Conversation
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
hauntsaninja
left a comment
There was a problem hiding this comment.
Thanks, looks like this also closes #10013
| code = 0 | ||
| if messages: | ||
| n_errors, n_notes, n_files = util.count_stats(messages) | ||
| if messages and n_notes < len(messages): |
There was a problem hiding this comment.
nit: from the impl, it looks like it's not super guaranteed that n_errors + n_notes == len(messages), maybe clearer to phrase as if messages and n_errors?
There was a problem hiding this comment.
FWIW, this is intentional. This case is complementary to the check for format_success() below. So that if something weird happens we both:
- Do not show
Successmessage - Return non 0 code
|
What about notes from |
|
We have at least one feature request for reveal_type to result in exit code 0: #10013 |
|
Yes, I agree with @hauntsaninja, it is what people probably expecting (also I would propose to deprecate |
|
I will just go ahead and merge this. It will be easy to undo if someone will complain. |
Fixes #10013
See #13851 (comment) for motivation, also this sounds generally reasonable.