diff options
author | Luc Sinet <[email protected]> | 2021-07-17 00:30:38 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-16 18:30:38 -0400 |
commit | 836286798e959fbaa43bd4502561cf85aea537c9 (patch) | |
tree | 821f5c459fb056c619aab9f34d802be8776a1cac /lua/lang/sh.lua | |
parent | fe48ed9ef9de8da8b9fbf7f82f8e0af1758581a4 (diff) |
[Feature] add linter support (#982)
Diffstat (limited to 'lua/lang/sh.lua')
-rw-r--r-- | lua/lang/sh.lua | 32 |
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() |