From a22ab78dd758da2d17bef01de5bad1f394911e9d Mon Sep 17 00:00:00 2001 From: Adam Trepanier Date: Mon, 11 Mar 2019 04:12:32 -0500 Subject: 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 --- ale_linters/elixir/credo.vim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'ale_linters') 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', { -- cgit v1.2.3