mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user