Closed gdiv closed 2 years ago
Hi, @gdiv. Thanks for taking a look at this, and I'm sorry it's taken so long to get back to you! I don't remember exactly what the issue was, but I seem to recall that I had to use this ordering in order to get modules specified in a mypy.ini
file to be recognized correctly (with the issue that, as you point out, files are only properly checked after saving). Would you be able to verify whether mypy.ini stanzas are applied correctly with your change? If so and I was just wrong before, I'd be happy to merge this.
Mypy has the following documentation for the --shadow-file parameter:
In the diff the variable
filepath
stores the path for the temporary file andoriginal_filepath
the path of the buffer being edited. We want the temporary file sorted infilepath
to be the SHADOW_FILE in order for mypy to read the contents of the SHADOW _FILE instead of SOURCE_FILE.This fixes the issue where mypy checks only take effect after saving the file.