summaryrefslogtreecommitdiff
path: root/ale_linters/elixir/credo.vim
diff options
context:
space:
mode:
authorGonzalo Quero <gquero@drwuk.com>2020-09-02 13:08:46 +0100
committerGonzalo Quero <gquero@drwuk.com>2020-11-23 10:08:00 +0000
commit433b23be17095c0211685ff32e25fcdbfffe2ce7 (patch)
tree80a6d1f7e7f2c024fce9ca3b88839dc19629fcb4 /ale_linters/elixir/credo.vim
parent681a6e371d02cce9c2414c19f5deeae61aa321fa (diff)
downloadale-433b23be17095c0211685ff32e25fcdbfffe2ce7.zip
feat: Add optional configuration file for Credo
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..15ebefb5 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 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