summaryrefslogtreecommitdiff
path: root/ale_linters/go/golangci_lint.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/go/golangci_lint.vim')
-rw-r--r--ale_linters/go/golangci_lint.vim12
1 files changed, 9 insertions, 3 deletions
diff --git a/ale_linters/go/golangci_lint.vim b/ale_linters/go/golangci_lint.vim
index 2c4b1a4f..80431b99 100644
--- a/ale_linters/go/golangci_lint.vim
+++ b/ale_linters/go/golangci_lint.vim
@@ -24,7 +24,7 @@ function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
endfunction
function! ale_linters#go#golangci_lint#GetMatches(lines) abort
- let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)$'
+ let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)\s+\((.+)\)$'
return ale#util#GetMatches(a:lines, l:pattern)
endfunction
@@ -34,14 +34,20 @@ function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
let l:output = []
for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines)
+ if l:match[5] is# 'typecheck'
+ let l:msg_type = 'E'
+ else
+ let l:msg_type = 'W'
+ endif
+
" l:match[1] will already be an absolute path, output from
" golangci_lint
call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0,
- \ 'type': 'E',
- \ 'text': l:match[4],
+ \ 'type': l:msg_type,
+ \ 'text': l:match[4] . ' (' . l:match[5] . ')',
\})
endfor