summaryrefslogtreecommitdiff
path: root/ale_linters/elixir
diff options
context:
space:
mode:
authorAdam Trepanier <adam-e-trepanier@users.noreply.github.com>2019-03-11 04:12:32 -0500
committerw0rp <w0rp@users.noreply.github.com>2019-03-11 09:12:32 +0000
commita22ab78dd758da2d17bef01de5bad1f394911e9d (patch)
treea96c4a9ed2f4a438f5f53eac3415bfd1f2d6b53d /ale_linters/elixir
parenta6012d853c4bc5251b01cc7b58177ba665f11609 (diff)
downloadale-a22ab78dd758da2d17bef01de5bad1f394911e9d.zip
make options for credo configurable (#2337)
* Add credo --strict option If a user sets 'let g:ale_elixir_credo_strict=1' it will run credo with --strict instead of suggest. The default (0) is to run as suggest. * Added credo docs
Diffstat (limited to 'ale_linters/elixir')
-rw-r--r--ale_linters/elixir/credo.vim13
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', {