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

View File

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

View File

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

View File

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