Merge branch 'fix_checkstyle' into preprocess

This commit is contained in:
LCD 47 2013-08-01 18:03:01 +03:00
commit 9913819255
2 changed files with 26 additions and 4 deletions

View File

@ -53,6 +53,22 @@ function! syntastic#postprocess#cygwinRemoveCR(errors)
return llist
endfunction
" decode XML entities
function! syntastic#postprocess#decodeXMLEntities(errors)
let llist = []
for e in a:errors
let e['text'] = substitute(e['text'], '&lt;', '<', 'g')
let e['text'] = substitute(e['text'], '&gt;', '>', 'g')
let e['text'] = substitute(e['text'], '&quot;', '"', 'g')
let e['text'] = substitute(e['text'], '&apos;', "'", 'g')
let e['text'] = substitute(e['text'], '&amp;', '\&', 'g')
call add(llist, e)
endfor
return llist
endfunction
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -38,20 +38,26 @@ function! SyntaxCheckers_java_checkstyle_GetLocList()
let makeprg = syntastic#makeprg#build({
\ 'exe': 'java',
\ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath .
\ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file,
\ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file .
\ ' -f xml',
\ 'fname': fname,
\ 'filetype': 'java',
\ 'subchecker': 'checkstyle' })
let errorformat =
\ '%f:%l:%c:\ %m,' .
\ '%f:%l:\ %m'
\ '%P<file name="%f">,' .
\ '%Q</file>,' .
\ '%E<error line="%l" column="%c" severity="%trror" message="%m" source="%.%#"/>,' .
\ '%E<error line="%l" severity="%trror" message="%m" source="%.%#"/>,' .
\ '%E<error line="%l" column="%c" severity="%tarning" message="%m" source="%.%#"/>,' .
\ '%E<error line="%l" severity="%tarning" message="%m" source="%.%#"/>,' .
\ '%-G%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'postprocess': ['cygwinRemoveCR'] })
\ 'postprocess': ['cygwinRemoveCR', 'decodeXMLEntities'] })
endfunction