blob: 3dbae8ff5d43447ce317a35a4242e2d47c483210 (
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
|
Before:
call ale#assert#SetUpLinterTest('swift', 'appleswiftformat')
After:
call ale#assert#TearDownLinterTest()
Execute(Should use default command when use_swiftpm is not set):
call ale#test#SetFilename('../test-files/swift/non-swift-package-project/src/folder/dummy.swift')
let g:ale_swift_appleswiftformat_executable = 'swift-format'
let g:ale_swift_appleswiftformat_use_swiftpm = 0
AssertLinter 'swift-format', ale#Escape('swift-format') . ' lint %t'
Execute(Should use default command and available configuration when use_swiftpm is not set):
call ale#test#SetDirectory('/testplugin/test/test-files/swift/swift-package-project-with-config')
call ale#test#SetFilename('src/folder/dummy.swift')
let g:ale_swift_appleswiftformat_executable = 'swift-format'
let g:ale_swift_appleswiftformat_use_swiftpm = 0
AssertLinter 'swift-format',
\ ale#Escape('swift-format') . ' lint %t ' . '--configuration '
\ . glob(g:dir . '/.swift-format')
call ale#test#RestoreDirectory()
Execute(Should use swift run when use_swiftpm is set to 1):
call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
let g:ale_swift_appleswiftformat_use_swiftpm = 1
AssertLinter 'swift', ale#Escape('swift') . ' run swift-format lint %t'
Execute(Should use the provided global executable):
call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
let g:ale_swift_appleswiftformat_executable = '/path/to/custom/swift-format'
let g:ale_swift_appleswiftformat_use_swiftpm = 0
AssertLinter '/path/to/custom/swift-format',
\ ale#Escape('/path/to/custom/swift-format') . ' lint %t'
|