From dd1560862c4fa9cb6d641e1efa36ab15d05271d0 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Wed, 22 Oct 2014 10:04:35 +0300 Subject: [PATCH] Prospector: version 0.7 can check individual files. --- syntax_checkers/python/prospector.vim | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/syntax_checkers/python/prospector.vim b/syntax_checkers/python/prospector.vim index 681ccc04..a0ffba65 100644 --- a/syntax_checkers/python/prospector.vim +++ b/syntax_checkers/python/prospector.vim @@ -18,24 +18,21 @@ let g:loaded_syntastic_python_prospector_checker = 1 let s:save_cpo = &cpo set cpo&vim -function! SyntaxCheckers_python_prospector_GetLocList() dict - let base = syntastic#util#var('prospector_base_dir') - if base == '' - let base = expand('%:p:h') - let init = findfile('setup.py', base . ';') - if init == '' - let init = findfile('__init__.py', base . ';') - endif - if init != '' - let base = fnamemodify(init, ':p:h') - endif - call self.log('base =', base) +function! SyntaxCheckers_python_prospector_IsAvailable() dict + if !executable(self.getExec()) + return 0 endif + let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version') + call self.log(self.getExec() . ' version =', ver) + + return syntastic#util#versionIsAtLeast(ver, [0, 7]) +endfunction + +function! SyntaxCheckers_python_prospector_GetLocList() dict let makeprg = self.makeprgBuild({ \ 'args': '--external-config merge', - \ 'args_after': '--messages-only --absolute-paths --die-on-tool-error --zero-exit --output-format json', - \ 'fname': syntastic#util#shescape(base) }) + \ 'args_after': '--messages-only --absolute-paths --die-on-tool-error --zero-exit --output-format json' }) let errorformat = '%f:%l:%c: %m'