mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-27 19:28:59 +02:00
fix(elixir): only enable credo when installed. Fixes #1546
This commit is contained in:
parent
3823f177e9
commit
8a1de2b90a
1 changed files with 10 additions and 4 deletions
|
@ -33,6 +33,9 @@ return {
|
||||||
"nvimtools/none-ls.nvim",
|
"nvimtools/none-ls.nvim",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = function(_, opts)
|
opts = function(_, opts)
|
||||||
|
if vim.fn.executable("credo") == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
local nls = require("null-ls")
|
local nls = require("null-ls")
|
||||||
opts.sources = opts.sources or {}
|
opts.sources = opts.sources or {}
|
||||||
vim.list_extend(opts.sources, {
|
vim.list_extend(opts.sources, {
|
||||||
|
@ -43,10 +46,13 @@ return {
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-lint",
|
"mfussenegger/nvim-lint",
|
||||||
optional = true,
|
optional = true,
|
||||||
opts = {
|
opts = function(_, opts)
|
||||||
linters_by_ft = {
|
if vim.fn.executable("credo") == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
opts.linters_by_ft = {
|
||||||
elixir = { "credo" },
|
elixir = { "credo" },
|
||||||
},
|
}
|
||||||
},
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue