Skip linters that are not installed on the system
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4ce5fcb9c7
commit
3fa066dbc0
|
|
@ -56,7 +56,11 @@ return {
|
||||||
-- Only run the linter in buffers that you can modify in order to
|
-- Only run the linter in buffers that you can modify in order to
|
||||||
-- avoid superfluous noise, notably within the handy LSP pop-ups that
|
-- avoid superfluous noise, notably within the handy LSP pop-ups that
|
||||||
-- describe the hovered symbol using Markdown.
|
-- 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,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue