summaryrefslogtreecommitdiff
path: root/plugin/lint.lua
blob: b7dba215f2219e459f3036a09366d6b0fa6eec08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if vim.g.did_load_lint_plugin then
	return
end
vim.g.did_load_lint_plugin = true

require("lint").linters_by_ft = {
	githubaction = { "actionlint" },
	lua = { "selene" },
	nix = { "statix" },
}

vim.api.nvim_create_autocmd({ "BufWritePost" }, {
	callback = function()
		-- Run linters declared in linters_by_ft
		require("lint").try_lint()

		-- Run these linters regardless of filetype
		require("lint").try_lint("alex")
	end,
})