diff options
author | w0rp <w0rp@users.noreply.github.com> | 2020-08-17 23:37:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-17 23:37:23 +0100 |
commit | bc6304bdb0361b3236222cf857427a924c9e2c4d (patch) | |
tree | 05eeb3779c913608850f58597480ded3a03d2f78 /test/command_callback | |
parent | ac56574b55a11a8a921bb5169dd4dd3a7348aeeb (diff) | |
parent | 2548763d04568823c4ef240f7f115adbb1dcfca2 (diff) | |
download | ale-bc6304bdb0361b3236222cf857427a924c9e2c4d.zip |
Merge pull request #3007 from klaaspieter/swift-format
Add Apple's swift-format as a linter
Diffstat (limited to 'test/command_callback')
-rw-r--r-- | test/command_callback/test_swift_swiftformat_command_callbacks.vader | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/command_callback/test_swift_swiftformat_command_callbacks.vader b/test/command_callback/test_swift_swiftformat_command_callbacks.vader new file mode 100644 index 00000000..7be20bf7 --- /dev/null +++ b/test/command_callback/test_swift_swiftformat_command_callbacks.vader @@ -0,0 +1,25 @@ +Before: + call ale#assert#SetUpLinterTest('swift', 'swiftformat') + +After: + call ale#assert#TearDownLinterTest() + +Execute(Should use default command when not in a swift package): + call ale#test#SetFilename('../swift-test-files/non-swift-package-project/src/folder/dummy.swift') + + AssertLinter 'swift-format', + \ ale#Escape('swift-format') . ' --mode lint %t' + +Execute(Should use swift run when in a swift package): + call ale#test#SetFilename('../swift-test-files/swift-package-project/src/folder/dummy.swift') + + AssertLinter 'swift', + \ ale#Escape('swift') . ' run swift-format --mode lint %t' + +Execute(Should let users configure a global executable and override local paths): + call ale#test#SetFilename('../swift-test-files/swift-package-project/src/folder/dummy.swift') + + let g:ale_swift_swiftformat_executable = '/path/to/custom/swift-format' + + AssertLinter '/path/to/custom/swift-format', + \ ale#Escape('/path/to/custom/swift-format') . ' --mode lint %t' |