Open pag opened 3 years ago
pyflakes also cannot cope with line-based # noqa
instructions, which is why flake8 is preferrable (which uses pyflakes internally), but I have yet to manage to run flake8 successfully with pylsp. :(
@michaelaye have you tried these instructions from the README.
If you would like to use flake8, you will need to:
- Disable pycodestyle, mccabe, and pyflakes, by setting their corresponding enabled configurations, e.g. pylsp.plugins.pycodestyle.enabled, to false. This will prevent duplicate linting messages as flake8 includes these tools.
- Set pylsp.plugins.flake8.enabled to true.
- Change the pylsp.configurationSources setting (in the value passed in from your client) to ['flake8'] in order to use the flake8 configuration instead.
It has likely been updated since you posted here. What client are you using?
This works for me in neovim 0.10.0 with pylsp v1.11.0 installed using Mason and configured using mason-lspconfig:
-- ... --
settings = {
pylsp = {
configurationSources = { "flake8" },
plugins = {
-- ... --
pylint = { enabled = false },
pyflakes = { enabled = false },
mccabe = { enabled = false },
pycodestyle = { enabled = false },
flake8 = {
enabled = true,
maxLineLength = 120,
maxComplexity = 15,
},
-- ... --
},
},
},
-- ... --
This is the only way i found to have everything I need:
As far as I can tell there is no way to configure pyflakes to ignore certain warning (e.g.
'f-string is missing placeholders'
). Does that sound right? If so I'll happily submit a pull request to add some configurability toplugins/pyflakes_lint.py
, e.g. reading a file at~/config/pyflakes
.