Open dmitrig opened 1 year ago
This kind of seems like a bug in mypy. I'm not all that enthusiastic about stripping out lints based on which directly match the original buffer. Perhaps point this out to the mypy devs as a potential bug.
Not sure I agree -- mypy is reporting the location of the error accurately, and it's relevant to why checking baz.py
may not work as expected.
If I understand the docs correctly, flymake explicitly supports backends that work this way, it just requires passing through the source file of the diagnostic.
@dmitrig
You raise a good point, and thanks for the reference to the docs. I wasn't aware of foreign diagnostics but the use case and support makes sense. I'd be happy to accept a PR to amend the existing checker generation function to support foreign diagnostics as well.
Some tools can report diagnostics from files other than the one currently being checked. These don't appear to be filtered out. Using
flymake-collection-mypy
on on the following package, for example:bar.py:
baz.py:
I get a diagnostic on baz.py:1:8 due to the type error in bar.py.