This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/command_callback/test_golangci_lint_command_callback.vader

39 lines
1.2 KiB
Text
Raw Normal View History

2018-09-06 19:31:12 +00:00
Before:
call ale#assert#SetUpLinterTest('go', 'golangci_lint')
call ale#test#SetFilename('test.go')
After:
call ale#assert#TearDownLinterTest()
Execute(The golangci-lint defaults should be correct):
AssertLinter 'golangci-lint',
2018-10-23 14:20:27 +00:00
\ ale#path#CdString(expand('%:p:h'))
2018-09-06 19:31:12 +00:00
\ . ale#Escape('golangci-lint')
2018-09-14 08:47:33 +00:00
\ . ' run ' . ale#Escape(expand('%' . ':t'))
2018-09-06 19:31:12 +00:00
\ . ' --enable-all'
Execute(The golangci-lint callback should use a configured executable):
let b:ale_go_golangci_lint_executable = 'something else'
AssertLinter 'something else',
2018-10-23 14:20:27 +00:00
\ ale#path#CdString(expand('%:p:h'))
2018-09-06 19:31:12 +00:00
\ . ale#Escape('something else')
2018-09-14 08:47:33 +00:00
\ . ' run ' . ale#Escape(expand('%' . ':t'))
2018-09-06 19:31:12 +00:00
\ . ' --enable-all'
Execute(The golangci-lint callback should use configured options):
let b:ale_go_golangci_lint_options = '--foobar'
AssertLinter 'golangci-lint',
2018-10-23 14:20:27 +00:00
\ ale#path#CdString(expand('%:p:h'))
2018-09-06 19:31:12 +00:00
\ . ale#Escape('golangci-lint')
2018-09-14 08:47:33 +00:00
\ . ' run ' . ale#Escape(expand('%' . ':t'))
2018-09-06 19:31:12 +00:00
\ . ' --foobar'
Execute(The golangci-lint `lint_package` option should use the correct command):
let b:ale_go_golangci_lint_package = 1
AssertLinter 'golangci-lint',
2018-10-23 14:20:27 +00:00
\ ale#path#CdString(expand('%:p:h'))
2018-09-06 19:31:12 +00:00
\ . ale#Escape('golangci-lint') . ' run --enable-all'