diff options
Diffstat (limited to 'ale_linters/elixir/dialyxir.vim')
-rw-r--r-- | ale_linters/elixir/dialyxir.vim | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ale_linters/elixir/dialyxir.vim b/ale_linters/elixir/dialyxir.vim index bba0ae14..d28d3c70 100644 --- a/ale_linters/elixir/dialyxir.vim +++ b/ale_linters/elixir/dialyxir.vim @@ -25,10 +25,17 @@ function! ale_linters#elixir#dialyxir#Handle(buffer, lines) abort return l:output endfunction +function! ale_linters#elixir#dialyxir#GetCommand(buffer) abort + let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer) + + return ale#path#CdString(l:project_root) + \ . ' mix help dialyzer && mix dialyzer' +endfunction + call ale#linter#Define('elixir', { \ 'name': 'dialyxir', \ 'executable': 'mix', -\ 'command': 'mix help dialyzer && mix dialyzer', +\ 'command_callback': 'ale_linters#elixir#dialyxir#GetCommand', \ 'callback': 'ale_linters#elixir#dialyxir#Handle', \}) |