nvim: make Python LSP also check docstrings

This commit is contained in:
dogeystamp 2023-04-12 12:40:57 -04:00
parent b93a5f4571
commit 09af3f70a1
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
2 changed files with 29 additions and 7 deletions

View File

@ -47,14 +47,33 @@ local on_attach = function(client, bufnr)
buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
end end
local servers = { 'pylsp', 'clangd' } -- settings per server (overrides defaults)
for _, lsp in ipairs(servers) do local servers = {
nvim_lsp[lsp].setup { pylsp = {
settings = {
pylsp = {
plugins = {
pydocstyle = {
enabled = true,
convention = "numpy",
addIgnore = {"D100", "D101", "D102", "D105"}
}
}
}
}
},
clangd = {}
}
for lsp, sv_settings in pairs(servers) do
-- defaults
settings = {
on_attach = on_attach, on_attach = on_attach,
flags = { flags = {
debounce_text_changes = 150, debounce_text_changes = 150,
} }
} }
for k, v in pairs(servers) do settings[k] = v end
nvim_lsp[lsp].setup(settings[lsp])
end end
-- fancy prompts -- fancy prompts

3
src/.config/pycodestyle Normal file
View File

@ -0,0 +1,3 @@
[pycodestyle]
ignore = E203
max-line-length = 88