summaryrefslogtreecommitdiff
path: root/lua/lang/sh.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/lang/sh.lua')
-rw-r--r--lua/lang/sh.lua32
1 files changed, 3 insertions, 29 deletions
diff --git a/lua/lang/sh.lua b/lua/lang/sh.lua
index f2a7fe78..e7c5ef16 100644
--- a/lua/lang/sh.lua
+++ b/lua/lang/sh.lua
@@ -15,6 +15,7 @@ M.config = function()
args = { "-w" },
stdin = false,
},
+ linters = { "shellcheck" },
}
end
@@ -37,36 +38,9 @@ M.format = function()
end
M.lint = function()
- -- sh
- local sh_arguments = {}
-
- local shfmt = { formatCommand = "shfmt -ci -s -bn", formatStdin = true }
-
- local shellcheck = {
- LintCommand = "shellcheck -f gcc -x",
- lintFormats = { "%f:%l:%c: %trror: %m", "%f:%l:%c: %tarning: %m", "%f:%l:%c: %tote: %m" },
+ require("lint").linters_by_ft = {
+ sh = O.lang.sh.linters,
}
-
- if O.lang.sh.linter == "shellcheck" then
- table.insert(sh_arguments, shellcheck)
- end
-
- if not require("lv-utils").check_lsp_client_active "efm" then
- require("lspconfig").efm.setup {
- -- init_options = {initializationOptions},
- cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" },
- on_attach = require("lsp").common_on_attach,
- init_options = { documentFormatting = true, codeAction = false },
- root_dir = require("lspconfig").util.root_pattern ".git/",
- filetypes = { "sh" },
- settings = {
- rootMarkers = { ".git/" },
- languages = {
- sh = sh_arguments,
- },
- },
- }
- end
end
M.lsp = function()