small python linters,lsp rework

This commit is contained in:
Szwendacz99 2022-11-16 15:28:23 +01:00
parent 3d8cf2f058
commit 185f35bb42
2 changed files with 56 additions and 19 deletions

View file

@ -1,22 +1,27 @@
require('lint').linters_by_ft = {
python = { 'flake8', 'pylint', 'pycodestyle', 'pydocstyle' },
--python = {
--'flake8',
--'pylint',
--'pycodestyle',
--'pydocstyle'
--},
php = { 'phpcs' },
markdown = { 'markdownlint' }
}
local pydocstyle = require('lint.linters.pydocstyle')
pydocstyle.args = {
'--ignore=D100,D203,D213', -- disable missing module docstring info
-- disable one line before class docstring required
-- disable multiline docstring summary
-- should start at the second line
}
local pylint = require('lint.linters.pylint')
pylint.args = {
'-f',
'json',
'--disable=C0114', -- disable missing module docstring info
}
--local pydocstyle = require('lint.linters.pydocstyle')
--pydocstyle.args = {
--'--ignore=D100,D203,D213', -- disable missing module docstring info
---- disable one line before class docstring required
---- disable multiline docstring summary
---- should start at the second line
--}
--local pylint = require('lint.linters.pylint')
--pylint.args = {
--'-f',
--'json',
--'--disable=C0114', -- disable missing module docstring info
--}
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()

View file

@ -41,12 +41,44 @@ require 'lspconfig'.pyright.setup {
}
require 'lspconfig'.pylsp.setup {
on_attach = on_attach,
capabilities = capabilities,
}
require 'lspconfig'.pyre.setup {
on_attach = on_attach,
capabilities = capabilities,
capabilities = capabilities
, settings = {
pylsp = {
plugins = {
flake8 = {
enabled = 1
},
pylint = {
enabled = true,
args = {
'--disable=C0114' -- disable missing module docstring info
}
},
yapf = {
enabled = true
},
autopep8 = {
enabled = false
},
pyflakes = {enabled = true},
pyodestyle = {enabled = true},
pydocstyle = {
enabled = false,
ignore = {
'D100', -- disable missing module docstring info
'D203', -- disable one line before class docstring required
'D213' -- disable multiline docstring summary
-- should start at the second line
}
},
}
}
}
}
--require 'lspconfig'.pyre.setup {
--on_attach = on_attach,
--capabilities = capabilities,
--}
require 'lspconfig'.bashls.setup {
on_attach = on_attach,
capabilities = capabilities,