nvim/lua/user/plugins/lsp/lint.lua
2023-10-28 00:00:00 +07:00

30 lines
1.3 KiB
Lua

local linters_path = vim.fn.stdpath('data') .. '/lint'
local util = require('user.util.misc')
-- `condition` and `filetypes` are custom fields.
-- The other is the same as in `require('lint').linters.<linter_name>`
return {
buf = { filetypes = 'proto' },
buildifier = { filetypes = 'bzl' },
-- codespell = { filetypes = '*', cmd = linters_path .. '/codespell/bin/codespell' },
cspell = {
cmd = linters_path .. '/cspell/node_modules/.bin/cspell',
filetypes = '*',
condition = util.root_has_file({
'.cspell.json',
'cspell.json',
'.cSpell.json',
'cSpell.json',
'cspell.config.json',
}),
},
fish = { filetypes = 'fish', args = { '--private', '--no-execute' } },
-- hadolint = { filetypes = 'dockerfile' },
-- proselint = { filetypes = { 'markdown', 'asciidoc', 'org' }, cmd = linters_path .. '/proselint/bin/proselint' },
selene = { filetypes = 'lua', condition = util.root_has_file('selene.toml') },
sqlfluff = { filetypes = 'sql', cmd = linters_path .. '/sqlfluff/bin/sqlfluff' },
tflint = { filetypes = 'terraform', condition = util.root_has_file('.tflint.hcl') },
tfsec = { filetypes = 'terraform' },
vale = { filetypes = 'markdown', condition = util.root_has_file('.vale.ini') },
}