json2hcl icon indicating copy to clipboard operation
json2hcl copied to clipboard

Json2hcl reverse is not working.

Open roylkng opened this issue 3 years ago • 2 comments
trafficstars

I tried reverse on the tf file in the fixtures, but it gets stuck without any output.

roylkng avatar Sep 09 '22 08:09 roylkng

Thank you for this report, but as stated in the README:

We don't use json2hcl anymore ourselves, so we can't invest time into it. However, we're still welcoming PRs.

Acconut avatar Sep 09 '22 12:09 Acconut

Adding a test case if someone wants to fix this.

$ cat test-vars.tf 
variable "my_var" {
  type        = string
  description = "This is a variable"
  default     = "foo"
}

$ terraform fmt test-vars.tf

$ cat test-vars.tf | json2hcl -reverse
unable to parse HCL: At 2:17: Unknown token: 2:17 IDENT string

gtirloni avatar Nov 04 '23 13:11 gtirloni