nvim: make Python LSP also check docstrings
This commit is contained in:
parent
b93a5f4571
commit
09af3f70a1
@ -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 = {
|
||||||
on_attach = on_attach,
|
settings = {
|
||||||
flags = {
|
pylsp = {
|
||||||
debounce_text_changes = 150,
|
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,
|
||||||
|
flags = {
|
||||||
|
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
3
src/.config/pycodestyle
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[pycodestyle]
|
||||||
|
ignore = E203
|
||||||
|
max-line-length = 88
|
Loading…
Reference in New Issue
Block a user