diff options
author | tyru <tyru.exe@gmail.com> | 2018-08-16 11:02:51 +0900 |
---|---|---|
committer | tyru <tyru.exe@gmail.com> | 2018-08-16 11:36:46 +0900 |
commit | 88ffdb47368c7bbfd72e643861f5f5a4663c1fb9 (patch) | |
tree | 6edca488a5c4952ce36f78ad3b01f7963c8c1e67 | |
parent | 9cdd8b67b2f52a2dd348ffb13a7fc1b2dcf84416 (diff) | |
download | ale-88ffdb47368c7bbfd72e643861f5f5a4663c1fb9.zip |
feat: 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' |