Merge pull request #2529 from maxwell-k/terraform_linter

Add a terraform linter
This commit is contained in:
w0rp
2019-05-29 23:28:50 +01:00
committed by GitHub
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 -'

View File

@@ -0,0 +1,34 @@
Before:
" Load the file which defines the linter.
runtime ale_linters/terraform/terraform.vim
After:
" Unload all linters again.
call ale#linter#Reset()
Execute(The output should be correct):
AssertEqual
\ [
\ {
\ 'lnum': 1,
\ 'col': 20,
\ 'type': 'E',
\ 'text': 'illegal char',
\ },
\ {
\ 'lnum': 2,
\ 'col': 14,
\ 'type': 'E',
\ 'text': 'literal not terminated',
\ },
\ {
\ 'lnum': 1,
\ 'type': 'E',
\ 'text': 'object expected closing RBRACE got: EOF',
\ },
\ ],
\ ale_linters#terraform#terraform#Handle(bufnr(''), [
\ 'Error running fmt: In <standard input>: At 1:20: illegal char',
\ 'Error running fmt: In <standard input>: At 2:14: literal not terminated',
\ 'Error running fmt: In <standard input>: object expected closing RBRACE got: EOF',
\ ])