Skip to content

Add success msg for only notes output #12306

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

Merged
merged 2 commits into from
Mar 18, 2022
Merged

Conversation

97littleleaf11
Copy link
Collaborator

Closes #12302

The messages here could be neither error nor note, thus I modify the count_stats to also count note.

@github-actions

This comment has been minimized.

@97littleleaf11 97littleleaf11 requested a review from jhance March 9, 2022 05:52
mypy/main.py Outdated
@@ -114,13 +114,16 @@ def main(script_path: Optional[str],
code = 2 if blockers else 1
if options.error_summary:
if messages:
n_errors, n_files = util.count_stats(messages)
n_errors, n_notes, n_files = util.count_stats(messages)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the outer if remains necessary. If messages is empty, then this returns (0, 0, 0). So we can just always count the stats and then condition on them.

Also, is n_notes == len(messages) actually different from not n_errors? Is there a third type of message that is neither an error nor a note?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a test case [testErrorSummaryOnBadUsage], which generates 'mypy: cannot read file 'missing.py': No such file or directory'

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I still think the comment about not needing the outer if applies.

@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@97littleleaf11 97littleleaf11 requested a review from jhance March 11, 2022 10:44
@jhance jhance merged commit fd90550 into python:master Mar 18, 2022
@97littleleaf11 97littleleaf11 deleted the fix-12302 branch March 18, 2022 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Success message missing when reveal_type() used.
2 participants