Open alikhil opened 2 years ago
This is a good point. I think the better approach is for terragrunt
to format the generated code when it is terraform, e.g. an option on generate
block:
generate "data" {
# ... other args omitted for brevity ...
tf_fmt = true
}
That way, the code is already formatted when terragrunt emits it out.
Sometimes we want to generate terraform code and we write configurations like:
And if we run
terragrunt hclfmt
andterraform fmt -recursive
this config will not be formatted.However, if we run
terragrunt fmt -check=true
it will produce errors like:I propose to add autoformatting of generated objects by setting some special flag (
terragrunt hclfmt --format-generated
)