]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_swift_appleswiftformat.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / ale / test / linter / test_swift_appleswiftformat.vader
1 Before:
2   call ale#assert#SetUpLinterTest('swift', 'appleswiftformat')
3
4 After:
5   call ale#assert#TearDownLinterTest()
6
7 Execute(Should use default command when use_swiftpm is not set):
8   call ale#test#SetFilename('../test-files/swift/non-swift-package-project/src/folder/dummy.swift')
9
10   let g:ale_swift_appleswiftformat_executable = 'swift-format'
11   let g:ale_swift_appleswiftformat_use_swiftpm = 0
12
13   AssertLinter 'swift-format', ale#Escape('swift-format') . ' lint %t'
14
15 Execute(Should use default command and available configuration when use_swiftpm is not set):
16   call ale#test#SetDirectory('/testplugin/test/test-files/swift/swift-package-project-with-config')
17   call ale#test#SetFilename('src/folder/dummy.swift')
18
19   let g:ale_swift_appleswiftformat_executable = 'swift-format'
20   let g:ale_swift_appleswiftformat_use_swiftpm = 0
21
22   AssertLinter 'swift-format',
23   \ ale#Escape('swift-format') . ' lint %t ' . '--configuration '
24   \   . glob(g:dir . '/.swift-format')
25
26   call ale#test#RestoreDirectory()
27
28 Execute(Should use swift run when use_swiftpm is set to 1):
29   call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
30
31   let g:ale_swift_appleswiftformat_use_swiftpm = 1
32
33   AssertLinter 'swift', ale#Escape('swift') . ' run swift-format lint %t'
34
35 Execute(Should use the provided global executable):
36   call ale#test#SetFilename('../test-files/swift/swift-package-project/src/folder/dummy.swift')
37
38   let g:ale_swift_appleswiftformat_executable = '/path/to/custom/swift-format'
39   let g:ale_swift_appleswiftformat_use_swiftpm = 0
40
41   AssertLinter '/path/to/custom/swift-format',
42   \ ale#Escape('/path/to/custom/swift-format') . ' lint %t'