Catch up with the latest pylint contortions.

This commit is contained in:
LCD 47 2013-08-07 12:01:45 +03:00
parent a4fa3234f7
commit 755ecfe46b

View File

@ -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' })