From ad9a5072d35bfc6f63e99afe13833706224aaff6 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Fri, 10 Jul 2026 16:26:09 -0700 Subject: [PATCH] Handle shellcheck cleanly in vim --- config/nvim/lua/plugins/format.lua | 7 ++++++- packages/apt.global | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/nvim/lua/plugins/format.lua b/config/nvim/lua/plugins/format.lua index 4a9a888..44338cb 100644 --- a/config/nvim/lua/plugins/format.lua +++ b/config/nvim/lua/plugins/format.lua @@ -37,9 +37,14 @@ return { javascriptreact = { "eslint_d" }, typescriptreact = { "eslint_d" }, svelte = { "eslint_d" }, - sh = { "shellcheck" }, } + if vim.fn.executable("shellcheck") == 1 then + require("lint").linters_by_ft.sh = { "shellcheck" } + else + vim.notify("shellcheck not found: skipping shell linting", vim.log.levels.WARN) + end + vim.api.nvim_create_autocmd({ "BufWritePost", "BufReadPost", "InsertLeave" }, { callback = function() require("lint").try_lint() diff --git a/packages/apt.global b/packages/apt.global index d00f1e7..fd493cf 100644 --- a/packages/apt.global +++ b/packages/apt.global @@ -10,6 +10,7 @@ zsh npm tree-sitter-cli ripgrep +shellcheck # Useless stuff fortune-mod