aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/terragrunt_hclfmt.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/conform/formatters/terragrunt_hclfmt.lua')
-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,
+}