syntastic/syntax_checkers/python/python.vim
LCD 47 6d81ac5dd0 Registry cleanup, stage 3.
Make syntastic#makeprg#build() a dictionary function.
Remove the mandatory checker argument to syntastic#makeprg#build().
2013-11-02 10:44:06 +02:00

37 lines
1.1 KiB
VimL

"============================================================================
"File: python.vim
"Description: Syntax checking plugin for syntastic.vim
"Author: Artem Nezvigin <artem at artnez dot com>
"
" `errorformat` derived from:
" http://www.vim.org/scripts/download_script.php?src_id=1392
"
"============================================================================
if exists("g:loaded_syntastic_python_python_checker")
finish
endif
let g:loaded_syntastic_python_python_checker=1
function! SyntaxCheckers_python_python_GetLocList() dict
let fname = "'" . escape(expand('%'), "\\'") . "'"
let makeprg = self.makeprgBuild({
\ 'args': '-c',
\ 'fname': syntastic#util#shescape("compile(open(" . fname . ").read(), " . fname . ", 'exec')") })
let errorformat =
\ '%E File "%f"\, line %l,' .
\ '%C %p^,' .
\ '%C %.%#,' .
\ '%Z%m,' .
\ '%-G%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'python',
\ 'name': 'python'})