feat(nvim): added sqlfluff extra (sql linter)

This commit is contained in:
Sergio Laín 2024-01-11 10:03:39 +01:00
parent ed6c419593
commit 5e85f28fb9
No known key found for this signature in database
GPG key ID: 14C9B8080681777B

View file

@ -0,0 +1,31 @@
return {
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "sqlfluff" })
end,
},
{
"mfussenegger/nvim-lint",
opts = function(_, opts)
local function add_linters(tbl)
for ft, linters in pairs(tbl) do
if opts.linters_by_ft[ft] == nil then
opts.linters_by_ft[ft] = linters
else
vim.list_extend(opts.linters_by_ft[ft], linters)
end
end
end
add_linters({
["sql"] = { "sqlfluff" },
["plsql"] = { "sqlfluff" },
["mysql"] = { "sqlfluff" },
})
return opts
end,
},
}