diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-08-16 14:10:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-16 14:10:21 +0100 |
commit | faaa11567a487c4d9752df24eadf00d314da5d2a (patch) | |
tree | 6edca488a5c4952ce36f78ad3b01f7963c8c1e67 | |
parent | 9cdd8b67b2f52a2dd348ffb13a7fc1b2dcf84416 (diff) | |
parent | 88ffdb47368c7bbfd72e643861f5f5a4663c1fb9 (diff) | |
download | ale-faaa11567a487c4d9752df24eadf00d314da5d2a.zip |
Merge pull request #1818 from tyru/add-go-govet-options
Add ale_go_govet_options variable
-rw-r--r-- | ale_linters/go/govet.vim | 4 | ||||
-rw-r--r-- | doc/ale-go.txt | 11 | ||||
-rw-r--r-- | doc/ale.txt | 1 | ||||
-rw-r--r-- | test/command_callback/test_govet_command_callback.vader | 4 |
4 files changed, 20 insertions, 0 deletions
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 <jae@zhar.net> " 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 @@ -45,6 +45,17 @@ g:ale_go_gofmt_options *g:ale_go_gofmt_options* =============================================================================== +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` is a `lint_file` linter, which only lints files that are 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' |