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:
Keith Maxwell
2019-05-23 14:12:36 +01:00
parent 1a9b8a58c7
commit 88fa0b9294
6 changed files with 108 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
" Based upon :help ale-development
Before:
call ale#assert#SetUpLinterTest('terraform', 'terraform')
After:
call ale#assert#TearDownLinterTest()
Execute(The default command should be correct):
AssertLinter 'terraform', ale#Escape('terraform') . ' fmt -no-color --check=true -'