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 return llist
endfunction 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 let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: set et sts=4 sw=4: " vim: set et sts=4 sw=4:

View File

@ -38,20 +38,26 @@ function! SyntaxCheckers_java_checkstyle_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'java', \ 'exe': 'java',
\ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath . \ '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, \ 'fname': fname,
\ 'filetype': 'java', \ 'filetype': 'java',
\ 'subchecker': 'checkstyle' }) \ 'subchecker': 'checkstyle' })
let errorformat = let errorformat =
\ '%f:%l:%c:\ %m,' . \ '%P<file name="%f">,' .
\ '%f:%l:\ %m' \ '%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({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'subtype': 'Style', \ 'subtype': 'Style',
\ 'postprocess': ['cygwinRemoveCR'] }) \ 'postprocess': ['cygwinRemoveCR', 'decodeXMLEntities'] })
endfunction endfunction