mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Some checks failed
CI / build_image (push) Has been cancelled
CI / test_ale (--linters-only) (push) Has been cancelled
CI / test_ale (--neovim-06-only) (push) Has been cancelled
CI / test_ale (--neovim-08-only) (push) Has been cancelled
CI / test_ale (--vim-80-only) (push) Has been cancelled
CI / test_ale (--vim-90-only) (push) Has been cancelled
Closes #4616
49 lines
1.3 KiB
Plaintext
49 lines
1.3 KiB
Plaintext
Before:
|
|
Save g:ale_go_go111module
|
|
Save g:ale_go_golangci_lint_executable
|
|
Save g:ale_go_golangci_lint_options
|
|
Save g:ale_go_golangci_lint_package
|
|
|
|
" Use an invalid global executable, so we don't match it.
|
|
let g:ale_go_golangci_lint_executable = 'xxxinvalid'
|
|
let g:ale_go_golangci_lint_options = ''
|
|
|
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
|
call ale#test#SetFilename('../test-files/go/testfile.go')
|
|
After:
|
|
Restore
|
|
|
|
unlet! b:ale_go_go111module
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
Execute(The golangci-lint callback should return the correct default values):
|
|
|
|
AssertEqual
|
|
\ {
|
|
\ 'command': ale#Escape('xxxinvalid') . ' run --fix',
|
|
\ },
|
|
\ ale#fixers#golangci_lint#Fix(bufnr(''))
|
|
|
|
Execute(The golangci-lint callback should include custom golangci-lint options):
|
|
let g:ale_go_golangci_lint_options = "--new --config /dev/null"
|
|
|
|
AssertEqual
|
|
\ {
|
|
\ 'command': ale#Escape('xxxinvalid')
|
|
\ . ' run ' . g:ale_go_golangci_lint_options . ' --fix',
|
|
\ },
|
|
\ ale#fixers#golangci_lint#Fix(bufnr(''))
|
|
|
|
Execute(The golangci-lint callback should support per-file mode):
|
|
let g:ale_go_golangci_lint_package = 0
|
|
|
|
AssertEqual
|
|
\ {
|
|
\ 'command': ale#Escape('xxxinvalid')
|
|
\ . ' run '
|
|
\ . g:ale_go_golangci_lint_options
|
|
\ . ' --fix ' . ale#Escape('testfile.go'),
|
|
\ },
|
|
\ ale#fixers#golangci_lint#Fix(bufnr(''))
|