mirror of
https://github.com/dense-analysis/ale
synced 2024-12-25 23:52:22 +00:00
1c5b84f375
* Refactor erlang_ls linter tests * Add Rebar3 _checkouts support for erlang_ls linter * Add Erlang.mk support for erlang_ls linter
71 lines
2.4 KiB
Plaintext
71 lines
2.4 KiB
Plaintext
Before:
|
|
call ale#assert#SetUpLinterTest('erlang', 'erlang_ls')
|
|
|
|
After:
|
|
unlet! b:root
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(The default command should be correct):
|
|
AssertLinter 'erlang_ls',
|
|
\ ale#Escape('erlang_ls') . ' --log-level=' . ale#Escape('info')
|
|
|
|
Execute(Executable should be configurable):
|
|
let b:ale_erlang_erlang_ls_executable = '/path/to/erlang_ls'
|
|
|
|
AssertLinter '/path/to/erlang_ls',
|
|
\ ale#Escape('/path/to/erlang_ls') . ' --log-level=' . ale#Escape('info')
|
|
|
|
Execute(Log level should be configurable):
|
|
let b:ale_erlang_erlang_ls_log_level = 'debug'
|
|
|
|
AssertLinter 'erlang_ls',
|
|
\ ale#Escape('erlang_ls') . ' --log-level=' . ale#Escape('debug')
|
|
|
|
Execute(Log directory should be configurable):
|
|
let b:ale_erlang_erlang_ls_log_dir = '/path/to/logs'
|
|
|
|
AssertLinter 'erlang_ls',
|
|
\ ale#Escape('erlang_ls')
|
|
\ . ' --log-dir=' . ale#Escape('/path/to/logs')
|
|
\ . ' --log-level=' . ale#Escape('info')
|
|
|
|
Execute(Project root should be detected using erlang_ls.config):
|
|
let b:root = '../test-files/erlang/app_with_erlang_ls_config'
|
|
|
|
call ale#test#SetFilename(b:root . '/src/app.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|
|
|
|
call ale#test#SetFilename(b:root . '/_build/default/lib/dep/src/dep.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|
|
|
|
call ale#test#SetFilename(b:root . '/deps/dep/src/dep.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|
|
|
|
Execute(Root of Rebar3 project should be detected):
|
|
let b:root = '../test-files/erlang/rebar3_app'
|
|
|
|
call ale#test#SetFilename(b:root . '/src/app.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|
|
|
|
call ale#test#SetFilename(b:root . '/_build/default/lib/dep/src/dep.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|
|
|
|
call ale#test#SetFilename(b:root . '/_checkouts/dep/src/dep.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|
|
|
|
Execute(Root of Erlang.mk project should be detected):
|
|
let b:root = '../test-files/erlang/erlang_mk_app'
|
|
|
|
call ale#test#SetFilename(b:root . '/src/app.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|
|
|
|
call ale#test#SetFilename(b:root . '/deps/dep/src/dep.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|
|
|
|
Execute(Root of kerl managed Erlang/OTP installation should be detected):
|
|
let b:root = '../test-files/erlang/kerl_otp_root'
|
|
|
|
call ale#test#SetFilename(b:root . '/lib/stdlib-4.1.1/array.erl')
|
|
AssertLSPProject ale#test#GetFilename(b:root)
|