blob: d32780e6ae41fe7b873b1c107081ce86846b4986 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
Before:
call ale#assert#SetUpLinterTest('php', 'psalm')
After:
unlet! g:i
unlet! g:matched
if isdirectory(g:dir . '/.git')
call delete(g:dir . '/.git', 'd')
endif
call ale#assert#TearDownLinterTest()
Execute(The default executable path should be correct):
AssertLinter 'psalm',
\ ale#Escape('psalm') . ' --language-server'
Execute(Vendor executables should be detected):
call ale#test#SetFilename('psalm-project/test.php')
AssertLinter
\ ale#path#Simplify(g:dir . '/psalm-project/vendor/bin/psalm'),
\ ale#Escape(ale#path#Simplify(
\ g:dir
\ . '/psalm-project/vendor/bin/psalm'
\ )) . ' --language-server'
let g:ale_php_psalm_use_global = 1
AssertLinter 'psalm',
\ ale#Escape('psalm') . ' --language-server'
Execute(User provided options should be used):
let g:ale_php_psalm_options = '--my-user-provided-option my-value'
AssertLinter 'psalm',
\ ale#Escape('psalm')
\ . ' --language-server --my-user-provided-option my-value'
Execute(The project path should be correct for .git directories):
call ale#test#SetFilename('psalm-project/test.php')
let g:matched = 0
for g:i in range(4)
if !isdirectory(g:dir . '/.git')
call mkdir(g:dir . '/.git')
endif
try
AssertLSPProject g:dir
catch /.+/
endtry
let g:matched = 1
break
endfor
if !g:matched
AssertLSPProject g:dir
endif
|