Merge remote-tracking branch 'scrooloose/master'

This commit is contained in:
Chris Hoffman 2011-07-01 05:23:03 -05:00
commit 2d4ec257f3
6 changed files with 121 additions and 10 deletions

View File

@ -84,9 +84,9 @@ endfunction
function! SyntaxCheckers_c_GetLocList()
let makeprg = 'gcc -fsyntax-only '.shellescape(expand('%')).' -I. -I..'
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
\ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '.
\ 'each function it appears%.%#,%-GIn file included%.%#,'.
\ '%-G %#from %f:%l\,,%f:%l: %trror: %m,%f:%l: %m'
\ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '.
\ 'each function it appears%.%#,%-GIn file included%.%#,'.
\ '%-G %#from %f:%l\,,%f:%l:%c: %m,%f:%l: %trror: %m,%f:%l: %m'
if expand('%') =~? '.h$'
if exists('g:syntastic_c_check_header')

View File

@ -14,13 +14,13 @@ if exists("loaded_coffee_syntax_checker")
endif
let loaded_coffee_syntax_checker = 1
"bail if the user doesnt have ruby installed
"bail if the user doesnt have coffee installed
if !executable("coffee")
finish
endif
function! SyntaxCheckers_coffee_GetLocList()
let makeprg = 'coffee -c -l -o /dev/null %'
let makeprg = 'coffee -c -l -o /tmp %'
let errorformat = '%EError: In %f\, Parse error on line %l: %m,%EError: In %f\, %m on line %l,%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 })

34
syntax_checkers/css.vim Normal file
View File

@ -0,0 +1,34 @@
"============================================================================
"File: css.vim
"Description: Syntax checking plugin for syntastic.vim using `csslint` CLI tool (http://csslint.net).
"Maintainer: Ory Band <oryband 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_css_syntax_checker")
finish
endif
let loaded_css_syntax_checker = 1
" Bail if the user doesn't have `csslint` installed.
if !executable("csslint")
finish
endif
function! SyntaxCheckers_css_GetLocList()
let makeprg = 'csslint '.shellescape(expand('%'))
" Print CSS Lint's 'Welcome' and error/warning messages. Ignores the code line.
let errorformat = '%+Gcsslint:\ There%.%#,%A%f:,%C%n:\ %t%\\w%\\+\ at\ line\ %l\,\ col\ %c,%Z%m\ at\ line%.%#,%A%>%f:,%C%n:\ %t%\\w%\\+\ at\ line\ %l\,\ col\ %c,%Z%m,%-G%.%#'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
for i in loclist
let i['bufnr'] = bufnr("")
endfor
return loclist
endfunction

40
syntax_checkers/cuda.vim Normal file
View File

@ -0,0 +1,40 @@
"============================================================================
"File: cuda.vim
"Description: Syntax checking plugin for syntastic.vim
"
"Author: Hannes Schulz <schulz at ais dot uni-bonn dot de>
"
"============================================================================
" in order to also check header files add this to your .vimrc:
" (this creates an empty .syntastic_dummy.cu file in your source directory)
"
" let g:syntastic_cuda_check_header = 1
if exists('loaded_cuda_syntax_checker')
finish
endif
let loaded_cuda_syntax_checker = 1
if !exists('g:syntastic_nvcc_binary')
let g:syntastic_nvcc_binary = '/usr/local/cuda/bin/nvcc'
endif
if !executable('/usr/local/cuda/bin/nvcc')
finish
endif
function! SyntaxCheckers_cuda_GetLocList()
let makeprg = g:syntastic_nvcc_binary.' --cuda -O0 -I . -Xcompiler -fsyntax-only '.shellescape(expand('%')).' -o /dev/null'
"let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
let errorformat = '%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory `%f'',%X%*\a[%*\d]: Leaving directory `%f'',%D%*\a: Entering directory `%f'',%X%*\a: Leaving directory `%f'',%DMaking %*\a in %f,%f|%l| %m'
if expand('%') =~? '\%(.h\|.hpp\|.cuh\)$'
if exists('g:syntastic_cuda_check_header')
let makeprg = 'echo > .syntastic_dummy.cu ; '.g:syntastic_nvcc_binary.' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include '.shellescape(expand('%')).' -o /dev/null'
else
return []
endif
endif
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction

View File

@ -0,0 +1,34 @@
"============================================================================
"File: matlab.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Jason Graham <jason at the-graham 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_matlab_syntax_checker")
finish
endif
let loaded_matlab_syntax_checker = 1
"bail if the user doesn't have mlint installed
if !executable("mlint")
finish
endif
function! SyntaxCheckers_matlab_GetLocList()
let makeprg = 'mlint -id $* '.shellescape(expand('%'))
let errorformat = 'L %l (C %c): %*[a-zA-Z0-9]: %m,L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
for i in loclist
let i['bufnr'] = bufnr("")
endfor
return loclist
endfunction

View File

@ -19,13 +19,16 @@ if !executable("sass")
finish
endif
"use compass imports if available
let g:syntastic_sass_imports = ""
if executable("compass")
let g:syntastic_sass_imports = system("compass imports")
endif
let g:syntastic_sass_imports = 0
function! SyntaxCheckers_sass_GetLocList()
"use compass imports if available
if g:syntastic_sass_imports == 0 && executable("compass")
let g:syntastic_sass_imports = system("compass imports")
else
let g:syntastic_sass_imports = ""
endif
let makeprg='sass '.g:syntastic_sass_imports.' --check '.shellescape(expand('%'))
let errorformat = '%ESyntax %trror:%m,%C on line %l of %f,%Z%m'
let errorformat .= ',%Wwarning on line %l:,%Z%m,Syntax %trror on line %l: %m'