-
Notifications
You must be signed in to change notification settings - Fork 640
Open
Description
Dear all,
I would like to see terraform fmt support pretty-printing collection types. Currently I observe that internal terraform fmt code runs format passes on fixed lines (please see format.go). But I hope it can help me format variables of collection types (list, set, map), for instance
variable "example_set" {
type = set(string)
default = ["foo", "bar", "dog", "cat", "jojo"]
}
# reformatted to =========================>
variable "example_set" {
type = set(string)
default = [
"foo",
"bar",
"dog",
"cat",
"jojo"
]
}To my understanding, implementing this feature requires replacing the current []formatLine with other data strucutres like linked lists to allow flexible line insertions.
I hope you can put my feature request on your radar! If you don't mind, I'm also willing to implement it if you agree.
Best regards,
Xulei
Metadata
Metadata
Assignees
Labels
No labels