Closed metropetrol closed 10 months ago
I just realized that this change breaks some of the tests, whoops
Need to fix that before review
Alright I fixed the test and added one that confirms the fix.
I discovered more info on what the bug actually is. It appears to be isolated to projects that explicitly configure the mypy pretty
option to True
. The plugin will read that configuration and use that instead of the default no-pretty
formatting which breaks diagnostics for some cases like long file paths.
(I erroneously stated that mypy uses pretty formatting by default in the original description, I fixed that)
There doesn't seem to be any harm in adding this since the default is --no-pretty
anyways. I think it is worth adding to make the plugin behave as consistently as possible. Hopefully this will save someone from discovering the same issue in the future. My project runs mypy and outputs the errors on build and pretty formatting is nice for that. I ideally would like to keep the pretty setting there if possible.
I discovered a way to fix this for my local setup by using the plugin's overrides
configuration in my editor config:
overrides = [true, "--no-pretty"]
This is a fairly niche configuration issue so I'm open to this being closed. It may be useful for others though.
What is this change
--no-pretty
argument for all runs to ensure that the output is parsable.Why is this change needed
^ see latest comment for more accurate descriptionmypy
will use its "pretty" formatting by default and for very long file paths the output is formatted differently. This plugin's parser does not work for such output. Using the--no-pretty
works for the parser and appears to be an easier change than updating the parser to support this extra output format.Logs reproducing the issue and validating the fix
I pulled these logs from the plugin, they show the issue and validate that my change fixes the issue