-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Return 0 if there are only notes and no errors #13879
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
Conversation
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks like this also closes #10013
@@ -110,10 +110,10 @@ def main( | |||
print_memory_profile() | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Success
message - 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.