2009-07-29 03:19:07 -04:00
|
|
|
if exists("loaded_python_syntax_checker")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let loaded_python_syntax_checker = 1
|
|
|
|
|
|
|
|
"bail if the user doesnt have pyflakes installed
|
|
|
|
if !executable("pyflakes")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
function! SyntaxCheckers_python_GetLocList()
|
2010-09-23 22:36:53 -04:00
|
|
|
let makeprg = 'pyflakes '.shellescape(expand('%'))
|
2009-07-29 03:19:07 -04:00
|
|
|
let errorformat = '%E%f:%l: could not compile,%-Z%p^,%W%f:%l: %m,%-G%.%#'
|
|
|
|
|
|
|
|
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
|
|
|
|
|
|
|
for i in errors
|
|
|
|
if i['type'] ==# 'E'
|
|
|
|
let i['text'] = "Syntax error"
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
|
|
|
|
return errors
|
|
|
|
endfunction
|