From 1fac6011ef1b9bd87d0285c8c96a453473cc2822 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Fri, 15 Aug 2014 08:23:49 +0300 Subject: [PATCH] OClint: fix parsing. --- plugin/syntastic.vim | 2 +- syntax_checkers/c/oclint.vim | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 393a7cce..6a65378a 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:syntastic_start endif -let g:syntastic_version = '3.4.0-117' +let g:syntastic_version = '3.4.0-120' lockvar g:syntastic_version " Sanity checks {{{1 diff --git a/syntax_checkers/c/oclint.vim b/syntax_checkers/c/oclint.vim index ca717c48..9e5662bc 100644 --- a/syntax_checkers/c/oclint.vim +++ b/syntax_checkers/c/oclint.vim @@ -33,12 +33,10 @@ function! SyntaxCheckers_c_oclint_GetLocList() dict \ 'post_args_before': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file) }) let errorformat = - \ '%E%f:%l:%c: %m P1 ,' . - \ '%E%f:%l:%c: %m P2 ,' . - \ '%W%f:%l:%c: %m P3 ,' . \ '%E%f:%l:%c: fatal error: %m,' . \ '%E%f:%l:%c: error: %m,' . \ '%W%f:%l:%c: warning: %m,' . + \ '%E%f:%l:%c: %m,' . \ '%-G%.%#' let loclist = SyntasticMake({ @@ -48,6 +46,15 @@ function! SyntaxCheckers_c_oclint_GetLocList() dict \ 'postprocess': ['compressWhitespace'], \ 'returns': [0, 3, 5] }) + for e in loclist + if e['text'] =~# '\v P3( |$)' + let e['type'] = 'W' + endif + + let e['text'] = substitute(e['text'], '\m P[1-3]$', '', '') + let e['text'] = substitute(e['text'], ' P[1-3] ', ': ', '') + endfor + call self.setWantSort(1) return loclist