Skip to content

Commit

Permalink
Checker python/prospector: better error reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
lcd047 committed May 30, 2017
1 parent 5efeece commit 159900a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions autoload/syntastic/preprocess.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugin/syntastic.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 159900a

Please sign in to comment.