nvim-lint icon indicating copy to clipboard operation
nvim-lint copied to clipboard

Help getting the plugin to work (mypy)

Open karb94 opened this issue 1 year ago • 3 comments

Hi, I've been trying for an hour to get the plugin to lint using mypy. I can see that a mypy process spawns in my process monitor but there is nothing showing up in Neovim.

My config:

require('lint').linters_by_ft.python = { 'mypy', }

Then in Neovim I run manually :lua require("lint").try_lint() and nothing shows up. If I run :lua = vim.diagnostic.get() I get an empty table.

if I run mypy in my terminal with the same default flags:

mypy --show-column-numbers --hide-error-codes --hide-error-context --no-color-output --no-error-summary --no-pretty myfile.py

I get mypy output with the errors in my file.

Are there any logs of the ouput somewhere I can check?

karb94 avatar Jan 27 '24 10:01 karb94

Are you on Windows? #480 affects mypy on Windows, and it would be fixed by #513.

replicaJunction avatar Feb 03 '24 15:02 replicaJunction

I'm on Linux (NixOS)

karb94 avatar Feb 04 '24 14:02 karb94

@karb94 Were you able to fix this? I am having the same problem (I am on windows tho)

Edit: It does not work on my linux system either

BSiddharth avatar Mar 09 '24 07:03 BSiddharth

I ran into a problem with the same symptoms, due to an outdated mypy in my poetry lockfile. Upgrading mypy from 0.971 to the recent 1.10.1 fixed the issue in my case.

The older version didn't support the --show-error-end parameter, which is used by nvim-lint in its mypy configuration. This parameter reports the error locations in a file.

verbosemode avatar Jul 15 '24 14:07 verbosemode

This appears to be working for me now. As @verbosemode mentioned, this was likely a mypy version issue.

karb94 avatar Aug 10 '24 13:08 karb94