]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/fixers/test_golangci_lint_fixer_callback.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

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.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Do not set EDITOR/VISUAL for shell
[etc/vim.git] / .vim / bundle / ale / test / fixers / test_golangci_lint_fixer_callback.vader
1 Before:
2   Save g:ale_go_go111module
3   Save g:ale_go_golangci_lint_executable
4   Save g:ale_go_golangci_lint_options
5   Save g:ale_go_golangci_lint_package
6
7   " Use an invalid global executable, so we don't match it.
8   let g:ale_go_golangci_lint_executable = 'xxxinvalid'
9   let g:ale_go_golangci_lint_options = ''
10
11   call ale#test#SetDirectory('/testplugin/test/fixers')
12   call ale#test#SetFilename('../test-files/go/testfile.go')
13 After:
14   Restore
15
16   unlet! b:ale_go_go111module
17
18   call ale#test#RestoreDirectory()
19
20 Execute(The golangci-lint callback should return the correct default values):
21
22   AssertEqual
23   \ {
24   \   'command': ale#Escape('xxxinvalid') . ' run  --fix',
25   \ },
26   \ ale#fixers#golangci_lint#Fix(bufnr(''))
27
28 Execute(The golangci-lint callback should include custom golangci-lint options):
29   let g:ale_go_golangci_lint_options = "--new --config /dev/null"
30
31   AssertEqual
32   \ {
33   \   'command': ale#Escape('xxxinvalid')
34   \     . ' run ' . g:ale_go_golangci_lint_options . ' --fix',
35   \ },
36   \ ale#fixers#golangci_lint#Fix(bufnr(''))
37
38 Execute(The golangci-lint callback should support per-file mode):
39   let g:ale_go_golangci_lint_package = 0
40
41   AssertEqual
42   \ {
43   \   'command': ale#Escape('xxxinvalid')
44   \     . ' run '
45   \     . g:ale_go_golangci_lint_options
46   \     . ' --fix ' . ale#Escape('testfile.go'),
47   \ },
48   \ ale#fixers#golangci_lint#Fix(bufnr(''))