Skip linters that are not installed on the system

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
probalazs 2026-04-20 14:36:20 +02:00
parent 4ce5fcb9c7
commit 3fa066dbc0
1 changed files with 5 additions and 1 deletions

View File

@ -56,7 +56,11 @@ return {
-- Only run the linter in buffers that you can modify in order to
-- avoid superfluous noise, notably within the handy LSP pop-ups that
-- describe the hovered symbol using Markdown.
if vim.bo.modifiable then lint.try_lint() end
if vim.bo.modifiable then
local linters = lint.linters_by_ft[vim.bo.filetype] or {}
local available = vim.tbl_filter(function(l) return vim.fn.executable(lint.linters[l] and lint.linters[l].cmd or l) == 1 end, linters)
if #available > 0 then lint.try_lint(available) end
end
end,
})
end,