From 40b6cd1086397ba377a7d012818e67673e55000f Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Tue, 16 Apr 2024 11:18:08 -0400 Subject: [PATCH] Configure shellcheck to use -x via lsp --- nvim/lua/conf/lspconfig/init.lua | 14 +++++++++++++- nvim/lua/conf/nvim-lint/init.lua | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/nvim/lua/conf/lspconfig/init.lua b/nvim/lua/conf/lspconfig/init.lua index 9a9e7ecc..6df3e4bf 100644 --- a/nvim/lua/conf/lspconfig/init.lua +++ b/nvim/lua/conf/lspconfig/init.lua @@ -8,7 +8,19 @@ vim.opt.signcolumn = 'yes' local lspconfig = require 'lspconfig' lspconfig.ansiblels.setup {} -lspconfig.bashls.setup { filetypes = { "sh" } } +lspconfig.bashls.setup { + filetypes = { "sh" }, + settings = { + diagnostics = { + enable = true, + shellcheck = { + enable = true, + executable = "shellcheck", + extraArgs = { "-x" } + } + } + } +} lspconfig.docker_compose_language_service.setup {} lspconfig.eslint.setup({ on_attach = function(client, bufnr) diff --git a/nvim/lua/conf/nvim-lint/init.lua b/nvim/lua/conf/nvim-lint/init.lua index 5b24c806..304c441a 100644 --- a/nvim/lua/conf/nvim-lint/init.lua +++ b/nvim/lua/conf/nvim-lint/init.lua @@ -12,7 +12,7 @@ l.linters_by_ft = { lua = { 'selene' }, markdown = { 'markdownlint' }, -- perl = { 'perlimports' }, - sh = { 'shellcheck' }, + -- sh = { 'shellcheck' }, sql = { 'sqlfluff' }, typescript = { 'eslint'}, vim = { 'vint' },