From 88ffdb47368c7bbfd72e643861f5f5a4663c1fb9 Mon Sep 17 00:00:00 2001 From: tyru Date: Thu, 16 Aug 2018 11:02:51 +0900 Subject: feat: add ale_go_govet_options variable --- ale_linters/go/govet.vim | 4 ++++ doc/ale-go.txt | 11 +++++++++++ doc/ale.txt | 1 + test/command_callback/test_govet_command_callback.vader | 4 ++++ 4 files changed, 20 insertions(+) diff --git a/ale_linters/go/govet.vim b/ale_linters/go/govet.vim index e94e6ecd..59fea499 100644 --- a/ale_linters/go/govet.vim +++ b/ale_linters/go/govet.vim @@ -4,8 +4,12 @@ " Author: John Eikenberry " Description: updated to work with go1.10 +call ale#Set('go_govet_options', '') + 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 .' + \ . (!empty(l:options) ? ' ' . l:options : '') endfunction call ale#linter#Define('go', { diff --git a/doc/ale-go.txt b/doc/ale-go.txt index 60d6cb84..baf403b7 100644 --- a/doc/ale-go.txt +++ b/doc/ale-go.txt @@ -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. +=============================================================================== +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* diff --git a/doc/ale.txt b/doc/ale.txt index 8af4c435..13184e84 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -90,6 +90,7 @@ CONTENTS *ale-contents* go....................................|ale-go-options| gobuild.............................|ale-go-gobuild| gofmt...............................|ale-go-gofmt| + govet...............................|ale-go-govet| gometalinter........................|ale-go-gometalinter| staticcheck.........................|ale-go-staticcheck| graphql...............................|ale-graphql-options| diff --git a/test/command_callback/test_govet_command_callback.vader b/test/command_callback/test_govet_command_callback.vader index a73118ae..3718e0a7 100644 --- a/test/command_callback/test_govet_command_callback.vader +++ b/test/command_callback/test_govet_command_callback.vader @@ -6,3 +6,7 @@ After: Execute(The default command should be correct): 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' -- cgit v1.2.3