comparison dot_config/nvim/config.lua @ 321:aa0a095f8759

Set up python formatting and linting through efm
author zegervdv <zegervdv@me.com>
date Mon, 21 Dec 2020 09:39:45 +0100
parents b93f12d23fbd
children deb606f02fc4
comparison
equal deleted inserted replaced
320:4daaf43a2b28 321:aa0a095f8759
130 end 130 end
131 131
132 if (vim.fn.executable('efm-langserver') == 1) then 132 if (vim.fn.executable('efm-langserver') == 1) then
133 lsp.efm.setup{ 133 lsp.efm.setup{
134 on_attach = on_attach; 134 on_attach = on_attach;
135 init_options = {documentFormatting = true};
135 root_dir = lsputil.root_pattern('.git', '.hg'); 136 root_dir = lsputil.root_pattern('.git', '.hg');
137 settings = {
138 rootMarkers = {".git/", ".hg/"},
139 languages = {
140 python = {
141 {
142 formatCommand = "black -",
143 formatStdin = true
144 },
145 {
146 lintCommand = "flake8 --stdin-display-name ${INPUT} -",
147 lintStdin = true,
148 lintIgnoreExitCode = true,
149 lintFormats = {"%f:%l:%c: %m"}
150 }
151 }
152 }
153 };
136 } 154 }
137 end 155 end