mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
yaml - xml formatting with `xmllint` - Security linting with `trivy` for dockerfile, terraform & yaml
38 lines
1.1 KiB
Lua
38 lines
1.1 KiB
Lua
return {
|
|
{
|
|
"mfussenegger/nvim-lint",
|
|
lazy = true,
|
|
event = { "BufReadPre", "BufNewFile" },
|
|
config = function()
|
|
local lint = require("lint")
|
|
|
|
-- Linters are only required for dynamically typed languages
|
|
lint.linters_by_ft = {
|
|
python = { "pylint" },
|
|
markdown = { "markdownlint" },
|
|
yaml = { "yamllint", "trivy" },
|
|
dockerfile = { "hadolint", "trivy" },
|
|
terraform = { "trivy" },
|
|
|
|
["*"] = { "codespell" },
|
|
}
|
|
|
|
local markdownlint = lint.linters.markdownlint
|
|
markdownlint.args = {
|
|
"--config",
|
|
vim.loop.os_homedir() .. "/.config/templates/markdownlint.json",
|
|
"--",
|
|
}
|
|
|
|
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
|
|
|
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
|
group = lint_augroup,
|
|
callback = function()
|
|
lint.try_lint()
|
|
end,
|
|
})
|
|
end,
|
|
},
|
|
}
|