Closed pwmarcz closed 1 year ago
I'm the author of this error handling code and I agree it needs an overhaul.
My thinking has shifted now, I think we should ignore the exit code entirely and instead look at whether stdout or stderr contain any messages. If something is written to stderr, it's almost always a crash of mypy.
In the case of syntax error as you mention, messages are written to stdout.
First time contributor checklist
Contributor checklist
master
branch (and not therelease
branch)Fixes #1234
syntaxDescription
As discussed in #103, this makes the plugin not consider exit code other than 0 or 1 to be an abnormal exit, as long as Mypy also reported some issues. Mypy currently returns 2 in case of a syntax error as well as some other errors (such as
break
outside loop). This change makes sure these issues are correctly reported in Pycharm, instead of treating them as abnormal exit.Type of Changes
Related Issue
Closes #103.