mfussenegger / nvim-lint

An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support.
GNU General Public License v3.0
1.77k stars 191 forks source link

Python linter problem #552

Closed BSiddharth closed 3 months ago

BSiddharth commented 3 months ago

1) checking with :lua = vim.diagnostic.get() I can see that ruff is giving diagnostics however := require("lint").get_running() prints {}

image

2) mypy does not work, no output corresponding to mypy is shown in :lua = vim.diagnostic.get()

DownerCase commented 3 months ago

Hi! I've been having some trouble too, not using mypy though.

For point 1, nvim-lint only reports currently running linters (i.e: the linters that nvim-lint has started but whose process hasn't finished). Ruff is very fast so unless you query get_running after Ruff is started but before it finishes the list will be empty.

Are you able to see if mypy is giving output? You could, for example, try dumping output from here: https://github.com/mfussenegger/nvim-lint/blob/e824adb9bc01647f71e55457353a68f0f37f9931/lua/lint/parser.lua#L141

That's what I did with cmakelint in #551

BSiddharth commented 3 months ago

@DownerCase Hi, for point 1 I thought that might be the reason but was not sure. And the mypy thing has been sorted too. Actually there was no problem in the code that I was testing it on and pyright was giving some warnings but they were more like be aware that this variable might be None at this point however mypy was not bothered by that. I then again tried mypy on some more hard errors and it is working there. Now I need to just close these diagnostics/hints from pyright