fix(elixir): only enable credo when installed. Fixes #1546

This commit is contained in:
Folke Lemaitre 2023-10-06 09:18:04 +02:00
parent 3823f177e9
commit 8a1de2b90a
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -33,6 +33,9 @@ return {
"nvimtools/none-ls.nvim",
optional = true,
opts = function(_, opts)
if vim.fn.executable("credo") == 0 then
return
end
local nls = require("null-ls")
opts.sources = opts.sources or {}
vim.list_extend(opts.sources, {
@ -43,10 +46,13 @@ return {
{
"mfussenegger/nvim-lint",
optional = true,
opts = {
linters_by_ft = {
opts = function(_, opts)
if vim.fn.executable("credo") == 0 then
return
end
opts.linters_by_ft = {
elixir = { "credo" },
},
},
}
end,
},
}