Catch up with the latest pylint contortions.
This commit is contained in:
parent
a4fa3234f7
commit
755ecfe46b
@ -14,15 +14,17 @@ function! SyntaxCheckers_python_pylint_IsAvailable()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! SyntaxCheckers_python_pylint_GetLocList()
|
function! SyntaxCheckers_python_pylint_GetLocList()
|
||||||
|
let pylint_new = s:PylintNew()
|
||||||
|
|
||||||
let makeprg = syntastic#makeprg#build({
|
let makeprg = syntastic#makeprg#build({
|
||||||
\ 'exe': 'pylint',
|
\ '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',
|
\ 'filetype': 'python',
|
||||||
\ 'subchecker': 'pylint' })
|
\ 'subchecker': 'pylint' })
|
||||||
|
|
||||||
let errorformat =
|
let errorformat =
|
||||||
\ '%A%f:%l:%m,' .
|
\ '%A%f:%l: %m,' .
|
||||||
\ '%A%f:(%l):%m,' .
|
\ '%A%f:(%l): %m,' .
|
||||||
\ '%-Z%p^%.%#,' .
|
\ '%-Z%p^%.%#,' .
|
||||||
\ '%-G%.%#'
|
\ '%-G%.%#'
|
||||||
|
|
||||||
@ -32,12 +34,18 @@ function! SyntaxCheckers_python_pylint_GetLocList()
|
|||||||
\ 'postprocess': ['sort'] })
|
\ 'postprocess': ['sort'] })
|
||||||
|
|
||||||
for n in range(len(loclist))
|
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
|
endfor
|
||||||
|
|
||||||
return loclist
|
return loclist
|
||||||
endfunction
|
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({
|
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||||
\ 'filetype': 'python',
|
\ 'filetype': 'python',
|
||||||
\ 'name': 'pylint' })
|
\ 'name': 'pylint' })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user