feat!: make conform.nvim and nvim-lint the default formatters/linters

This commit is contained in:
Folke Lemaitre
2023-10-10 22:12:33 +02:00
parent 70f91956e7
commit 14c091b1fc
13 changed files with 148 additions and 64 deletions

View File

@ -124,7 +124,26 @@ function M.format(opts)
end
end
function M.health()
local Config = require("lazy.core.config")
local has_plugin = Config.spec.plugins["none-ls.nvim"]
local has_extra = vim.tbl_contains(Config.spec.modules, "lazyvim.plugins.extras.lsp.none-ls")
if has_plugin and not has_extra then
Util.warn({
"`conform.nvim` and `nvim-lint` are now the default forrmatters and linters in LazyVim.",
"",
"You can use those plugins together with `none-ls.nvim`,",
"but you need to enable the `lazyvim.plugins.extras.lsp.none-ls` extra,",
"for formatting to work correctly.",
"",
"In case you no longer want to use `none-ls.nvim`, just remove the spec from your config.",
})
end
end
function M.setup()
M.health()
-- Autoformat autocmd
vim.api.nvim_create_autocmd("BufWritePre", {
group = vim.api.nvim_create_augroup("LazyFormat", {}),