summaryrefslogtreecommitdiff
path: root/ale_linters/erlang
diff options
context:
space:
mode:
authorpinicarus <pinicarus@protonmail.com>2020-09-30 22:44:19 +0200
committerpinicarus <pinicarus@protonmail.com>2020-09-30 23:16:50 +0200
commitac3c0c093a2e3ea05793e57d3e836751ba67052b (patch)
tree87678c06eaf01db0b6d540d2874218a792350035 /ale_linters/erlang
parent96dcbd1f2069843acdc57646074b3d9f0e768044 (diff)
downloadale-ac3c0c093a2e3ea05793e57d3e836751ba67052b.zip
feat(erlang/dialyzer): add custom options passing
Diffstat (limited to 'ale_linters/erlang')
-rw-r--r--ale_linters/erlang/dialyzer.vim18
1 files changed, 13 insertions, 5 deletions
diff --git a/ale_linters/erlang/dialyzer.vim b/ale_linters/erlang/dialyzer.vim
index 395647a0..e27f8127 100644
--- a/ale_linters/erlang/dialyzer.vim
+++ b/ale_linters/erlang/dialyzer.vim
@@ -3,6 +3,8 @@
let g:ale_erlang_dialyzer_executable =
\ get(g:, 'ale_erlang_dialyzer_executable', 'dialyzer')
+let g:ale_erlang_dialyzer_options =
+\ get(g:, 'ale_erlang_dialyzer_options', '')
let g:ale_erlang_dialyzer_plt_file =
\ get(g:, 'ale_erlang_dialyzer_plt_file', '')
let g:ale_erlang_dialyzer_rebar3_profile =
@@ -47,14 +49,20 @@ function! ale_linters#erlang#dialyzer#GetExecutable(buffer) abort
endfunction
function! ale_linters#erlang#dialyzer#GetCommand(buffer) abort
+ let l:options = ale#Var(a:buffer, 'erlang_dialyzer_options')
+
+ if len(l:options) == 0
+ let l:options = '-Wunmatched_returns'
+ \ . ' -Werror_handling'
+ \ . ' -Wrace_conditions'
+ \ . ' -Wunderspecs'
+ \ . ' %s'
+ endif
+
let l:command = ale#Escape(ale_linters#erlang#dialyzer#GetExecutable(a:buffer))
\ . ' -n'
\ . ' --plt ' . ale#Escape(ale_linters#erlang#dialyzer#GetPlt(a:buffer))
- \ . ' -Wunmatched_returns'
- \ . ' -Werror_handling'
- \ . ' -Wrace_conditions'
- \ . ' -Wunderspecs'
- \ . ' %s'
+ \ . ' ' . l:options
return l:command
endfunction