small python linters,lsp rework
This commit is contained in:
parent
3d8cf2f058
commit
185f35bb42
2 changed files with 56 additions and 19 deletions
|
@ -1,22 +1,27 @@
|
||||||
require('lint').linters_by_ft = {
|
require('lint').linters_by_ft = {
|
||||||
python = { 'flake8', 'pylint', 'pycodestyle', 'pydocstyle' },
|
--python = {
|
||||||
|
--'flake8',
|
||||||
|
--'pylint',
|
||||||
|
--'pycodestyle',
|
||||||
|
--'pydocstyle'
|
||||||
|
--},
|
||||||
php = { 'phpcs' },
|
php = { 'phpcs' },
|
||||||
markdown = { 'markdownlint' }
|
markdown = { 'markdownlint' }
|
||||||
}
|
}
|
||||||
|
|
||||||
local pydocstyle = require('lint.linters.pydocstyle')
|
--local pydocstyle = require('lint.linters.pydocstyle')
|
||||||
pydocstyle.args = {
|
--pydocstyle.args = {
|
||||||
'--ignore=D100,D203,D213', -- disable missing module docstring info
|
--'--ignore=D100,D203,D213', -- disable missing module docstring info
|
||||||
-- disable one line before class docstring required
|
---- disable one line before class docstring required
|
||||||
-- disable multiline docstring summary
|
---- disable multiline docstring summary
|
||||||
-- should start at the second line
|
---- should start at the second line
|
||||||
}
|
--}
|
||||||
local pylint = require('lint.linters.pylint')
|
--local pylint = require('lint.linters.pylint')
|
||||||
pylint.args = {
|
--pylint.args = {
|
||||||
'-f',
|
--'-f',
|
||||||
'json',
|
--'json',
|
||||||
'--disable=C0114', -- disable missing module docstring info
|
--'--disable=C0114', -- disable missing module docstring info
|
||||||
}
|
--}
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
|
|
|
@ -41,12 +41,44 @@ require 'lspconfig'.pyright.setup {
|
||||||
}
|
}
|
||||||
require 'lspconfig'.pylsp.setup {
|
require 'lspconfig'.pylsp.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities
|
||||||
}
|
, settings = {
|
||||||
require 'lspconfig'.pyre.setup {
|
pylsp = {
|
||||||
on_attach = on_attach,
|
plugins = {
|
||||||
capabilities = capabilities,
|
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 {
|
require 'lspconfig'.bashls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
|
Loading…
Reference in a new issue