hcl
hcl copied to clipboard
Empty block syntactic sugar
Hi,
I've noticed that often configuration files contain empty blocks, for example:
variable "prod_access_key" {}
variable "prod_secret_key" {}
variable "test_account_id" {}
variable "test_access_key" {}
variable "test_secret_key" {}
variable "bucket_name" {}
taken from: https://github.com/terraform-providers/terraform-provider-aws/blob/24e937a299c9115be47052404a97d6c9d5a4ccfa/examples/s3-cross-account-access/variables.tf.
Have you considered in HCL2 allowing shorter form without explicit mention the empty block? For example:
variable "prod_access_key"
variable "prod_secret_key"
variable "test_account_id"
variable "test_access_key"
variable "test_secret_key"
variable "bucket_name"
Thanks! Hadar
This would be a neat feature. Maybe using a different single character to end inline blocks would help with parsing the syntax? (a semicolon for example)