Before:
function! TestCallback(buffer, output)
return [{
\ 'lnum': 2,
\ 'col': 3,
\ 'text': a:output[0],
\}]
endfunction
function! TestCallback2(buffer, output)
\ 'lnum': 3,
\ 'col': 4,
" Running the command in another subshell seems to help here.
call ale#linter#Define('foobar', {
\ 'name': 'testlinter',
\ 'callback': 'TestCallback',
\ 'executable': 'echo',
\ 'command': '/bin/sh -c ''echo foo bar''',
\})
After:
let g:ale_buffer_info = {}
delfunction TestCallback
delfunction TestCallback2
call ale#linter#Reset()
Given foobar (Some imaginary filetype):
foo
bar
baz
Execute(Linters should run with the default options):
AssertEqual 'foobar', &filetype
call ale#Lint()
call ale#engine#WaitForJobs(2000)
AssertEqual [{
\ 'bufnr': bufnr('%'),
\ 'vcol': 0,
\ 'text': 'foo bar',
\ 'type': 'E',
\ 'nr': -1,
\ 'pattern': '',
\ 'valid': 1,
\ }], getloclist(0)
Execute(Previous errors should be removed when linters change):
\ 'name': 'testlinter2',
\ 'callback': 'TestCallback2',
\ 'command': '/bin/sh -c ''echo baz boz''',
\ 'text': 'baz boz',