2018-04-08 17:10:00 +00:00
|
|
|
Before:
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#SetUpLinterTest('vim', 'vint')
|
2020-09-09 19:34:27 +00:00
|
|
|
let b:common_flags = (has('nvim') ? ' --enable-neovim' : '')
|
|
|
|
\ . ' -f "{file_path}:{line_number}:{column_number}: {severity}: {policy_name} - {description} (see {reference})"'
|
2018-04-08 17:10:00 +00:00
|
|
|
|
|
|
|
After:
|
2020-09-09 19:34:27 +00:00
|
|
|
unlet! b:common_flags
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
call ale#assert#TearDownLinterTest()
|
2018-04-08 17:10:00 +00:00
|
|
|
|
|
|
|
Execute(The default command should be correct):
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'vint', [
|
2018-04-08 17:10:00 +00:00
|
|
|
\ ale#Escape('vint') .' --version',
|
2020-09-09 19:34:27 +00:00
|
|
|
\ ale#Escape('vint') .' -s --no-color' . b:common_flags . ' %t',
|
2018-07-15 17:24:53 +00:00
|
|
|
\]
|
2018-04-08 17:10:00 +00:00
|
|
|
|
|
|
|
Execute(The executable should be configurable):
|
|
|
|
let g:ale_vim_vint_executable = 'foobar'
|
|
|
|
|
2018-07-15 17:24:53 +00:00
|
|
|
AssertLinter 'foobar', [
|
2018-04-08 17:10:00 +00:00
|
|
|
\ ale#Escape('foobar') .' --version',
|
2020-09-09 19:34:27 +00:00
|
|
|
\ ale#Escape('foobar') .' -s --no-color' . b:common_flags . ' %t',
|
2018-07-15 17:24:53 +00:00
|
|
|
\]
|
2020-09-09 19:34:27 +00:00
|
|
|
|
|
|
|
Execute(The --no-color flag should not be used for older Vint versions):
|
|
|
|
GivenCommandOutput ['v0.3.5']
|
|
|
|
|
|
|
|
AssertLinter 'vint', ale#Escape('vint') .' -s' . b:common_flags . ' %t'
|
|
|
|
|
|
|
|
Execute(--stdin-display-name should be used in newer versions):
|
|
|
|
GivenCommandOutput ['v0.4.0']
|
|
|
|
|
|
|
|
AssertLinter 'vint', ale#Escape('vint') .' -s --no-color' . b:common_flags
|
|
|
|
\ . ' --stdin-display-name %s -'
|