mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
Merge pull request #2529 from maxwell-k/terraform_linter
Add a terraform linter
This commit is contained in:
@@ -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 -'
|
||||
34
test/handler/test_terraform_handler.vader
Executable file
34
test/handler/test_terraform_handler.vader
Executable 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',
|
||||
\ ])
|
||||
Reference in New Issue
Block a user