aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters
diff options
context:
space:
mode:
authorZoltán Reegn <zoltan.reegn@gmail.com>2024-01-24 18:40:12 +0100
committerGitHub <noreply@github.com>2024-01-24 09:40:12 -0800
commit375258f1fe1500f175d7135aef1dc6a87dbd83b2 (patch)
tree10c160b24bc83aafa3a0cff5323292b04a279724 /lua/conform/formatters
parent3d59cbd01a4b74124c5a6fb23b8cc63e5c2db3d5 (diff)
feat: add terragrunt_hclfmt formatter (#278)
Diffstat (limited to 'lua/conform/formatters')
-rw-r--r--lua/conform/formatters/terragrunt_hclfmt.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lua/conform/formatters/terragrunt_hclfmt.lua b/lua/conform/formatters/terragrunt_hclfmt.lua
new file mode 100644
index 0000000..7180746
--- /dev/null
+++ b/lua/conform/formatters/terragrunt_hclfmt.lua
@@ -0,0 +1,13 @@
+---@type conform.FileFormatterConfig
+return {
+ meta = {
+ url = "https://terragrunt.gruntwork.io/docs/reference/cli-options/#hclfmt",
+ description = "Format hcl files into a canonical format.",
+ },
+ command = "terragrunt",
+ args = { "hclfmt", "--terragrunt-hclfmt-file", "$FILENAME" },
+ stdin = false,
+ condition = function(self, ctx)
+ return vim.fs.basename(ctx.filename) ~= "terragrunt.hcl"
+ end,
+}