coc-python icon indicating copy to clipboard operation
coc-python copied to clipboard

Mypy errors in unexpected buffer

Open TatchNicolas opened this issue 4 years ago • 1 comments

When a python file A(main.py in the screenshot) has no mypy error but file B(foo_module.py) does, the error in the latter is shown in the buffer of file A.

screenshot

I am not sure this is an intended behaviour, but I think showing them in import statement line makes more sense if users want mypy errors of other files to be shown.

Environment

macOS 10.15.6 neoVim v0.4.3 coc.nvim version 0.0.78-56999634f4 coc-python 1.2.12

Steps to reproduce

I included coc-settings.json and poetry config files to setup the minimum environment to reproduce this behaviour.

https://github.com/TatchNicolas/coc-mypy-wrong-buffer

  1. git clone https://github.com/TatchNicolas/coc-mypy-wrong-buffer.git && cd coc-mypy-wrong-buffer

  2. poetry install

  3. Open main.py which imports bar_module.py which imports foo_module.py which has a type hint error at line 4

  4. You'll see the type hint error in main.py on which line 4 is actually an empty line.

TatchNicolas avatar Jul 26 '20 00:07 TatchNicolas

If you just want to silence error messages in other files, adding --follow-imports=skip to python.linting.mypyArgs works.

TatchNicolas avatar Jul 26 '20 01:07 TatchNicolas