Skip to content
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

[dmypy] special case stdout and stderr in show_stats too #15881

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

svalentin
Copy link
Collaborator

@svalentin svalentin commented Aug 15, 2023

When running dmypy, the communication between client and server is via JSON. The JSON contains the keys "out" and "err" for the actual result of "check" command, and "stdout" and "stderr" for the any other stdout and stderr text.
show_stats is shown when running with --verbose. It's meant to show other keys in the JSON response, like python version or time taken. It already had some special casing to only show 1 line of text for "out" and "err". Let's add "stdout" and "stderr" to the special casing as well. Also, let's show the remaining number of characters as well.

Finally, added a comment in code about stdout, stderr, out, err and how we shouldn't confuse them. (I did)

Some more cleanup is needed in this area of the codebase, but will be a separate PR.

show_stats outputs something like this:

err                     :
out                     : analytics/scripts/presto/report_query_lo ... 100 more characters
platform                :      linux
python_version          :        3_9
roundtrip_time          :     31.996
status                  :          2
stderr                  : \nLOG:  Mypy Version:           1.6.0+de ... 50186630 more characters
stdout                  :

When running dmypy, the communication between client and server is via
JSON. The JSON contains the keys "out" and "err" for the actual result
of "check" command, and "stdout" and "stderr" for the any other stdout
and stderr text.
show_stats is shown when running with --verbose. It's meant to show
other keys in the JSON response, like python version or time taken.
It already had some special casing to only show 1 line of text for "out"
and "err". Let's add "stdout" and "stderr" to the special casing as
well. Also, let's show the remaining number of characters as well.
@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@JukkaL JukkaL merged commit 76c16a4 into python:master Aug 16, 2023
17 checks passed
@svalentin svalentin deleted the dmypy-output branch August 19, 2023 17:48
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.

2 participants