summaryrefslogtreecommitdiff
path: root/ale_linters/elixir/dogma.vim
diff options
context:
space:
mode:
authorMatteo Centenaro <bugant@gmail.com>2018-10-10 18:19:47 +0200
committerw0rp <w0rp@users.noreply.github.com>2018-10-10 17:19:47 +0100
commitbf1ac8e822835ac2b0e1173e1e014c773b8e51a6 (patch)
treec07810d24da1049e22910538555d4a5db2e941b3 /ale_linters/elixir/dogma.vim
parentea49cc759f7254c03a3515371ffad23e6b326d07 (diff)
downloadale-bf1ac8e822835ac2b0e1173e1e014c773b8e51a6.zip
FIX: use mix from the project root directory (#1954)
* FIX: use mix from the project root directory * Move find root project function to autoloaded handlers * add tests for #ale#handlers#elixr#FindMixProjectRoot
Diffstat (limited to 'ale_linters/elixir/dogma.vim')
-rw-r--r--ale_linters/elixir/dogma.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/ale_linters/elixir/dogma.vim b/ale_linters/elixir/dogma.vim
index 71cf4f4c..dcfb6f28 100644
--- a/ale_linters/elixir/dogma.vim
+++ b/ale_linters/elixir/dogma.vim
@@ -29,10 +29,17 @@ function! ale_linters#elixir#dogma#Handle(buffer, lines) abort
return l:output
endfunction
+function! ale_linters#elixir#dogma#GetCommand(buffer) abort
+ let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer)
+
+ return ale#path#CdString(l:project_root)
+ \ . ' mix help dogma && mix dogma %s --format=flycheck'
+endfunction
+
call ale#linter#Define('elixir', {
\ 'name': 'dogma',
\ 'executable': 'mix',
-\ 'command': 'mix help dogma && mix dogma %s --format=flycheck',
+\ 'command_callback': 'ale_linters#elixir#dogma#GetCommand',
\ 'lint_file': 1,
\ 'callback': 'ale_linters#elixir#dogma#Handle',
\})