summaryrefslogtreecommitdiff
path: root/ale_linters/erlang
diff options
context:
space:
mode:
authorpinicarus <pinicarus@protonmail.com>2020-10-03 10:16:04 +0200
committerpinicarus <pinicarus@protonmail.com>2020-10-03 10:16:04 +0200
commitd7557ef9be6ce680e811e31e217db5624d9e2897 (patch)
treea6e1073d28b877bfcd2597ca4f8c98be8a1d9066 /ale_linters/erlang
parentef145bda1c477dc8f95dc81ea2511805eadf4934 (diff)
downloadale-d7557ef9be6ce680e811e31e217db5624d9e2897.zip
refactor(erlang/dialyzer): simplify option handling
Diffstat (limited to 'ale_linters/erlang')
-rw-r--r--ale_linters/erlang/dialyzer.vim14
1 files changed, 5 insertions, 9 deletions
diff --git a/ale_linters/erlang/dialyzer.vim b/ale_linters/erlang/dialyzer.vim
index e27f8127..41898d9c 100644
--- a/ale_linters/erlang/dialyzer.vim
+++ b/ale_linters/erlang/dialyzer.vim
@@ -4,7 +4,11 @@
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', '')
+\ get(g:, 'ale_erlang_dialyzer_options', '-Wunmatched_returns'
+\ . ' -Werror_handling'
+\ . ' -Wrace_conditions'
+\ . ' -Wunderspecs'
+\ . ' %s')
let g:ale_erlang_dialyzer_plt_file =
\ get(g:, 'ale_erlang_dialyzer_plt_file', '')
let g:ale_erlang_dialyzer_rebar3_profile =
@@ -51,14 +55,6 @@ 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))