Chris 4 роки тому
батько
коміт
cb008a31eb
1 змінених файлів з 10 додано та 25 видалено
  1. 10 25
      lua/lsp/efm-general-ls.lua

+ 10 - 25
lua/lsp/efm-general-ls.lua

@@ -15,20 +15,16 @@ local isort = {formatCommand = "isort --quiet -", formatStdin = true}
 local yapf = {formatCommand = "yapf --quiet", formatStdin = true}
 local black = {formatCommand = "black --quiet --stdin-filename ", formatStdin = true}
 
-if O.python.linter == 'flake8' then
-	table.insert(python_arguments, flake8)
-end
+if O.python.linter == 'flake8' then table.insert(python_arguments, flake8) end
+
+if O.python.isort then table.insert(python_arguments, isort) end
 
 if O.python.formatter == 'yapf' then
-	table.insert(python_arguments, yapf)
+    table.insert(python_arguments, yapf)
 elseif O.python.formatter == 'black' then
     table.insert(python_arguments, black)
 end
 
-if O.python.isort then
-	table.insert(python_arguments, isort)
-end
-
 -- lua
 local lua_arguments = {}
 local luaFormat = {
@@ -36,9 +32,7 @@ local luaFormat = {
     formatStdin = true
 }
 
-if O.lua.formatter == 'lua-format' then
-	table.insert(lua_arguments, luaFormat)
-end
+if O.lua.formatter == 'lua-format' then table.insert(lua_arguments, luaFormat) end
 
 -- sh
 local sh_arguments = {}
@@ -50,13 +44,9 @@ local shellcheck = {
     lintFormats = {'%f:%l:%c: %trror: %m', '%f:%l:%c: %tarning: %m', '%f:%l:%c: %tote: %m'}
 }
 
-if O.sh.formatter == 'shfmt' then
-	table.insert(sh_arguments, shfmt)
-end
+if O.sh.formatter == 'shfmt' then table.insert(sh_arguments, shfmt) end
 
-if O.sh.linter == 'shellcheck' then
-	table.insert(sh_arguments, shellcheck)
-end
+if O.sh.linter == 'shellcheck' then table.insert(sh_arguments, shellcheck) end
 
 -- tsserver/web javascript react, vue, json, html, css, yaml
 local prettier = {formatCommand = "prettier --stdin-filepath ${INPUT}", formatStdin = true}
@@ -74,14 +64,9 @@ local eslint = {
 
 local tsserver_args = {}
 
-if O.tsserver.formatter == 'prettier' then
-	table.insert(tsserver_args, prettier)
-end
-
-if O.tsserver.linter == 'eslint' then
-	table.insert(tsserver_args, eslint)
-end
+if O.tsserver.formatter == 'prettier' then table.insert(tsserver_args, prettier) end
 
+if O.tsserver.linter == 'eslint' then table.insert(tsserver_args, eslint) end
 
 -- local markdownlint = {
 --     -- TODO default to global lintrc
@@ -103,7 +88,7 @@ require"lspconfig".efm.setup {
         languages = {
             python = python_arguments,
             lua = lua_arguments,
-			sh = sh_arguments,
+            sh = sh_arguments,
             javascript = tsserver_args,
             javascriptreact = tsserver_args,
             html = {prettier},