From 6da1c474720a63e9bcd6d80ecdd8826896cb2912 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 4 Mar 2022 12:44:46 +0100 Subject: [PATCH] home: vim: add 'shellcheck' code actions --- home/vim/plugin/settings/null-ls.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/home/vim/plugin/settings/null-ls.vim b/home/vim/plugin/settings/null-ls.vim index e00fa62..f76c451 100644 --- a/home/vim/plugin/settings/null-ls.vim +++ b/home/vim/plugin/settings/null-ls.vim @@ -60,6 +60,12 @@ null_ls.register({ -- Shell (non-POSIX) null_ls.register({ + null_ls.builtins.code_actions.shellcheck.with({ + -- Restrict to bash and zsh + filetypes = { "bash", "zsh" }, + -- Only used if available + condition = utils.is_executable_condition("shellcheck"), + }), null_ls.builtins.diagnostics.shellcheck.with({ -- Show error code in message diagnostics_format = "[#{c}] #{m}", @@ -83,6 +89,12 @@ null_ls.register({ -- Shell (POSIX) null_ls.register({ + null_ls.builtins.code_actions.shellcheck.with({ + -- Restrict to POSIX sh + filetypes = { "sh" }, + -- Only used if available + condition = utils.is_executable_condition("shellcheck"), + }), null_ls.builtins.diagnostics.shellcheck.with({ -- Show error code in message diagnostics_format = "[#{c}] #{m}",