syntastic/syntax_checkers/python.vim

25 lines
602 B
VimL
Raw Normal View History

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('%'))
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