Checker python/prospector: better error reporting.

This commit is contained in:
LCD 47 2017-05-30 18:06:53 +03:00
parent 5efeecece3
commit 159900a1a2
2 changed files with 12 additions and 5 deletions

View File

@ -265,12 +265,17 @@ function! syntastic#preprocess#perl(errors) abort " {{{2
endfunction " }}}2
function! syntastic#preprocess#prospector(errors) abort " {{{2
let errs = s:_decode_JSON(join(a:errors, ''))
let errs = join(a:errors, '')
if errs ==# ''
return []
endif
let json = s:_decode_JSON(errs)
let out = []
if type(errs) == type({}) && has_key(errs, 'messages')
if type(errs['messages']) == type([])
for e in errs['messages']
if type(json) == type({}) && has_key(json, 'messages')
if type(json['messages']) == type([])
for e in json['messages']
if type(e) == type({})
try
if e['source'] ==# 'pylint'
@ -300,6 +305,8 @@ function! syntastic#preprocess#prospector(errors) abort " {{{2
else
call syntastic#log#warn('checker python/prospector: unrecognized error format (crashed checker?)')
endif
else
call syntastic#log#warn('checker python/prospector: unrecognized error format (crashed checker?)')
endif
return out

View File

@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START
endif
let g:_SYNTASTIC_VERSION = '3.8.0-55'
let g:_SYNTASTIC_VERSION = '3.8.0-56'
lockvar g:_SYNTASTIC_VERSION
" Sanity checks {{{1