Merge remote branch 'scrooloose/master'
Conflicts: syntax_checkers/php.vim syntax_checkers/ruby.vim
This commit is contained in:
commit
ac00f2d6a7
@ -80,12 +80,14 @@ function! s:Init()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_c_GetLocList()
|
||||
let makeprg = 'gcc -fsyntax-only %'
|
||||
let errorformat = '%-G%f:%s:,%f:%l: %m'
|
||||
let makeprg = 'gcc -fsyntax-only '.shellescape(expand('%'))
|
||||
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
|
||||
\ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '.
|
||||
\ 'each function it appears%.%#,%f:%l: %trror: %m,%f:%l: %m'
|
||||
|
||||
if expand('%') =~? '.h$'
|
||||
if exists('g:syntastic_c_check_header')
|
||||
let makeprg = 'gcc -c %'
|
||||
let makeprg = 'gcc -c '.shellescape(expand('%'))
|
||||
else
|
||||
return []
|
||||
endif
|
||||
|
@ -25,12 +25,12 @@ if !executable('g++')
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_GetLocList()
|
||||
let makeprg = 'g++ -fsyntax-only %'
|
||||
let makeprg = 'g++ -fsyntax-only '.shellescape(expand('%'))
|
||||
let errorformat = '%-G%f:%s:,%f:%l: %m'
|
||||
|
||||
if expand('%') =~? '\%(.h\|.hpp\|.hh\)$'
|
||||
if exists('g:syntastic_cpp_check_header')
|
||||
let makeprg = 'g++ -c %'
|
||||
let makeprg = 'g++ -c '.shellescape(expand('%'))
|
||||
else
|
||||
return []
|
||||
endif
|
||||
|
@ -20,7 +20,7 @@ if !executable("cucumber")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cucumber_GetLocList()
|
||||
let makeprg = 'cucumber --dry-run --quiet --strict --format pretty %'
|
||||
let makeprg = 'cucumber --dry-run --quiet --strict --format pretty '.shellescape(expand('%'))
|
||||
let errorformat = '%f:%l:%c:%m,%W %.%# (%m),%-Z%f:%l:%.%#,%-G%.%#'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
|
@ -20,7 +20,7 @@ if !executable("ruby") || !executable("cat")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_eruby_GetLocList()
|
||||
let makeprg='cat '. expand("%") . ' \| RUBYOPT= ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| RUBYOPT= ruby -c'
|
||||
let makeprg='cat '. shellescape(expand("%")) . ' \| RUBYOPT= ruby -e "require \"erb\"; puts ERB.new(ARGF.read, nil, \"-\").src" \| RUBYOPT= 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 })
|
||||
|
||||
|
@ -22,7 +22,7 @@ endif
|
||||
" As this calls ghc, it can take a few seconds... maybe hlint or something
|
||||
" could do a good enough job?
|
||||
function! SyntaxCheckers_haskell_GetLocList()
|
||||
let makeprg = 'ghc % -e :q'
|
||||
let makeprg = 'ghc '.shellescape(expand('%')).' -e :q'
|
||||
let errorformat = '%-G\\s%#,%f:%l:%c:%m,%E%f:%l:%c:,%Z%m,'
|
||||
|
||||
|
||||
|
@ -23,7 +23,7 @@ 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'"
|
||||
let makeprg="tidy -e ".shellescape(expand('%'))." 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 })
|
||||
|
||||
|
@ -20,7 +20,7 @@ if !executable("jsl")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_GetLocList()
|
||||
let makeprg = "jsl -nologo -nofilelisting -nosummary -nocontext -process %"
|
||||
let makeprg = "jsl -nologo -nofilelisting -nosummary -nocontext -process ".shellescape(expand('%'))
|
||||
let errorformat='%W%f(%l): lint warning: %m,%-Z%p^,%W%f(%l): warning: %m,%-Z%p^,%E%f(%l): SyntaxError: %m,%-Z%p^,%-G'
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
37
syntax_checkers/lua.vim
Normal file
37
syntax_checkers/lua.vim
Normal file
@ -0,0 +1,37 @@
|
||||
"============================================================================
|
||||
"File: lua.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Gregor Uhlenheuer <kongo2002 at gmail dot com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists('loaded_lua_syntax_checker')
|
||||
finish
|
||||
endif
|
||||
let loaded_lua_syntax_checker = 1
|
||||
|
||||
" check if the lua compiler is installed
|
||||
if !executable('luac')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_lua_GetLocList()
|
||||
let makeprg = 'luac -p ' . shellescape(expand('%'))
|
||||
let errorformat = 'luac: %#%f:%l: %m'
|
||||
|
||||
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
|
||||
let bn = bufnr('')
|
||||
for loc in loclist
|
||||
let loc['bufnr'] = bn
|
||||
let loc['type'] = 'E'
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
@ -24,7 +24,7 @@ if !executable("perl")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_perl_GetLocList()
|
||||
let makeprg = $VIMRUNTIME.'/tools/efm_perl.pl -c %'
|
||||
let makeprg = $VIMRUNTIME.'/tools/efm_perl.pl -c '.shellescape(expand('%'))
|
||||
let errorformat = '%f:%l:%m'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
|
@ -20,7 +20,7 @@ if !executable("php")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_php_GetLocList()
|
||||
let makeprg = "php -l %"
|
||||
let makeprg = "php -l ".shellescape(expand('%'))
|
||||
let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l'
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
@ -9,7 +9,7 @@ if !executable("pyflakes")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_python_GetLocList()
|
||||
let makeprg = 'pyflakes %'
|
||||
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 })
|
||||
|
@ -21,9 +21,9 @@ endif
|
||||
|
||||
function! SyntaxCheckers_ruby_GetLocList()
|
||||
if exists('g:ruby_path')
|
||||
let makeprg = 'RUBYOPT= ' . g:ruby_path . ' -W1 -c %'
|
||||
let makeprg = 'RUBYOPT= '.g:ruby_path.' -W1 -c %'.shellescape(expand('%'))
|
||||
else
|
||||
let makeprg = 'RUBYOPT= ruby -W1 -c %'
|
||||
let makeprg = 'RUBYOPT= ruby -W1 -c %'.shellescape(expand('%'))
|
||||
endif
|
||||
let errorformat = '%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%-C%.%#'
|
||||
|
||||
|
@ -20,7 +20,7 @@ if !executable("sass")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_sass_GetLocList()
|
||||
let makeprg='sass --check %'
|
||||
let makeprg='sass --check '.shellescape(expand('%'))
|
||||
let errorformat = '%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m'
|
||||
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
|
||||
|
@ -20,7 +20,7 @@ if !executable("lacheck")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_tex_GetLocList()
|
||||
let makeprg = 'lacheck %'
|
||||
let makeprg = 'lacheck '.shellescape(expand('%'))
|
||||
let errorformat = '%E"%f"\, line %l: %m'
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
@ -21,7 +21,7 @@ endif
|
||||
|
||||
function! SyntaxCheckers_xhtml_GetLocList()
|
||||
|
||||
let makeprg="tidy -xml -e %"
|
||||
let makeprg="tidy -xml -e ".shellescape(expand('%'))
|
||||
let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#'
|
||||
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user