summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormostfunkyduck <mostfunkyduck@protonmail.com>2020-05-25 11:46:16 -0400
committermostfunkyduck <mostfunkyduck@protonmail.com>2020-05-25 11:46:16 -0400
commit35c7c297b60ba8b8296ebccb6b1b09f8ab208de4 (patch)
treeecf7404b711e4307edccf7f18211229f5d6f0db2
parent7265ceb6d050d1a4642741d248f11e4f2abd37e1 (diff)
downloadale-35c7c297b60ba8b8296ebccb6b1b09f8ab208de4.zip
Fixes govet linter for go 1.13+, with tests
-rw-r--r--autoload/ale/handlers/go.vim5
-rw-r--r--test/handler/test_go_generic_handler.vader16
2 files changed, 20 insertions, 1 deletions
diff --git a/autoload/ale/handlers/go.vim b/autoload/ale/handlers/go.vim
index f17cd862..c969669d 100644
--- a/autoload/ale/handlers/go.vim
+++ b/autoload/ale/handlers/go.vim
@@ -6,9 +6,12 @@
"
" Author: Ben Paxton <ben@gn32.uk>
" Description: moved to generic Golang file from govet
+"
+" Author: mostfunkyduck <mostfunkyduck@protonmail.com>
+" Description: updated to work with go 1.14
function! ale#handlers#go#Handler(buffer, lines) abort
- let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? ?(.+)$'
+ let l:pattern = '\v^%(vet: )?([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? ?(.+)$'
let l:output = []
let l:dir = expand('#' . a:buffer . ':p:h')
diff --git a/test/handler/test_go_generic_handler.vader b/test/handler/test_go_generic_handler.vader
index 624e56c1..2b17fdcb 100644
--- a/test/handler/test_go_generic_handler.vader
+++ b/test/handler/test_go_generic_handler.vader
@@ -15,8 +15,24 @@ Execute(The golang handler should return the correct filenames):
\ 'type': 'E',
\ 'filename': ale#path#Simplify(expand('%:p:h') . '/other.go'),
\ },
+ \ {
+ \ 'lnum': 18,
+ \ 'col': 0,
+ \ 'text': 'random error',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/go1.14.go'),
+ \ },
+ \ {
+ \ 'lnum': 36,
+ \ 'col': 2,
+ \ 'text': 'another random error',
+ \ 'type': 'E',
+ \ 'filename': ale#path#Simplify(expand('%:p:h') . '/anothergo1.14.go'),
+ \ },
\ ],
\ ale#handlers#go#Handler(bufnr(''), [
\ 'test.go:27: some error',
\ 'other.go:27:5: some error with a column',
+ \ 'vet: go1.14.go:18:0: random error',
+ \ 'vet: anothergo1.14.go:36:2: another random error',
\ ])