null-ls: Use builtin versions of alex and ansiblelint if possible

Fallback support to nvim <0.6.0 still present
This commit is contained in:
ViViDboarder 2022-10-14 13:59:53 -07:00
parent 6f02ac53db
commit a22d1b9244

View File

@ -58,9 +58,6 @@ function M.configure(options)
diagnostic.severity = vim.diagnostic.severity.WARN diagnostic.severity = vim.diagnostic.severity.WARN
end, end,
}), }),
-- null_ls.builtins.diagnostics.alex
-- Ansible
-- null_ls.builtins.diagnostics.ansiblelint.with({filetypes={"yaml.ansible"}}),
-- Shell -- Shell
null_ls.builtins.diagnostics.shellcheck, null_ls.builtins.diagnostics.shellcheck,
-- Lua -- Lua
@ -70,13 +67,22 @@ function M.configure(options)
null_ls.builtins.diagnostics.hadolint, null_ls.builtins.diagnostics.hadolint,
} }
sources = disable_formatter_filetypes_for_existing_servers(sources, { "python" }) if vim.fn.has("nvim-0.6.0") then
vim.list_extend(sources, {
-- Text
null_ls.builtins.diagnostics.alex,
-- Ansible
null_ls.builtins.diagnostics.ansiblelint.with({ filetypes = { "yaml.ansible" } }),
})
else
-- Sources I use added or modified after 0.5.0 compatability was broken
vim.list_extend(sources, {
require("plugins.null-ls.linters").alex,
require("plugins.null-ls.linters").ansiblelint,
})
end
-- Add custom or modified sources sources = disable_formatter_filetypes_for_existing_servers(sources, { "python" })
vim.list_extend(sources, {
require("plugins.null-ls.linters").alex,
require("plugins.null-ls.linters").ansiblelint,
})
-- Setup or configure null_ls -- Setup or configure null_ls
if null_ls["setup"] ~= nil then if null_ls["setup"] ~= nil then