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

hclwrite: do not add space after a bang #403

Merged

Conversation

sivapalan
Copy link
Contributor

A space should not be added after a bang (!) - which is used for negation.

See: https://www.terraform.io/docs/configuration/expressions.html#logical-operators

@hashicorp-cla
Copy link

hashicorp-cla commented Sep 21, 2020

CLA assistant check
All committers have signed the CLA.

@apparentlymart
Copy link
Contributor

Thanks @sivapalan! It does look like the form without a space is what examples show in the Terraform documentation, and that's typically been our guide for what is "idiomatic HCL" given that HCL started its life as a Terraform-specific language.

This unary ! operator doesn't seem to be used often in most Terraform configurations, but I agree it'd be good to make systems built around hclwrite's formatter, such as hclfmt and terraform fmt, match the idiomatic usage nonetheless.

Thanks for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hclwrite v2 Relates to the v2 line of releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants