diff options
Diffstat (limited to 'ale_linters/elixir')
-rw-r--r-- | ale_linters/elixir/credo.vim | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ale_linters/elixir/credo.vim b/ale_linters/elixir/credo.vim index 8431c0df..317ecab3 100644 --- a/ale_linters/elixir/credo.vim +++ b/ale_linters/elixir/credo.vim @@ -37,11 +37,22 @@ function! ale_linters#elixir#credo#Handle(buffer, lines) abort return l:output endfunction +function! ale_linters#elixir#credo#GetMode() abort + if get(g:, 'ale_elixir_credo_strict', 0) + return '--strict' + else + return 'suggest' + endif +endfunction + function! ale_linters#elixir#credo#GetCommand(buffer) abort let l:project_root = ale#handlers#elixir#FindMixProjectRoot(a:buffer) + let l:mode = ale_linters#elixir#credo#GetMode() return ale#path#CdString(l:project_root) - \ . ' mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s' + \ . 'mix help credo && ' + \ . 'mix credo ' . ale_linters#elixir#credo#GetMode() + \ . ' --format=flycheck --read-from-stdin %s' endfunction call ale#linter#Define('elixir', { |