Change default of go_staticcheck_lint_package to 1 (#3799)

Fixes https://github.com/dense-analysis/ale/issues/3798.
This commit is contained in:
Yuxuan 'fishy' Wang 2021-07-03 02:40:01 -07:00 committed by GitHub
parent 49bdbc3ba5
commit b749ec702a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -3,7 +3,7 @@
call ale#Set('go_staticcheck_executable', 'staticcheck') call ale#Set('go_staticcheck_executable', 'staticcheck')
call ale#Set('go_staticcheck_options', '') call ale#Set('go_staticcheck_options', '')
call ale#Set('go_staticcheck_lint_package', 0) call ale#Set('go_staticcheck_lint_package', 1)
call ale#Set('go_staticcheck_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('go_staticcheck_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#go#staticcheck#GetCommand(buffer) abort function! ale_linters#go#staticcheck#GetCommand(buffer) abort

View File

@ -14,7 +14,7 @@ After:
Execute(The staticcheck callback should return the right defaults): Execute(The staticcheck callback should return the right defaults):
AssertLinterCwd '%s:h' AssertLinterCwd '%s:h'
AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' %s:t' AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' .'
Execute(staticcheck should be found in GOPATH): Execute(staticcheck should be found in GOPATH):
" This is a directory with a fake executable " This is a directory with a fake executable
@ -23,27 +23,27 @@ Execute(staticcheck should be found in GOPATH):
AssertLinter AssertLinter
\ ale#test#GetFilename('../test-files/go/gopath/bin/staticcheck'), \ ale#test#GetFilename('../test-files/go/gopath/bin/staticcheck'),
\ ale#Escape(ale#test#GetFilename('../test-files/go/gopath/bin/staticcheck')) \ ale#Escape(ale#test#GetFilename('../test-files/go/gopath/bin/staticcheck'))
\ . ' %s:t' \ . ' .'
Execute(The staticcheck callback should use configured options): Execute(The staticcheck callback should use configured options):
let b:ale_go_staticcheck_options = '-test' let b:ale_go_staticcheck_options = '-test'
AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' -test %s:t' AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' -test .'
Execute(The staticcheck `lint_package` option should use the correct command): Execute(Unset the staticcheck `lint_package` option should use the correct command):
let b:ale_go_staticcheck_lint_package = 1 let b:ale_go_staticcheck_lint_package = 0
AssertLinterCwd '%s:h' AssertLinterCwd '%s:h'
AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' .' AssertLinter 'staticcheck', ale#Escape('staticcheck') . ' %s:t'
Execute(The staticcheck callback should use the `GO111MODULE` option if set): Execute(The staticcheck callback should use the `GO111MODULE` option if set):
let b:ale_go_go111module = 'off' let b:ale_go_go111module = 'off'
AssertLinter 'staticcheck', AssertLinter 'staticcheck',
\ ale#Env('GO111MODULE', 'off') . ale#Escape('staticcheck') . ' %s:t' \ ale#Env('GO111MODULE', 'off') . ale#Escape('staticcheck') . ' .'
" Test with lint_package option set " Test with lint_package option set
let b:ale_go_staticcheck_lint_package = 1 let b:ale_go_staticcheck_lint_package = 0
AssertLinter 'staticcheck', AssertLinter 'staticcheck',
\ ale#Env('GO111MODULE', 'off') . ale#Escape('staticcheck') . ' .' \ ale#Env('GO111MODULE', 'off') . ale#Escape('staticcheck') . ' %s:t'