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.
2 Save g:ale_go_go111module
5 let $GOPATH = '/non/existent/directory'
7 call ale#assert#SetUpLinterTest('go', 'staticcheck')
8 call ale#test#SetFilename('test.go')
11 unlet! b:ale_go_go111module
13 call ale#assert#TearDownLinterTest()
15 Execute(The staticcheck callback should return the right defaults):
16 AssertLinterCwd '%s:h'
17 AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' .'
19 Execute(staticcheck should be found in GOPATH):
20 " This is a directory with a fake executable
21 let $GOPATH = ale#test#GetFilename('../test-files/go/gopath')
24 \ ale#test#GetFilename('../test-files/go/gopath/bin/staticcheck'),
25 \ ale#Escape(ale#test#GetFilename('../test-files/go/gopath/bin/staticcheck'))
28 Execute(The staticcheck callback should use configured options):
29 let b:ale_go_staticcheck_options = '-test'
31 AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' -test .'
33 Execute(Unset the staticcheck `lint_package` option should use the correct command):
34 let b:ale_go_staticcheck_lint_package = 0
36 AssertLinterCwd '%s:h'
37 AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' %s:t'
39 Execute(The staticcheck callback should use the `GO111MODULE` option if set):
40 let b:ale_go_go111module = 'off'
42 AssertLinter 'staticcheck',
43 \ ale#Env('GO111MODULE', 'off') . ale#Escape('staticcheck') . ' .'
45 " Test with lint_package option set
46 let b:ale_go_staticcheck_lint_package = 0
48 AssertLinter 'staticcheck',
49 \ ale#Env('GO111MODULE', 'off') . ale#Escape('staticcheck') . ' %s:t'