Merge pull request #860 from dmitrivereshchagin/update-syntaxerl-linter
Add original filename to SyntaxErl command
This commit is contained in:
commit
f8de08faf0
@ -10,7 +10,7 @@ endfunction
|
|||||||
|
|
||||||
|
|
||||||
function! ale_linters#erlang#syntaxerl#GetCommand(buffer) abort
|
function! ale_linters#erlang#syntaxerl#GetCommand(buffer) abort
|
||||||
return ale_linters#erlang#syntaxerl#GetExecutable(a:buffer) . ' %t'
|
return ale_linters#erlang#syntaxerl#GetExecutable(a:buffer) . ' -b %s %t'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,26 @@
|
|||||||
|
Before:
|
||||||
|
Save g:ale_erlang_syntaxerl_executable
|
||||||
|
unlet! g:ale_erlang_syntaxerl_executable b:ale_erlang_syntaxerl_executable
|
||||||
|
runtime ale_linters/erlang/syntaxerl.vim
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#linter#Reset()
|
||||||
|
Restore g:ale_erlang_syntaxerl_executable
|
||||||
|
|
||||||
|
Execute (Get SyntaxErl executable):
|
||||||
|
AssertEqual 'syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
|
||||||
|
|
||||||
|
let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
|
||||||
|
AssertEqual '/some/other/syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
|
||||||
|
|
||||||
|
let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
|
||||||
|
AssertEqual '/yet/another/syntaxerl', ale_linters#erlang#syntaxerl#GetExecutable(bufnr(''))
|
||||||
|
|
||||||
|
Execute (Get SyntaxErl command line):
|
||||||
|
AssertEqual 'syntaxerl -b %s %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
|
||||||
|
|
||||||
|
let g:ale_erlang_syntaxerl_executable = '/some/other/syntaxerl'
|
||||||
|
AssertEqual '/some/other/syntaxerl -b %s %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
|
||||||
|
|
||||||
|
let b:ale_erlang_syntaxerl_executable = '/yet/another/syntaxerl'
|
||||||
|
AssertEqual '/yet/another/syntaxerl -b %s %t', ale_linters#erlang#syntaxerl#GetCommand(bufnr(''))
|
@ -4,7 +4,7 @@ Before:
|
|||||||
After:
|
After:
|
||||||
call ale#linter#Reset()
|
call ale#linter#Reset()
|
||||||
|
|
||||||
Execute:
|
Execute (Handle SyntaxErl output):
|
||||||
AssertEqual
|
AssertEqual
|
||||||
\ [
|
\ [
|
||||||
\ {
|
\ {
|
||||||
@ -18,7 +18,7 @@ Execute:
|
|||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
\ },
|
\ },
|
||||||
\ ],
|
\ ],
|
||||||
\ ale_linters#erlang#syntaxerl#Handle(42, [
|
\ ale_linters#erlang#syntaxerl#Handle(bufnr(''), [
|
||||||
\ "/tmp/v2wDixk/1/module.erl:42: syntax error before: ','",
|
\ "/tmp/v2wDixk/1/module.erl:42: syntax error before: ','",
|
||||||
\ '/tmp/v2wDixk/2/module.erl:42: warning: function foo/0 is unused',
|
\ '/tmp/v2wDixk/2/module.erl:42: warning: function foo/0 is unused',
|
||||||
\ ])
|
\ ])
|
||||||
|
Loading…
Reference in New Issue
Block a user