-
Notifications
You must be signed in to change notification settings - Fork 453
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
Add .tf (terraform) support to beautify #645
Comments
TF is close enough to JavaScript that I can make this work, but I have some questions first:
The safest course of action is to use a JavaScript parser for this, but only parse for TF code when passed an option explicitly declaring TF conventions. I just have to put up a prototype for you to play around with so that we can ensure that million things the JavaScript library is doing isn't consequential to TF. |
Code samples:
|
+1 |
+1, does this have any momentum? Is there a branch somewhere? |
@Knetic I proposed some questions in a comment above. I need some details answered before I can write the needed support. |
Ah, missed those above. Quick note; Terraform uses the "Hashicorp Configuration Language" (hcl), which is shared across a few of their tools. It's got a repo here which seems to spec out most of the syntax. From that page, I'm fair sure that the language never uses semicolons. As far as detecting that a file is HCL, I'm not sure how the beautifier works today, but when trying to beautify some HCL this morning it seemed to know that it was an HCL file:
Not sure if that's because i have an HCL language syntax highlighter installed or not. But, if there's no support yet, the way that objects are defined seems like a safe way to tell. |
Language detection in this tool uses this priority:
I will spend some time looking at HCL. |
+1 on the utility of adding HCL language support. It would be amazing, |
+1. |
Looks like all we need is someone to submit a Pull Request adding |
Added a PR yesterday. Crossing fingers that it will apporved. 🤞 |
I think every issue in the PR was fixed, which requires just an approval. |
Published to v0.30.6 |
.tf files are defined at https://www.terraform.io/docs/configuration/index.html
We're using terraform to manage AWS infrastructure and would like for Atom to keep the config files formatted beautifully.
The text was updated successfully, but these errors were encountered: