You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terraform fmt does lots of things I consider making code harder to read
example: variables.tf from:
variable "access_var1" { type = "string" }
variable "access_var2" { type = "string" }
variable "access_var3" { type = "string" }
variable "common_config" { type = "map" }
variable "input_var1" { type = "string" }
to
variable "access_var1" {
type = "string"
}
variable "access_var2" {
type = "string"
}
variable "access_var3" {
type = "string"
}
variable "common_config" {
type = "map"
}
variable "input_var1" {
type = "string"
}
etc. - first one - easy to read, easy to see types, easy to diff, all probably fits on a single page
last one , wordy verbose, too many lines, difficult to diff and frequently goes off the page.
Is it possible to switch on different features of terraform fmt to tailor what it does? Some of the decisions it makes are questionable.
Thanks!
The text was updated successfully, but these errors were encountered:
fmt does not currently support granular configuration, or defining an alternative style, and the following is a reason why:
Other Terraform commands that generate Terraform configuration will produce configuration files that conform to the style imposed by terraform fmt, so using this style in your own files will ensure consistency.
The response above is meant to answer your question, but are you requesting this as a feature? That is, the ability to define a preference for how Terraform formats files?
On further research and reflection, I'll close this question, and the larger "can I customize how fmt works?" is responded to in this comment: #20910 (comment) and can be the place for any further discussion (or closure, if a firm decision is made).
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
ghost
locked and limited conversation to collaborators
Aug 23, 2019
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform fmt does lots of things I consider making code harder to read
example: variables.tf from:
to
etc. - first one - easy to read, easy to see types, easy to diff, all probably fits on a single page
last one , wordy verbose, too many lines, difficult to diff and frequently goes off the page.
Is it possible to switch on different features of terraform fmt to tailor what it does? Some of the decisions it makes are questionable.
Thanks!
The text was updated successfully, but these errors were encountered: