make the syntax checkers use SyntasticMake

This commit is contained in:
Martin Grenfell 2009-07-15 21:29:28 +12:00
parent 0e98aa36c4
commit 1adfa4db5c
4 changed files with 17 additions and 22 deletions

View File

@ -20,12 +20,11 @@ if !executable("ruby") || !executable("cat")
endif endif
function! SyntaxCheckers_eruby_GetLocList() function! SyntaxCheckers_eruby_GetLocList()
let &makeprg='cat '. expand("%") . ' \| ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| ruby -c' let makeprg='cat '. expand("%") . ' \| ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| ruby -c'
set errorformat=%-GSyntax\ OK,%E-:%l:\ syntax\ error\\,\ %m,%Z%p^,%W-:%l:\ warning:\ %m,%Z%p^,%-C%.%# let errorformat='%-GSyntax OK,%E-:%l: syntax error\, %m,%Z%p^,%W-:%l: warning: %m,%Z%p^,%-C%.%#'
silent lmake! let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
"the file name isnt in the output so stick in the buf num manually "the file name isnt in the output so stick in the buf num manually
let loclist = getloclist(0)
for i in loclist for i in loclist
let i['bufnr'] = bufnr("") let i['bufnr'] = bufnr("")
endfor endfor

View File

@ -23,13 +23,11 @@ function! SyntaxCheckers_html_GetLocList()
"grep out the '<table> lacks "summary" attribute' since it is almost "grep out the '<table> lacks "summary" attribute' since it is almost
"always present and almost always useless "always present and almost always useless
let &makeprg="tidy -e % 2>&1 \\| grep -v '\<table\> lacks \"summary\" attribute'" let makeprg="tidy -e % 2>&1 \\| grep -v '\<table\> lacks \"summary\" attribute'"
let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#'
set errorformat=%Wline\ %l\ column\ %c\ -\ Warning:\ %m,%Eline\ %l\ column\ %c\ -\ Error:\ %m,%-G%.%#,%-G%.%# let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
silent lmake!
"the file name isnt in the output so stick in the buf num manually "the file name isnt in the output so stick in the buf num manually
let loclist = getloclist(0)
for i in loclist for i in loclist
let i['bufnr'] = bufnr("") let i['bufnr'] = bufnr("")
endfor endfor

View File

@ -24,19 +24,17 @@ function! SyntaxCheckers_php_GetLocList()
endfunction endfunction
function! s:PhpErrors() function! s:PhpErrors()
set makeprg=php\ -l\ % let makeprg = "php -l %"
set errorformat=%-GNo\ syntax\ errors\ detected\ in%.%#,%-GErrors\ parsing\ %.%#,%-G\\s%#,%EParse\ error:\ syntax\ error\\,\ %m\ in\ %f\ on\ line\ %l, let errorformat='%-GNo syntax errors detected in%.%#,%-GErrors parsing %.%#,%-G\s%#,%EParse error: syntax error\, %m in %f on line %l'
silent lmake! return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
return getloclist(0)
endfunction endfunction
function! s:HtmlErrors() function! s:HtmlErrors()
let &makeprg="tidy -e % 2>&1" let makeprg="tidy -e % 2>&1"
let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
set errorformat=%Wline\ %l\ column\ %c\ -\ Warning:\ %m,%Eline\ %l\ column\ %c\ -\ Error:\ %m,%-G%.%#,%-G%.%# call filter(loclist, 'index(s:html_ignored_errors, v:val["text"]) == -1')
silent lmake!
let loclist = filter(getloclist(0), 'index(s:html_ignored_errors, v:val["text"]) == -1')
"the file name isnt in the output so stick in the buf num manually "the file name isnt in the output so stick in the buf num manually
for i in loclist for i in loclist

View File

@ -20,8 +20,8 @@ if !executable("ruby")
endif endif
function! SyntaxCheckers_ruby_GetLocList() function! SyntaxCheckers_ruby_GetLocList()
set makeprg=ruby\ -w\ -c\ % let makeprg = 'ruby -w -c %'
set errorformat=%-GSyntax\ OK,%E%f:%l:\ syntax\ error\\,\ %m,%Z%p^,%W%f:%l:\ warning:\ %m,%Z%p^,%-C%.%# let errorformat = '%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%-C%.%#'
silent lmake!
return getloclist(0) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction