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_gopls_fix_executable
3 Save g:ale_go_gopls_fix_options
4 Save g:ale_go_go111module
6 " Use an invalid global executable, so we don't match it.
7 let g:ale_go_gopls_fix_executable = 'xxxinvalid'
8 let g:ale_go_gopls_fix_options = ''
10 call ale#test#SetDirectory('/testplugin/test/fixers')
11 call ale#test#SetFilename('../test-files/go/testfile.go')
16 unlet! b:ale_go_go111module
18 call ale#test#RestoreDirectory()
20 Execute(The gopls callback should return 0 when the executable isn't executable):
23 \ ale#fixers#gopls#Fix(bufnr(''))
25 Execute(The gopls callback should the command when the executable test passes):
26 let g:ale_go_gopls_fix_executable = has('win32') ? 'cmd' : 'echo'
30 \ 'read_temporary_file': 1,
31 \ 'command': ale#Escape(g:ale_go_gopls_fix_executable) . ' format -l -w %t'
33 \ ale#fixers#gopls#Fix(bufnr(''))
35 Execute(The gopls callback should include extra options):
36 let g:ale_go_gopls_fix_executable = has('win32') ? 'cmd' : 'echo'
37 let g:ale_go_gopls_fix_options = '--xxx'
41 \ 'read_temporary_file': 1,
42 \ 'command': ale#Escape(g:ale_go_gopls_fix_executable) . ' format --xxx -l -w %t'
44 \ ale#fixers#gopls#Fix(bufnr(''))
46 Execute(The gopls callback should support Go environment variables):
47 let g:ale_go_gopls_fix_executable = has('win32') ? 'cmd' : 'echo'
48 let g:ale_go_go111module = 'on'
52 \ 'read_temporary_file': 1,
53 \ 'command': ale#Env('GO111MODULE', 'on')
54 \ . ale#Escape(g:ale_go_gopls_fix_executable)
55 \ . ' format -l -w %t'
57 \ ale#fixers#gopls#Fix(bufnr(''))