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
4 call ale#assert#SetUpLinterTest('go', 'golangci_lint')
5 call ale#test#SetFilename('test.go')
7 " Test with version 1.64.8 by default
8 GivenCommandOutput ['golangci-lint has version 1.64.8 built with go1.23.0']
13 unlet! b:ale_go_go111module
15 call ale#assert#TearDownLinterTest()
17 Execute(The golangci-lint defaults should be correct):
18 AssertLinterCwd '%s:h',
19 AssertLinter 'golangci-lint',
20 \ ale#Escape('golangci-lint') . ' run --out-format=json --show-stats=0'
22 Execute(The golangci-lint defaults should be correct with no version info):
24 AssertLinterCwd '%s:h',
25 AssertLinter 'golangci-lint',
26 \ ale#Escape('golangci-lint') . ' run --out-format=json --show-stats=0'
28 Execute(The golangci-lint defaults should be correct with version 2):
29 GivenCommandOutput ['golangci-lint has version 2.0.2 built with go1.24.0']
30 AssertLinterCwd '%s:h',
31 AssertLinter 'golangci-lint',
32 \ ale#Escape('golangci-lint') . ' run --output.json.path stdout --output.text.path stderr --show-stats=0'
34 Execute(The golangci-lint callback should use a configured executable):
35 let b:ale_go_golangci_lint_executable = 'something else'
37 AssertLinter 'something else',
38 \ ale#Escape('something else')
39 \ . ' run --out-format=json --show-stats=0'
41 Execute(The golangci-lint callback should use a configured version 2 executable):
42 GivenCommandOutput ['golangci-lint has version 2.0.0 built with go1.22.0']
43 let b:ale_go_golangci_lint_executable = 'something else'
45 AssertLinter 'something else',
46 \ ale#Escape('something else')
47 \ . ' run --output.json.path stdout --output.text.path stderr --show-stats=0'
49 Execute(The golangci-lint callback should use configured options):
50 let b:ale_go_golangci_lint_options = '--foobar'
52 AssertLinter 'golangci-lint',
53 \ ale#Escape('golangci-lint')
56 \ . '--out-format=json '
59 Execute(The golangci-lint callback should support environment variables):
60 let b:ale_go_go111module = 'on'
62 AssertLinter 'golangci-lint',
63 \ ale#Env('GO111MODULE', 'on')
64 \ . ale#Escape('golangci-lint')
66 \ . '--out-format=json '
69 Execute(The golangci-lint `lint_package` option should use the correct command):
70 let b:ale_go_golangci_lint_package = 0
71 AssertLinter 'golangci-lint',
72 \ ale#Escape('golangci-lint')
73 \ . ' run ' . ale#Escape(expand('%' . ':t'))
74 \ . ' --out-format=json --show-stats=0'