feat: add ale_go_govet_options variable
This commit is contained in:
parent
9cdd8b67b2
commit
88ffdb4736
@ -4,8 +4,12 @@
|
|||||||
" Author: John Eikenberry <jae@zhar.net>
|
" Author: John Eikenberry <jae@zhar.net>
|
||||||
" Description: updated to work with go1.10
|
" Description: updated to work with go1.10
|
||||||
|
|
||||||
|
call ale#Set('go_govet_options', '')
|
||||||
|
|
||||||
function! ale_linters#go#govet#GetCommand(buffer) abort
|
function! ale_linters#go#govet#GetCommand(buffer) abort
|
||||||
|
let l:options = ale#Var(a:buffer, 'go_govet_options')
|
||||||
return ale#path#BufferCdString(a:buffer) . ' go vet .'
|
return ale#path#BufferCdString(a:buffer) . ' go vet .'
|
||||||
|
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
call ale#linter#Define('go', {
|
call ale#linter#Define('go', {
|
||||||
|
@ -44,6 +44,17 @@ g:ale_go_gofmt_options *g:ale_go_gofmt_options*
|
|||||||
This variable can be set to pass additional options to the gofmt fixer.
|
This variable can be set to pass additional options to the gofmt fixer.
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
govet *ale-go-govet*
|
||||||
|
|
||||||
|
g:ale_go_govet_options *g:ale_go_govet_options*
|
||||||
|
*b:ale_go_govet_options*
|
||||||
|
Type: |String|
|
||||||
|
Default: `''`
|
||||||
|
|
||||||
|
This variable can be set to pass additional options to the go vet linter.
|
||||||
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
gometalinter *ale-go-gometalinter*
|
gometalinter *ale-go-gometalinter*
|
||||||
|
|
||||||
|
@ -90,6 +90,7 @@ CONTENTS *ale-contents*
|
|||||||
go....................................|ale-go-options|
|
go....................................|ale-go-options|
|
||||||
gobuild.............................|ale-go-gobuild|
|
gobuild.............................|ale-go-gobuild|
|
||||||
gofmt...............................|ale-go-gofmt|
|
gofmt...............................|ale-go-gofmt|
|
||||||
|
govet...............................|ale-go-govet|
|
||||||
gometalinter........................|ale-go-gometalinter|
|
gometalinter........................|ale-go-gometalinter|
|
||||||
staticcheck.........................|ale-go-staticcheck|
|
staticcheck.........................|ale-go-staticcheck|
|
||||||
graphql...............................|ale-graphql-options|
|
graphql...............................|ale-graphql-options|
|
||||||
|
@ -6,3 +6,7 @@ After:
|
|||||||
|
|
||||||
Execute(The default command should be correct):
|
Execute(The default command should be correct):
|
||||||
AssertLinter 'go', 'cd ' . ale#Escape(expand('%:p:h')) . ' && go vet .'
|
AssertLinter 'go', 'cd ' . ale#Escape(expand('%:p:h')) . ' && go vet .'
|
||||||
|
|
||||||
|
Execute(Extra options should be supported):
|
||||||
|
let g:ale_go_govet_options = '--foo-bar'
|
||||||
|
AssertLinter 'go', 'cd ' . ale#Escape(expand('%:p:h')) . ' && go vet . --foo-bar'
|
||||||
|
Loading…
Reference in New Issue
Block a user