mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-30 22:55:30 +08:00
Add a terraform linter
This linter uses the check functionality built into terraform. ALE
already has a fixer using `terraform fmt` but this doesn't provide error
messages. ALE already has a linter using `tflint` but this requires an
extra application to be installed.
For example this linter will give a warning that ! is an illegal
character in the line below:
variable "example" !{}
This linter runs the buffer through the command below and parses the
output:
terraform fmt -no-color -check=true -
This commit includes a basic implementation, documentation and tests.
The only option is to control which executable is run.
Tested with:
$ terraform -version
Terraform v0.11.13
This commit is contained in:
@@ -5,7 +5,7 @@ ALE HCL Integration *ale-hcl-options*
|
||||
===============================================================================
|
||||
terraform-fmt *ale-hcl-terraform-fmt*
|
||||
|
||||
See |ale-terraform-fmt| for information about the available options.
|
||||
See |ale-terraform-fmt-fixer| for information about the available options.
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -3,7 +3,7 @@ ALE Terraform Integration *ale-terraform-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
fmt *ale-terraform-fmt*
|
||||
terraform-fmt-fixer *ale-terraform-fmt-fixer*
|
||||
|
||||
g:ale_terraform_fmt_executable *g:ale_terraform_fmt_executable*
|
||||
*b:ale_terraform_fmt_executable*
|
||||
@@ -20,6 +20,18 @@ g:ale_terraform_fmt_options *g:ale_terraform_fmt_options*
|
||||
Default: `''`
|
||||
|
||||
|
||||
===============================================================================
|
||||
terraform *ale-terraform-terraform*
|
||||
|
||||
g:ale_terraform_terraform_executable *g:ale_terraform_terraform_executable*
|
||||
*b:ale_terraform_terraform_executable*
|
||||
|
||||
Type: |String|
|
||||
Default: `'terraform'`
|
||||
|
||||
This variable can be changed to use a different executable for terraform.
|
||||
|
||||
|
||||
===============================================================================
|
||||
tflint *ale-terraform-tflint*
|
||||
|
||||
|
||||
@@ -2246,7 +2246,8 @@ documented in additional help files.
|
||||
tcl.....................................|ale-tcl-options|
|
||||
nagelfar..............................|ale-tcl-nagelfar|
|
||||
terraform...............................|ale-terraform-options|
|
||||
fmt...................................|ale-terraform-fmt|
|
||||
terraform-fmt-fixer...................|ale-terraform-fmt-fixer|
|
||||
terraform.............................|ale-terraform-terraform|
|
||||
tflint................................|ale-terraform-tflint|
|
||||
tex.....................................|ale-tex-options|
|
||||
chktex................................|ale-tex-chktex|
|
||||
|
||||
Reference in New Issue
Block a user