feat(conform): add terraform fmt

This commit is contained in:
Simon Lasbrugnas 2026-01-23 19:01:13 +01:00
parent 8a58f7fe3c
commit 5ca4f0ef5b
Signed by untrusted user who does not match committer: simon
GPG key ID: 86039876BA6ED8DE

View file

@ -13,6 +13,7 @@ return {
css = { "prettier" }, css = { "prettier" },
xml = { "xmlformatter" }, xml = { "xmlformatter" },
svg = { "xmlformatter" }, svg = { "xmlformatter" },
terraform = { "tfmt" },
javascript = { "biome", "prettier" }, javascript = { "biome", "prettier" },
javascriptreact = { "biome", "prettier" }, javascriptreact = { "biome", "prettier" },
typescript = { "biome", "prettier" }, typescript = { "biome", "prettier" },
@ -20,6 +21,14 @@ return {
["*"] = { "trim_whitespace" }, ["*"] = { "trim_whitespace" },
}, },
formatters = { formatters = {
tfmt = {
condition = function()
return vim.bo.filetype == "terraform"
end,
command = "terraform",
args = { "fmt", "$FILENAME" },
stdin = false,
},
biome = { biome = {
condition = function() condition = function()
return vim.uv.fs_realpath("biome.json") ~= nil return vim.uv.fs_realpath("biome.json") ~= nil