Closed deto closed 5 years ago
Checkout if there is .vim/coc-settings.json
in the parent folders of your python file, or you can try if it works in different folder.
There was a .vim/coc-settings.json
file with this in it:
{
"python.jediEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true
}
I suppose this is how commands like python.setLinter store their settings?
However, after removing that file, I see the same behavior. I've also removed any other plugins from my init.vim just to make sure.
Is coc.nvim running linters on its own (independently of coc-python)? I don't really know the details of what is done by which (coc.nvim vs. coc-python), and I'm still digesting the configuration options.
Can't reproduce, maybe it comes from your other plugins, try it with minimal vimrc, or disable coc-python to see if you still have them.
Use python.setLinter
command to get current activated linters.
Thought I had fixed it, but it still persists - I realized I used 'pylintEnable' instead of 'pylintEnabled' in the configuration file.
However, after changing this, it's still happening. I'm using a fully minimal vimrc now.
If I run python.setLinter, it shows the list of available linters and at the top displays "current: none"
If I use workspace.showOutput and select languageserver.python I can confirm that it's coming from the language server.
However, disabling coc-python did not remove the linting. It appears that the python language server (I'm using the palantir one, not the MS one) will, by default, enable plugins. I was able to fix it by adding this to my coc-settings:
"languageserver.python.settings.pyls.plugins.pylint_lint.enabled": false
(Though not exactly, I'm sticking the JSON hierarchy inside the object key)
So it seems like the language server was setting linting independently of coc-python? Does coc-python manage linting separately, or is it supposed to just manage settings for the language server in a better way?
@deto No, checkout :CocList services
, you have configured language server instead. You should remove configured server for python when using coc-pythong.
Got it - the coc.nvim documentation does not make this clear and seems to imply that you need both. I'll file an issue with them to clarify. Thank you!
interestingly, i have to follow this issue https://github.com/palantir/python-language-server/issues/433 and configure setup.cfg to quiet pycodestyle warnings from language server. and there seems no configuration works to disable the linting from coc-python.
my environment is neovim/coc.nvim/coc-python
I'm trying to disable pyLint and only have flake8. I've tried these things:
"python.linting.pylintEnable": false
in my configHowever, still when I save, pylint is being run on the file. Is there a separate config for on-save linters?
It's also possible that my coc-settings.json just isn't set up correctly. Right now the file looks like this (with the languageserver settings in the outermost level and the coc-python settings outside the languageserver settings):