#852 - Capture error codes for cpplint

This commit is contained in:
w0rp
2017-11-15 11:28:16 +00:00
parent ff5c6b0509
commit 8f80708da6
2 changed files with 11 additions and 8 deletions

View File

@@ -4,14 +4,15 @@
function! ale#handlers#cpplint#HandleCppLintFormat(buffer, lines) abort
" Look for lines like the following.
" test.cpp:5: Estra space after ( in function call [whitespace/parents] [4]
let l:pattern = '^.\{-}:\(\d\+\): \(.\+\)'
let l:pattern = '^.\{-}:\(\d\+\): *\(.\+\) *\[\(.*/.*\)\] '
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': 0,
\ 'text': l:match[2],
\ 'text': join(split(l:match[2])),
\ 'code': l:match[3],
\ 'type': 'W',
\})
endfor