summaryrefslogtreecommitdiff
path: root/ale_linters/elixir/credo.vim
diff options
context:
space:
mode:
authorBartek thindil Jasicki <thindil@laeran.pl>2021-01-22 09:45:52 +0100
committerBartek thindil Jasicki <thindil@laeran.pl>2021-01-22 09:45:52 +0100
commit42bf5ca91110bac565d76263bd5d21ebb9b142a9 (patch)
tree5588c363f8a1e4129cc6c9adf7136daaedf0adf1 /ale_linters/elixir/credo.vim
parent45a28383a2da3d28bdc5e7d3a0deb6365680980d (diff)
parent7e3d2930d8defbcb233b0bc21822cb8e8377bec2 (diff)
downloadale-42bf5ca91110bac565d76263bd5d21ebb9b142a9.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'ale_linters/elixir/credo.vim')
-rw-r--r--ale_linters/elixir/credo.vim11
1 files changed, 11 insertions, 0 deletions
diff --git a/ale_linters/elixir/credo.vim b/ale_linters/elixir/credo.vim
index 7c298502..892d47b9 100644
--- a/ale_linters/elixir/credo.vim
+++ b/ale_linters/elixir/credo.vim
@@ -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 empty(l:config_file)
+ return ''
+ endif
+
+ return ' --config-file ' . l:config_file
+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