From a4fa3234f78bbae839b271b516cc9f624d428aa2 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Mon, 5 Aug 2013 12:57:14 +0300 Subject: [PATCH 1/2] Bug fix: wrong variable scope. --- plugin/syntastic.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index ec93a9f0..117e5f77 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -172,6 +172,7 @@ function! s:CacheErrors(...) if !s:SkipFile() let active_checkers = 0 + let names = [] for ft in s:CurrentFiletypes() if a:0 let checker = s:registry.getChecker(ft, a:1) @@ -180,7 +181,6 @@ function! s:CacheErrors(...) let checkers = s:registry.getActiveCheckers(ft) endif - let names = [] for checker in checkers let active_checkers += 1 call syntastic#util#debug("CacheErrors: Invoking checker: " . checker.getName()) From 755ecfe46bbd726e91bbf37cf903c4c1d349bc7f Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Wed, 7 Aug 2013 12:01:45 +0300 Subject: [PATCH 2/2] Catch up with the latest pylint contortions. --- syntax_checkers/python/pylint.vim | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/syntax_checkers/python/pylint.vim b/syntax_checkers/python/pylint.vim index 923664d4..1cf768c0 100644 --- a/syntax_checkers/python/pylint.vim +++ b/syntax_checkers/python/pylint.vim @@ -14,15 +14,17 @@ function! SyntaxCheckers_python_pylint_IsAvailable() endfunction function! SyntaxCheckers_python_pylint_GetLocList() + let pylint_new = s:PylintNew() + let makeprg = syntastic#makeprg#build({ \ 'exe': 'pylint', - \ 'args': ' -f parseable -r n -i y', + \ 'args': (pylint_new ? '--msg-template="{path}:{line}: [{msg_id}] {msg}" -r n' : '-f parseable -r n -i y'), \ 'filetype': 'python', \ 'subchecker': 'pylint' }) let errorformat = - \ '%A%f:%l:%m,' . - \ '%A%f:(%l):%m,' . + \ '%A%f:%l: %m,' . + \ '%A%f:(%l): %m,' . \ '%-Z%p^%.%#,' . \ '%-G%.%#' @@ -32,12 +34,18 @@ function! SyntaxCheckers_python_pylint_GetLocList() \ 'postprocess': ['sort'] }) for n in range(len(loclist)) - let loclist[n]['type'] = match(['R', 'C', 'W'], loclist[n]['text'][2]) >= 0 ? 'W' : 'E' + let loclist[n]['type'] = match(['R', 'C', 'W'], loclist[n]['text'][1]) >= 0 ? 'W' : 'E' + let loclist[n]['vcol'] = 0 endfor return loclist endfunction +function s:PylintNew() + let pylint_version = filter(split(system('pylint --version'), '\m, \|\n'), 'v:val =~# "^pylint"')[0] + return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1]) +endfunction + call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'python', \ 'name': 'pylint' })