Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCL autoformat doesn't allow commenting hash values of a list #220

Open
joshuaspence opened this issue Oct 25, 2017 · 0 comments
Open

HCL autoformat doesn't allow commenting hash values of a list #220

joshuaspence opened this issue Oct 25, 2017 · 0 comments
Labels
v1 Relates to the v1 line of releases

Comments

@joshuaspence
Copy link

I have some HCL (specifically, Terraform code) which looks something like this:

variable "test" {
  default = [
    # This is a comment for this list element.
    {
      key = "value"
    },
  ]
}

Running terraform fmt changes the formatting of this code to this:

variable "test" {
  default = [
    {
      # This is a comment for this list element.
      key = "value"
    },
  ]
}

This doesn't seem desirable to me because the comment is meant to refer to the entire hash element.

@apparentlymart apparentlymart added the v1 Relates to the v1 line of releases label Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1 Relates to the v1 line of releases
Projects
None yet
Development

No branches or pull requests

2 participants