Name: HCL
URL: https://github.com/hashicorp/hcl
Hashicorp uses Hashicorp Configuration Language (HCL) for most, if not all, of their products (e.g. Terraform, Vault, Consul ...etc).
Terraform itself is a form of HCL with special keywords and Terraform files end with .tf extension, so tflint is the appropriate linter/fixer for it.
However, for Vault and other tools that require some config.hcl file, I suggest and recommend hclfmt as a linter/fixer.
Thank you.
@petermbenjamin Why not use the built-in defacto formatter that comes with terraform? (i.e. terraform fmt).
I don't usually work with terraform templates, so I don't have terraform cli installed. I usually work with consul and vault configs (and vault policy files, which are based on HCL as well).
Got it.
I suppose a separate fixer can be added for terraform then. No harm, no foul.
Few questions:
terraform fmt works on consul/vault configs (e.g. .hcl files) in addition to .tf files?hclfmt does not work on terraform .tf files?Just seeing your question now @petermbenjamin, sorry for the delay:
terraform fmt works on .hcl files ONLY if the files are passed to fmt explicitly. This should work fine for the case of this fixer.hclfmt until seeing this issue, so I'm not totally sure.Thanks for the information, @dsifford .
Considering Fatih (author/maintainer) of hclfmt has recently archived the project with no plans to maintain it, and considering terraform fmt works on .hcl as well as .tf files, we should just integrate vim-terraform as a fixer for HCL and TF files.
It's best to not rely on other plugins. terraform fmt can easily be integrated as a fixer of its own.
Agree with @RyanSquared --- I can PR the fixer for that if needed. Just let me know.
@dsifford sounds good, if you could get a PR set up that would be helpful. Otherwise I can look into it, might be useful as I use .tf files at work.
All set in #2015
Done now, thanks to @dsifford. :+1: