2017-07-06 23:10:30 +00:00
|
|
|
Before:
|
2019-08-02 08:09:10 +00:00
|
|
|
Save g:ale_go_go111module
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('go', 'gometalinter')
|
2017-07-06 23:10:30 +00:00
|
|
|
call ale#test#SetFilename('test.go')
|
|
|
|
|
|
|
|
After:
|
2019-08-02 08:09:10 +00:00
|
|
|
Restore
|
|
|
|
|
|
|
|
unlet! b:ale_go_go111module
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2017-07-06 23:10:30 +00:00
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
Execute(The gometalinter defaults should be correct):
|
|
|
|
AssertLinter 'gometalinter',
|
2020-08-28 16:46:43 +00:00
|
|
|
\ ale#path#BufferCdString(bufnr(''))
|
2017-12-04 18:42:36 +00:00
|
|
|
\ . ale#Escape('gometalinter')
|
|
|
|
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(expand('%' . ':t')))
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . ' .'
|
2017-07-06 23:10:30 +00:00
|
|
|
|
|
|
|
Execute(The gometalinter callback should use a configured executable):
|
|
|
|
let b:ale_go_gometalinter_executable = 'something else'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'something else',
|
2020-08-28 16:46:43 +00:00
|
|
|
\ ale#path#BufferCdString(bufnr(''))
|
2017-12-04 18:42:36 +00:00
|
|
|
\ . ale#Escape('something else')
|
|
|
|
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(expand('%' . ':t')))
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . ' .'
|
2017-07-06 23:10:30 +00:00
|
|
|
|
|
|
|
Execute(The gometalinter callback should use configured options):
|
|
|
|
let b:ale_go_gometalinter_options = '--foobar'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'gometalinter',
|
2020-08-28 16:46:43 +00:00
|
|
|
\ ale#path#BufferCdString(bufnr(''))
|
2017-12-04 18:42:36 +00:00
|
|
|
\ . ale#Escape('gometalinter')
|
|
|
|
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(expand('%' . ':t')))
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . ' --foobar' . ' .'
|
2017-12-04 18:42:36 +00:00
|
|
|
|
2019-04-11 02:25:06 +00:00
|
|
|
Execute(The gometalinter should use configured environment variables):
|
|
|
|
let b:ale_go_go111module = 'off'
|
2019-08-02 08:09:10 +00:00
|
|
|
|
2019-04-11 02:25:06 +00:00
|
|
|
AssertLinter 'gometalinter',
|
2020-08-28 16:46:43 +00:00
|
|
|
\ ale#path#BufferCdString(bufnr(''))
|
2019-04-11 02:25:06 +00:00
|
|
|
\ . ale#Env('GO111MODULE', 'off')
|
|
|
|
\ . ale#Escape('gometalinter')
|
|
|
|
\ . ' --include=' . ale#Escape(ale#util#EscapePCRE(expand('%' . ':t')))
|
|
|
|
\ . ' .'
|
|
|
|
|
2017-12-04 18:42:36 +00:00
|
|
|
Execute(The gometalinter `lint_package` option should use the correct command):
|
|
|
|
let b:ale_go_gometalinter_lint_package = 1
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'gometalinter',
|
2020-08-28 16:46:43 +00:00
|
|
|
\ ale#path#BufferCdString(bufnr(''))
|
2018-07-15 17:24:53 +00:00
|
|
|
\ . ale#Escape('gometalinter') . ' .'
|