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

Pretty printer doesn't add quotes #95

Closed
joshuaspence opened this issue Mar 7, 2016 · 1 comment
Closed

Pretty printer doesn't add quotes #95

joshuaspence opened this issue Mar 7, 2016 · 1 comment

Comments

@joshuaspence
Copy link

When using hclfmt, the following syntax is acceptable:

output foobar {}

I would have expected this to be corrected by the pretty pretty to include quotes around the resource name, i.e.

output "foobar" {}
@mitchellh
Copy link
Contributor

We actually can't add quotes safely because what if the application intended it to be unquoted? They are semantically the same but stylistically different. For example, why wouldn't we do this:

"output" "foobar" {}

Or, in the TF resource case, what do we quote?

"resource" aws_instance "bar" {}

etc. See all the ambiguities? A schema-less printer can't know, so we mimic the user input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants