mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-30 08:04:31 +08:00
Fix 2732 - Add bashate support
This commit is contained in:
15
test/command_callback/test_bashate_command_callback.vader
Normal file
15
test/command_callback/test_bashate_command_callback.vader
Normal file
@@ -0,0 +1,15 @@
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('sh', 'bashate')
|
||||
call ale#test#SetFilename('test.sh')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(The default bashate command should be correct):
|
||||
AssertLinter 'bashate', ale#Escape('bashate') . ' %t'
|
||||
|
||||
Execute(The bashate command should accept options):
|
||||
let b:ale_sh_bashate_options = '-i E310 --max-line-length 100'
|
||||
|
||||
AssertLinter 'bashate',
|
||||
\ ale#Escape('bashate') . ' -i E310 --max-line-length 100 %t'
|
||||
36
test/handler/test_bashate_handler.vader
Normal file
36
test/handler/test_bashate_handler.vader
Normal file
@@ -0,0 +1,36 @@
|
||||
Before:
|
||||
runtime ale_linters/sh/bashate.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(The bashate handler should handle basic errors):
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {
|
||||
\ 'lnum': 777,
|
||||
\ 'col': 1,
|
||||
\ 'text': 'E003 Indent not multiple of 4',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 783,
|
||||
\ 'col': 1,
|
||||
\ 'text': 'E020 Function declaration not in format ^function name {$',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 786,
|
||||
\ 'col': 1,
|
||||
\ 'text': 'E010 The "do" should be on same line as for',
|
||||
\ },
|
||||
\ {
|
||||
\ 'lnum': 791,
|
||||
\ 'col': 1,
|
||||
\ 'text': 'E006 Line too long',
|
||||
\ },
|
||||
\ ],
|
||||
\ ale_linters#sh#bashate#Handle(bufnr(''), [
|
||||
\ 'run:777:1: E003 Indent not multiple of 4',
|
||||
\ 'run:783:1: E020 Function declaration not in format ^function name {$',
|
||||
\ 'run:786:1: E010 The "do" should be on same line as for',
|
||||
\ 'run:791:1: E006 Line too long',
|
||||
\ ])
|
||||
Reference in New Issue
Block a user