feat: Add optional configuration file for Credo
This commit is contained in:
parent
681a6e371d
commit
433b23be17
1 changed files with 11 additions and 0 deletions
|
@ -45,6 +45,16 @@ function! ale_linters#elixir#credo#GetMode() abort
|
|||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elixir#credo#GetConfigFile() abort
|
||||
let l:config_file = get(g:, 'ale_elixir_credo_config_file', '')
|
||||
|
||||
if len(l:config_file) == 0
|
||||
return ''
|
||||
else
|
||||
return ' --config-file ' . l:config_file
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#elixir#credo#GetCommand(buffer) abort
|
||||
let l:project_root = ale#handlers#elixir#FindMixUmbrellaRoot(a:buffer)
|
||||
let l:mode = ale_linters#elixir#credo#GetMode()
|
||||
|
@ -52,6 +62,7 @@ function! ale_linters#elixir#credo#GetCommand(buffer) abort
|
|||
return ale#path#CdString(l:project_root)
|
||||
\ . 'mix help credo && '
|
||||
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
|
||||
\ . ale_linters#elixir#credo#GetConfigFile()
|
||||
\ . ' --format=flycheck --read-from-stdin %s'
|
||||
endfunction
|
||||
|
||||
|
|
Reference in a new issue