|
1 | 1 | Before:
|
2 | 2 | call ale#assert#SetUpLinterTest('vim', 'vint')
|
3 |
| - let b:command_tail = (has('nvim') ? ' --enable-neovim' : '') |
4 |
| - \ . ' -f "{file_path}:{line_number}:{column_number}: {severity}: {policy_name} - {description} (see {reference})" %t' |
| 3 | + let b:common_flags = (has('nvim') ? ' --enable-neovim' : '') |
| 4 | + \ . ' -f "{file_path}:{line_number}:{column_number}: {severity}: {policy_name} - {description} (see {reference})"' |
5 | 5 |
|
6 | 6 | After:
|
7 |
| - unlet! b:bin_dir |
8 |
| - unlet! b:executable |
| 7 | + unlet! b:common_flags |
| 8 | + |
9 | 9 | call ale#assert#TearDownLinterTest()
|
10 | 10 |
|
11 | 11 | Execute(The default command should be correct):
|
12 | 12 | AssertLinter 'vint', [
|
13 | 13 | \ ale#Escape('vint') .' --version',
|
14 |
| - \ ale#Escape('vint') .' -s --no-color' . b:command_tail, |
| 14 | + \ ale#Escape('vint') .' -s --no-color' . b:common_flags . ' %t', |
15 | 15 | \]
|
16 | 16 |
|
17 | 17 | Execute(The executable should be configurable):
|
18 | 18 | let g:ale_vim_vint_executable = 'foobar'
|
19 | 19 |
|
20 | 20 | AssertLinter 'foobar', [
|
21 | 21 | \ ale#Escape('foobar') .' --version',
|
22 |
| - \ ale#Escape('foobar') .' -s --no-color' . b:command_tail, |
| 22 | + \ ale#Escape('foobar') .' -s --no-color' . b:common_flags . ' %t', |
23 | 23 | \]
|
| 24 | + |
| 25 | +Execute(The --no-color flag should not be used for older Vint versions): |
| 26 | + GivenCommandOutput ['v0.3.5'] |
| 27 | + |
| 28 | + AssertLinter 'vint', ale#Escape('vint') .' -s' . b:common_flags . ' %t' |
| 29 | + |
| 30 | +Execute(--stdin-display-name should be used in newer versions): |
| 31 | + GivenCommandOutput ['v0.4.0'] |
| 32 | + |
| 33 | + AssertLinter 'vint', ale#Escape('vint') .' -s --no-color' . b:common_flags |
| 34 | + \ . ' --stdin-display-name %s -' |
0 commit comments