Add support for Erlang dialyzer (#2509)

* Add support for Erlang dialyzer
* Add an option to specify rebar3 profile

In doing so, the use of the `**` wildcard becomes unnecessary.
This commit is contained in:
Antoine Gagné
2019-05-19 16:16:17 -04:00
committed by w0rp
parent 652d991077
commit 3b7c86e401
5 changed files with 187 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
Before:
call ale#assert#SetUpLinterTest('erlang', 'dialyzer')
After:
call ale#assert#TearDownLinterTest()
Execute(The default command should be correct.):
AssertLinter 'dialyzer',
\ ale#Escape('dialyzer')
\ . ' -n --plt ' . ale#Escape(expand('$HOME/.dialyzer_plt'))
\ . ' -Wunmatched_returns'
\ . ' -Werror_handling'
\ . ' -Wrace_conditions'
\ . ' -Wunderspecs'
\ . ' %s'
Execute(The command should accept configured executable.):
let b:ale_erlang_dialyzer_executable = '/usr/bin/dialyzer'
AssertLinter '/usr/bin/dialyzer',
\ ale#Escape('/usr/bin/dialyzer')
\ . ' -n --plt ' . ale#Escape(expand('$HOME/.dialyzer_plt'))
\ . ' -Wunmatched_returns'
\ . ' -Werror_handling'
\ . ' -Wrace_conditions'
\ . ' -Wunderspecs'
\ . ' %s'
Execute(The command should accept configured PLT file.):
let b:ale_erlang_dialyzer_plt_file = 'custom-plt'
AssertLinter 'dialyzer',
\ ale#Escape('dialyzer')
\ . ' -n --plt ' . ale#Escape(expand('custom-plt'))
\ . ' -Wunmatched_returns'
\ . ' -Werror_handling'
\ . ' -Wrace_conditions'
\ . ' -Wunderspecs'
\ . ' %s'