mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-09 03:01:31 +08:00
feat: Add optional configuration file for Credo
This commit is contained in:
@@ -45,6 +45,16 @@ function! ale_linters#elixir#credo#GetMode() abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
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
|
function! ale_linters#elixir#credo#GetCommand(buffer) abort
|
||||||
let l:project_root = ale#handlers#elixir#FindMixUmbrellaRoot(a:buffer)
|
let l:project_root = ale#handlers#elixir#FindMixUmbrellaRoot(a:buffer)
|
||||||
let l:mode = ale_linters#elixir#credo#GetMode()
|
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)
|
return ale#path#CdString(l:project_root)
|
||||||
\ . 'mix help credo && '
|
\ . 'mix help credo && '
|
||||||
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
|
\ . 'mix credo ' . ale_linters#elixir#credo#GetMode()
|
||||||
|
\ . ale_linters#elixir#credo#GetConfigFile()
|
||||||
\ . ' --format=flycheck --read-from-stdin %s'
|
\ . ' --format=flycheck --read-from-stdin %s'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user