fix(nvim): skip 'yamllint' when no config present
check / lint (push) Successful in 15s

This commit is contained in:
2026-10-07 22:43:15 +02:00
parent 5d4a49bc2a
commit 52a83d4744
@@ -28,8 +28,16 @@ require("lint").linters_by_ft = {
yaml = { "yamllint" },
}
local function has_yamllint_config(buf)
return vim.fs.root(buf, { ".yamllint", ".yamllint.yaml", ".yamllint.yml" }) ~= nil
end
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
callback = function()
group = vim.api.nvim_create_augroup("nvim-lint.try_lint", {}),
callback = function(args)
if vim.bo[args.buf].filetype == "yaml" and not has_yamllint_config(args.buf) then
return
end
require("lint").try_lint()
end,
})