mirror of
https://github.com/amix/vimrc
synced 2025-07-07 00:15:00 +08:00
Adding submodules and stuff.
This commit is contained in:
168
sources_non_forked/syntastic/syntax_checkers/ada/gcc.vim
Normal file
168
sources_non_forked/syntastic/syntax_checkers/ada/gcc.vim
Normal file
@ -0,0 +1,168 @@
|
||||
"============================================================================
|
||||
"File: ada.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Alfredo Di Napoli <alfredo.dinapoli@gmail.com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ada_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ada_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ada_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_ada_includes. Then the header files are being re-checked
|
||||
" on the next file write.
|
||||
"
|
||||
" let g:syntastic_ada_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_ada_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_ada_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" gcc command line you can add those to the global variable
|
||||
" g:syntastic_ada_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_ada_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_ada_compiler_options':
|
||||
"
|
||||
" let g:syntastic_ada_compiler_options = ' -std=c++0x'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_ada_config_file' allows you to define
|
||||
" a file that contains additional compiler arguments like include directories
|
||||
" or CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_ada_config':
|
||||
"
|
||||
" let g:syntastic_ada_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_ada_remove_include_errors' you can
|
||||
" specify whether errors of files included via the
|
||||
" g:syntastic_ada_include_dirs' setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_ada_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_ada_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_ada_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to gcc)
|
||||
"
|
||||
" let g:syntastic_ada_compiler = 'gcc'
|
||||
|
||||
if exists('g:loaded_syntastic_ada_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_ada_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_ada_compiler')
|
||||
let g:syntastic_ada_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ada_gcc_IsAvailable()
|
||||
return executable(g:syntastic_ada_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_ada_compiler_options')
|
||||
let g:syntastic_ada_compiler_options = ''
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_ada_config_file')
|
||||
let g:syntastic_ada_config_file = '.syntastic_ada_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ada_gcc_GetLocList()
|
||||
let makeprg = g:syntastic_ada_compiler . ' -c -x ada -fsyntax-only '
|
||||
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_c_errorformat')
|
||||
let errorformat = g:syntastic_c_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_ada_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('ada')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.ads$'
|
||||
if exists('g:syntastic_ada_check_header')
|
||||
let makeprg = g:syntastic_ada_compiler .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . g:syntastic_ada_compiler_options .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('ada')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_ada_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_ada_no_include_search') ||
|
||||
\ g:syntastic_ada_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_ada_auto_refresh_includes') &&
|
||||
\ g:syntastic_ada_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_ada_includes')
|
||||
let b:syntastic_ada_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_ada_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_ada_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_ada_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_ada_remove_include_errors') &&
|
||||
\ g:syntastic_ada_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ada',
|
||||
\ 'name': 'gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,50 @@
|
||||
"==============================================================================
|
||||
" FileName: applescript.vim
|
||||
" Desc: Syntax checking plugin for syntastic.vim
|
||||
" Author: Zhao Cai
|
||||
" Email: caizhaoff@gmail.com
|
||||
" Version: 0.2.1
|
||||
" Date Created: Thu 09 Sep 2011 10:30:09 AM EST
|
||||
" Last Modified: Fri 09 Dec 2011 01:10:24 PM EST
|
||||
"
|
||||
" History: 0.1.0 - working, but it will run the script everytime to check
|
||||
" syntax. Should use osacompile but strangely it does not give
|
||||
" errors.
|
||||
"
|
||||
" 0.2.0 - switch to osacompile, it gives less errors compared
|
||||
" with osascript.
|
||||
"
|
||||
" 0.2.1 - remove g:syntastic_applescript_tempfile. use
|
||||
" tempname() instead.
|
||||
"
|
||||
" 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("g:loaded_syntastic_applescript_osacompile_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_applescript_osacompile_checker=1
|
||||
|
||||
function! SyntaxCheckers_applescript_osacompile_IsAvailable()
|
||||
return executable('osacompile')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_applescript_osacompile_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'osacompile',
|
||||
\ 'args': '-o ' . tempname() . '.scpt ',
|
||||
\ 'filetype': 'applescript',
|
||||
\ 'subchecker': 'osacompile' })
|
||||
let errorformat = '%f:%l:%m'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'applescript',
|
||||
\ 'name': 'osacompile'})
|
@ -0,0 +1,48 @@
|
||||
"============================================================================
|
||||
"File: checkpatch.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using checkpatch.pl
|
||||
"Maintainer: Daniel Walker <dwalker at fifo99 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("g:loaded_syntastic_c_checkpatch_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_checkpatch_checker = 1
|
||||
|
||||
" Bail if the user doesn't have `checkpatch.pl` or ./scripts/checkpatch.pl installed.
|
||||
if executable("checkpatch.pl")
|
||||
let g:syntastic_c_checker_checkpatch_location = 'checkpatch.pl'
|
||||
elseif executable("./scripts/checkpatch.pl")
|
||||
let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl'
|
||||
endif
|
||||
|
||||
function SyntaxCheckers_c_checkpatch_IsAvailable()
|
||||
return exists("g:syntastic_c_checker_checkpatch_location")
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_c_checkpatch_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': g:syntastic_c_checker_checkpatch_location,
|
||||
\ 'args': '--no-summary --no-tree --terse --file',
|
||||
\ 'filetype': 'c',
|
||||
\ 'subchecker': 'checkpatch' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l: %tARNING: %m,' .
|
||||
\ '%f:%l: %tRROR: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0],
|
||||
\ 'subtype': 'Style' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'checkpatch'})
|
183
sources_non_forked/syntastic/syntax_checkers/c/gcc.vim
Normal file
183
sources_non_forked/syntastic/syntax_checkers/c/gcc.vim
Normal file
@ -0,0 +1,183 @@
|
||||
"============================================================================
|
||||
"File: c.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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_c_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_c_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_c_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_c_includes. Then the header files are being re-checked on
|
||||
" the next file write.
|
||||
"
|
||||
" let g:syntastic_c_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_c_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_c_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" gcc command line you can add those to the global variable
|
||||
" g:syntastic_c_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_c_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_c_compiler_options':
|
||||
"
|
||||
" let g:syntastic_c_compiler_options = ' -ansi'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_c_config_file' allows you to define a
|
||||
" file that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_c_config':
|
||||
"
|
||||
" let g:syntastic_c_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_c_remove_include_errors' you can
|
||||
" specify whether errors of files included via the g:syntastic_c_include_dirs'
|
||||
" setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_c_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_c_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_c_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to gcc)
|
||||
"
|
||||
" let g:syntastic_c_compiler = 'clang'
|
||||
|
||||
if exists('g:loaded_syntastic_c_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_c_compiler')
|
||||
let g:syntastic_c_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_gcc_IsAvailable()
|
||||
return executable(g:syntastic_c_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_c_compiler_options')
|
||||
let g:syntastic_c_compiler_options = '-std=gnu99'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_c_config_file')
|
||||
let g:syntastic_c_config_file = '.syntastic_c_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_gcc_GetLocList()
|
||||
let makeprg = g:syntastic_c_compiler . ' -x c -fsyntax-only '
|
||||
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:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_c_errorformat')
|
||||
let errorformat = g:syntastic_c_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_c_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('c')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.h$'
|
||||
if exists('g:syntastic_c_check_header')
|
||||
let makeprg = g:syntastic_c_compiler .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . g:syntastic_c_compiler_options .
|
||||
\ ' ' . syntastic#c#GetNullDevice() .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('c')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_c_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_c_no_include_search') ||
|
||||
\ g:syntastic_c_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_c_auto_refresh_includes') &&
|
||||
\ g:syntastic_c_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_c_includes')
|
||||
let b:syntastic_c_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_c_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_c_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_c_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_c_remove_include_errors') &&
|
||||
\ g:syntastic_c_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
65
sources_non_forked/syntastic/syntax_checkers/c/make.vim
Normal file
65
sources_non_forked/syntastic/syntax_checkers/c/make.vim
Normal file
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: make.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('g:loaded_syntastic_c_make_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_make_checker = 1
|
||||
|
||||
function SyntaxCheckers_c_make_IsAvailable()
|
||||
return executable('make')
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_make_GetLocList()
|
||||
|
||||
let makeprg = 'make -sk'
|
||||
|
||||
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:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_c_errorformat')
|
||||
let errorformat = g:syntastic_c_errorformat
|
||||
endif
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_c_remove_include_errors') &&
|
||||
\ g:syntastic_c_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'make'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
58
sources_non_forked/syntastic/syntax_checkers/c/oclint.vim
Normal file
58
sources_non_forked/syntastic/syntax_checkers/c/oclint.vim
Normal file
@ -0,0 +1,58 @@
|
||||
"============================================================================
|
||||
"File: oclint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_oclint_config':
|
||||
"
|
||||
" let g:syntastic_oclint_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_c_oclint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_oclint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_oclint_IsAvailable()
|
||||
return executable("oclint")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_oclint_config_file')
|
||||
let g:syntastic_oclint_config_file = '.syntastic_oclint_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_oclint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'oclint',
|
||||
\ 'args': '-text',
|
||||
\ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file),
|
||||
\ 'filetype': 'c',
|
||||
\ 'subchecker': 'oclint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: %m P1 ,' .
|
||||
\ '%E%f:%l:%c: %m P2 ,' .
|
||||
\ '%W%f:%l:%c: %m P3 ,' .
|
||||
\ '%E%f:%l:%c: fatal error: %m,' .
|
||||
\ '%E%f:%l:%c: error: %m,' .
|
||||
\ '%W%f:%l:%c: warning: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['compressWhitespace', 'sort'] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'oclint'})
|
51
sources_non_forked/syntastic/syntax_checkers/c/sparse.vim
Normal file
51
sources_non_forked/syntastic/syntax_checkers/c/sparse.vim
Normal file
@ -0,0 +1,51 @@
|
||||
"============================================================================
|
||||
"File: sparse.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim using sparse.pl
|
||||
"Maintainer: Daniel Walker <dwalker at fifo99 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.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_sparse_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_sparse_config':
|
||||
"
|
||||
" let g:syntastic_sparse_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_c_sparse_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_sparse_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_sparse_IsAvailable()
|
||||
return executable("sparse")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_sparse_config_file')
|
||||
let g:syntastic_sparse_config_file = '.syntastic_sparse_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_sparse_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'sparse',
|
||||
\ 'args': '-ftabstop=' . &ts . ' ' . syntastic#c#ReadConfig(g:syntastic_sparse_config_file),
|
||||
\ 'filetype': 'c',
|
||||
\ 'subchecker': 'sparse' })
|
||||
|
||||
let errorformat = '%f:%l:%v: %trror: %m,%f:%l:%v: %tarning: %m,'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'returns': [0] })
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'sparse'})
|
57
sources_non_forked/syntastic/syntax_checkers/c/splint.vim
Normal file
57
sources_non_forked/syntastic/syntax_checkers/c/splint.vim
Normal file
@ -0,0 +1,57 @@
|
||||
"============================================================================
|
||||
"File: splint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_splint_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_splint_config':
|
||||
"
|
||||
" let g:syntastic_splint_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_c_splint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_splint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_splint_IsAvailable()
|
||||
return executable("splint")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_splint_config_file')
|
||||
let g:syntastic_splint_config_file = '.syntastic_splint_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_splint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'splint',
|
||||
\ 'post_args': '-showfunc -hints +quiet ' . syntastic#c#ReadConfig(g:syntastic_splint_config_file),
|
||||
\ 'filetype': 'c',
|
||||
\ 'subchecker': 'splint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' .
|
||||
\ '%W%f:%l:%v: %m,' .
|
||||
\ '%W%f:%l: %m,' .
|
||||
\ '%-C %\+In file included from %.%#,' .
|
||||
\ '%-C %\+from %.%#,' .
|
||||
\ '%+C %.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['compressWhitespace'],
|
||||
\ 'defaults': {'type': 'W'} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'splint'})
|
32
sources_non_forked/syntastic/syntax_checkers/c/ycm.vim
Normal file
32
sources_non_forked/syntastic/syntax_checkers/c/ycm.vim
Normal file
@ -0,0 +1,32 @@
|
||||
"============================================================================
|
||||
"File: ycm.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Val Markovic <val at markovic dot io>
|
||||
"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("g:loaded_syntastic_c_ycm_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_c_ycm_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_ycm_IsAvailable()
|
||||
return exists('g:loaded_youcompleteme')
|
||||
endfunction
|
||||
|
||||
if !exists('g:loaded_youcompleteme')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_ycm_GetLocList()
|
||||
return youcompleteme#CurrentFileDiagnostics()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'ycm'})
|
44
sources_non_forked/syntastic/syntax_checkers/co/coco.vim
Normal file
44
sources_non_forked/syntastic/syntax_checkers/co/coco.vim
Normal file
@ -0,0 +1,44 @@
|
||||
"============================================================================
|
||||
"File: co.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Andrew Kelley <superjoe30@gmail.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("g:loaded_syntastic_co_coco_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_co_coco_checker=1
|
||||
|
||||
"bail if the user doesnt have coco installed
|
||||
if !executable("coco")
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_co_coco_GetLocList()
|
||||
return executable('coco')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_co_coco_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coco',
|
||||
\ 'args': '-c -o /tmp',
|
||||
\ 'filetype': 'co',
|
||||
\ 'subchecker': 'coco' })
|
||||
|
||||
let errorformat =
|
||||
\ '%EFailed at: %f,' .
|
||||
\ '%ZSyntax%trror: %m on line %l,'.
|
||||
\ '%EFailed at: %f,'.
|
||||
\ '%Z%trror: Parse error on line %l: %m'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'co',
|
||||
\ 'name': 'coco'})
|
@ -0,0 +1,48 @@
|
||||
"============================================================================
|
||||
"File: coffee.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Lincoln Stoll <l@lds.li>
|
||||
"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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" Note: this script requires CoffeeScript version 1.6.2 or newer.
|
||||
"
|
||||
if exists("g:loaded_syntastic_coffee_coffee_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coffee_coffee_checker=1
|
||||
|
||||
function! SyntaxCheckers_coffee_coffee_IsAvailable()
|
||||
return executable("coffee") &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('coffee --version 2>' . syntastic#util#DevNull()), [1,6,2])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coffee_coffee_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coffee',
|
||||
\ 'args': '-cp',
|
||||
\ 'filetype': 'coffee',
|
||||
\ 'subchecker': 'coffee' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: %trror: %m,' .
|
||||
\ 'Syntax%trror: In %f\, %m on line %l,' .
|
||||
\ '%EError: In %f\, Parse error on line %l: %m,' .
|
||||
\ '%EError: In %f\, %m on line %l,' .
|
||||
\ '%W%f(%l): lint warning: %m,' .
|
||||
\ '%W%f(%l): warning: %m,' .
|
||||
\ '%E%f(%l): SyntaxError: %m,' .
|
||||
\ '%-Z%p^,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'coffee',
|
||||
\ 'name': 'coffee'})
|
@ -0,0 +1,38 @@
|
||||
"============================================================================
|
||||
"File: coffeelint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Lincoln Stoll <l@lds.li>
|
||||
"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("g:loaded_syntastic_coffee_coffeelint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coffee_coffeelint_checker=1
|
||||
|
||||
function! SyntaxCheckers_coffee_coffeelint_IsAvailable()
|
||||
return executable('coffeelint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coffee_coffeelint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coffeelint',
|
||||
\ 'args': '--csv',
|
||||
\ 'filetype': 'coffee',
|
||||
\ 'subchecker': 'coffeelint' })
|
||||
|
||||
let errorformat = '%f\,%l\,%trror\,%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'coffee',
|
||||
\ 'name': 'coffeelint'})
|
40
sources_non_forked/syntastic/syntax_checkers/coq/coqtop.vim
Normal file
40
sources_non_forked/syntastic/syntax_checkers/coq/coqtop.vim
Normal file
@ -0,0 +1,40 @@
|
||||
"============================================================================
|
||||
"File: coqtop.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Matvey Aksenov <matvey.aksenov 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("g:loaded_syntastic_coq_coqtop_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_coq_coqtop_checker=1
|
||||
|
||||
function! SyntaxCheckers_coq_coqtop_IsAvailable()
|
||||
return executable('coqtop')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coq_coqtop_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coqtop',
|
||||
\ 'args': '-noglob -batch -load-vernac-source',
|
||||
\ 'filetype': 'coq',
|
||||
\ 'subchecker': 'coqtop' })
|
||||
|
||||
let errorformat =
|
||||
\ '%AFile \"%f\"\, line %l\, characters %c\-%.%#\:,'.
|
||||
\ '%C%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'coq',
|
||||
\ 'name': 'coqtop'})
|
65
sources_non_forked/syntastic/syntax_checkers/cpp/cpplint.vim
Normal file
65
sources_non_forked/syntastic/syntax_checkers/cpp/cpplint.vim
Normal file
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: cpplint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" For details about cpplint see:
|
||||
" https://code.google.com/p/google-styleguide/
|
||||
"
|
||||
" Checker options:
|
||||
"
|
||||
" - g:syntastic_cpp_cpplint_thres (integer; default: 5)
|
||||
" error threshold: policy violations with a severity above this
|
||||
" value are highlighted as errors, the others are warnings
|
||||
"
|
||||
" - g:syntastic_cpp_cpplint_args (string; default: '--verbose=3')
|
||||
" command line options to pass to cpplint
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_cpplint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_cpplint_checker = 1
|
||||
|
||||
if !exists('g:syntastic_cpp_cpplint_thres')
|
||||
let g:syntastic_cpp_cpplint_thres = 5
|
||||
endif
|
||||
|
||||
if ! exists('g:syntastic_cpp_cpplint_args')
|
||||
let g:syntastic_cpp_cpplint_args = '--verbose=3'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_cpplint_IsAvailable()
|
||||
return executable('cpplint.py')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cpp_cpplint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'cpplint.py',
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'subchecker': 'cpplint' })
|
||||
|
||||
let errorformat = '%A%f:%l: %m [%t],%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style' })
|
||||
|
||||
" change error types according to the prescribed threshold
|
||||
for n in range(len(loclist))
|
||||
let loclist[n]['type'] = loclist[n]['type'] < g:syntastic_cpp_cpplint_thres ? 'W' : 'E'
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'cpplint'})
|
179
sources_non_forked/syntastic/syntax_checkers/cpp/gcc.vim
Normal file
179
sources_non_forked/syntastic/syntax_checkers/cpp/gcc.vim
Normal file
@ -0,0 +1,179 @@
|
||||
"============================================================================
|
||||
"File: cpp.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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_cpp_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_cpp_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_cpp_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_cpp_includes. Then the header files are being re-checked
|
||||
" on the next file write.
|
||||
"
|
||||
" let g:syntastic_cpp_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_cpp_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_cpp_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" gcc command line you can add those to the global variable
|
||||
" g:syntastic_cpp_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_cpp_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_cpp_compiler_options':
|
||||
"
|
||||
" let g:syntastic_cpp_compiler_options = ' -std=c++0x'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_cpp_config_file' allows you to define
|
||||
" a file that contains additional compiler arguments like include directories
|
||||
" or CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_cpp_config':
|
||||
"
|
||||
" let g:syntastic_cpp_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can
|
||||
" specify whether errors of files included via the
|
||||
" g:syntastic_cpp_include_dirs' setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_cpp_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_cpp_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_cpp_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to g++)
|
||||
"
|
||||
" let g:syntastic_cpp_compiler = 'clang++'
|
||||
|
||||
if exists('g:loaded_syntastic_cpp_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_cpp_compiler')
|
||||
let g:syntastic_cpp_compiler = 'g++'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_gcc_IsAvailable()
|
||||
return executable(g:syntastic_cpp_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_cpp_compiler_options')
|
||||
let g:syntastic_cpp_compiler_options = ''
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_cpp_config_file')
|
||||
let g:syntastic_cpp_config_file = '.syntastic_cpp_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_gcc_GetLocList()
|
||||
let makeprg = g:syntastic_cpp_compiler . ' -x c++ -fsyntax-only '
|
||||
let errorformat =
|
||||
\ '%-G%f:%s:,' .
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,'.
|
||||
\ '%f:%l: %trror: %m,'.
|
||||
\ '%f:%l: %tarning: %m,'.
|
||||
\ '%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_cpp_errorformat')
|
||||
let errorformat = g:syntastic_cpp_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_cpp_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('cpp')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.\(h\|hpp\|hh\)$'
|
||||
if exists('g:syntastic_cpp_check_header')
|
||||
let makeprg = g:syntastic_cpp_compiler .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . g:syntastic_cpp_compiler_options .
|
||||
\ ' ' . syntastic#c#GetNullDevice() .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('cpp')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_cpp_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_cpp_no_include_search') ||
|
||||
\ g:syntastic_cpp_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_cpp_auto_refresh_includes') &&
|
||||
\ g:syntastic_cpp_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_cpp_includes')
|
||||
let b:syntastic_cpp_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_cpp_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_cpp_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_cpp_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_cpp_remove_include_errors') &&
|
||||
\ g:syntastic_cpp_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
36
sources_non_forked/syntastic/syntax_checkers/cpp/oclint.vim
Normal file
36
sources_non_forked/syntastic/syntax_checkers/cpp/oclint.vim
Normal file
@ -0,0 +1,36 @@
|
||||
"============================================================================
|
||||
"File: oclint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_oclint_config':
|
||||
"
|
||||
" let g:syntastic_oclint_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_cpp_oclint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_oclint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_cpp_oclint_IsAvailable()
|
||||
return SyntaxCheckers_c_oclint_IsAvailable()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cpp_oclint_GetLocList()
|
||||
return SyntaxCheckers_c_oclint_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'oclint'})
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
34
sources_non_forked/syntastic/syntax_checkers/cpp/ycm.vim
Normal file
34
sources_non_forked/syntastic/syntax_checkers/cpp/ycm.vim
Normal file
@ -0,0 +1,34 @@
|
||||
"============================================================================
|
||||
"File: ycm.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Val Markovic <val at markovic dot io>
|
||||
"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("g:loaded_syntastic_cpp_ycm_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cpp_ycm_checker = 1
|
||||
|
||||
function! SyntaxCheckers_cpp_ycm_IsAvailable()
|
||||
return SyntaxCheckers_c_ycm_IsAvailable()
|
||||
endfunction
|
||||
|
||||
if !exists('g:loaded_youcompleteme')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_ycm_GetLocList()
|
||||
return SyntaxCheckers_c_ycm_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'ycm'})
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
39
sources_non_forked/syntastic/syntax_checkers/cs/mcs.vim
Normal file
39
sources_non_forked/syntastic/syntax_checkers/cs/mcs.vim
Normal file
@ -0,0 +1,39 @@
|
||||
"============================================================================
|
||||
"File: cs.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Daniel Walker <dwalker@fifo99.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("g:loaded_syntastic_cs_mcs_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cs_mcs_checker=1
|
||||
|
||||
function! SyntaxCheckers_cs_mcs_IsAvailable()
|
||||
return executable('mcs')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cs_mcs_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'mcs',
|
||||
\ 'args': '--parse',
|
||||
\ 'filetype': 'cs',
|
||||
\ 'subchecker': 'mcs' })
|
||||
|
||||
let errorformat = '%f(%l\,%c): %trror %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cs',
|
||||
\ 'name': 'mcs'})
|
54
sources_non_forked/syntastic/syntax_checkers/css/csslint.vim
Normal file
54
sources_non_forked/syntastic/syntax_checkers/css/csslint.vim
Normal file
@ -0,0 +1,54 @@
|
||||
"============================================================================
|
||||
"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.
|
||||
"============================================================================
|
||||
"
|
||||
" Specify additional options to csslint with this option. e.g. to disable
|
||||
" warnings:
|
||||
"
|
||||
" let g:syntastic_csslint_options = "--warnings=none"
|
||||
|
||||
if exists("g:loaded_syntastic_css_csslint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_css_csslint_checker=1
|
||||
|
||||
if !exists('g:syntastic_csslint_options')
|
||||
let g:syntastic_csslint_options = ""
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_css_csslint_IsAvailable()
|
||||
return executable('csslint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_css_csslint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'csslint',
|
||||
\ 'args': '--format=compact ' . g:syntastic_csslint_options,
|
||||
\ 'filetype': 'css',
|
||||
\ 'subchecker': 'csslint' })
|
||||
|
||||
" Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
|
||||
let errorformat =
|
||||
\ '%-G,' .
|
||||
\ '%-G%f: lint free!,' .
|
||||
\ '%f: line %l\, col %c\, %trror - %m,' .
|
||||
\ '%f: line %l\, col %c\, %tarning - %m,'.
|
||||
\ '%f: line %l\, col %c\, %m,'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'css',
|
||||
\ 'name': 'csslint'})
|
33
sources_non_forked/syntastic/syntax_checkers/css/phpcs.vim
Normal file
33
sources_non_forked/syntastic/syntax_checkers/css/phpcs.vim
Normal file
@ -0,0 +1,33 @@
|
||||
"============================================================================
|
||||
"File: phpcs.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" See here for details of phpcs
|
||||
" - phpcs (see http://pear.php.net/package/PHP_CodeSniffer)
|
||||
"
|
||||
if exists("g:loaded_syntastic_css_phpcs_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_css_phpcs_checker=1
|
||||
|
||||
function! SyntaxCheckers_css_phpcs_IsAvailable()
|
||||
return SyntaxCheckers_php_phpcs_IsAvailable()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_css_phpcs_GetLocList()
|
||||
return SyntaxCheckers_php_phpcs_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'css',
|
||||
\ 'name': 'phpcs'})
|
||||
|
||||
runtime! syntax_checkers/php/*.vim
|
@ -0,0 +1,62 @@
|
||||
"============================================================================
|
||||
"File: prettycss.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" For details about PrettyCSS see:
|
||||
"
|
||||
" - http://fidian.github.io/PrettyCSS/
|
||||
" - https://github.com/fidian/PrettyCSS
|
||||
|
||||
if exists("g:loaded_syntastic_css_prettycss_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_css_prettycss_checker=1
|
||||
|
||||
function! SyntaxCheckers_css_prettycss_IsAvailable()
|
||||
return executable('prettycss')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item["text"], ' (\zs[^)]\+\ze)$')
|
||||
if term != ''
|
||||
let term = '\V' . term
|
||||
endif
|
||||
return term
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_css_prettycss_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'prettycss',
|
||||
\ 'filetype': 'css',
|
||||
\ 'subchecker': 'prettycss' })
|
||||
|
||||
" Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
|
||||
let errorformat =
|
||||
\ '%EError: %m\, line %l\, char %c),' .
|
||||
\ '%WWarning: %m\, line %l\, char %c),' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'postprocess': ['sort'] })
|
||||
|
||||
for n in range(len(loclist))
|
||||
let loclist[n]["text"] .= ')'
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'css',
|
||||
\ 'name': 'prettycss'})
|
@ -0,0 +1,42 @@
|
||||
"============================================================================
|
||||
"File: cucumber.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_cucumber_cucumber_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cucumber_cucumber_checker=1
|
||||
|
||||
function! SyntaxCheckers_cucumber_cucumber_IsAvailable()
|
||||
return executable('cucumber')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cucumber_cucumber_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'cucumber',
|
||||
\ 'args': '--dry-run --quiet --strict --format pretty',
|
||||
\ 'filetype': 'cucumber',
|
||||
\ 'subchecker': 'cucumber' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l:%c:%m,' .
|
||||
\ '%W %.%# (%m),' .
|
||||
\ '%-Z%f:%l:%.%#,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cucumber',
|
||||
\ 'name': 'cucumber'})
|
72
sources_non_forked/syntastic/syntax_checkers/cuda/nvcc.vim
Normal file
72
sources_non_forked/syntastic/syntax_checkers/cuda/nvcc.vim
Normal file
@ -0,0 +1,72 @@
|
||||
"============================================================================
|
||||
"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
|
||||
|
||||
" By default, nvcc and thus syntastic, defaults to the most basic architecture.
|
||||
" This can produce false errors if the developer intends to compile for newer
|
||||
" hardware and use newer features, eg. double precision numbers. To pass a
|
||||
" specific target arch to nvcc, e.g. add the following to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_cuda_arch = "sm_20"
|
||||
|
||||
|
||||
if exists("g:loaded_syntastic_cuda_nvcc_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_cuda_nvcc_checker=1
|
||||
|
||||
function! SyntaxCheckers_cuda_nvcc_IsAvailable()
|
||||
return executable('nvcc')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cuda_nvcc_GetLocList()
|
||||
if exists('g:syntastic_cuda_arch')
|
||||
let arch_flag = '-arch=' . g:syntastic_cuda_arch
|
||||
else
|
||||
let arch_flag = ''
|
||||
endif
|
||||
let makeprg =
|
||||
\ 'nvcc ' . arch_flag . ' --cuda -O0 -I . -Xcompiler -fsyntax-only ' .
|
||||
\ syntastic#util#shexpand('%') . ' ' . syntastic#c#GetNullDevice()
|
||||
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 ; ' .
|
||||
\ 'nvcc ' . arch_flag . ' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include ' .
|
||||
\ syntastic#util#shexpand('%') . ' ' . syntastic#c#GetNullDevice()
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cuda',
|
||||
\ 'name': 'nvcc'})
|
177
sources_non_forked/syntastic/syntax_checkers/d/dmd.vim
Normal file
177
sources_non_forked/syntastic/syntax_checkers/d/dmd.vim
Normal file
@ -0,0 +1,177 @@
|
||||
"============================================================================
|
||||
"File: d.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Alfredo Di Napoli <alfredo dot dinapoli at gmail dot com>
|
||||
"License: Based on the original work of Gregor Uhlenheuer and his
|
||||
" cpp.vim checker so credits are dued.
|
||||
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
" OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
" HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
" WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
" OTHER DEALINGS IN THE SOFTWARE.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_d_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_d_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_d_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_d_includes. Then the header files are being re-checked
|
||||
" on the next file write.
|
||||
"
|
||||
" let g:syntastic_d_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_d_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_d_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" dmd command line you can add those to the global variable
|
||||
" g:syntastic_d_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_d_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_d_compiler_options':
|
||||
"
|
||||
" let g:syntastic_d_compiler_options = ' -std=c++0x'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_d_config_file' allows you to define
|
||||
" a file that contains additional compiler arguments like include directories
|
||||
" or CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_d_config':
|
||||
"
|
||||
" let g:syntastic_d_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_d_remove_include_errors' you can
|
||||
" specify whether errors of files included via the
|
||||
" g:syntastic_d_include_dirs' setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_d_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_d_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_d_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to dmd)
|
||||
"
|
||||
" let g:syntastic_d_compiler = 'clang++'
|
||||
|
||||
if exists('g:loaded_syntastic_d_dmd_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_d_dmd_checker = 1
|
||||
|
||||
if !exists('g:syntastic_d_compiler')
|
||||
let g:syntastic_d_compiler = 'dmd'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_d_dmd_IsAvailable()
|
||||
return executable(g:syntastic_d_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_d_compiler_options')
|
||||
let g:syntastic_d_compiler_options = ''
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_d_config_file')
|
||||
let g:syntastic_d_config_file = '.syntastic_d_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_d_dmd_GetLocList()
|
||||
let makeprg = g:syntastic_d_compiler . ' -c -of' . syntastic#util#DevNull() . ' '
|
||||
let errorformat = '%-G%f:%s:,%f(%l): %m,%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_d_errorformat')
|
||||
let errorformat = g:syntastic_d_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_d_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('d')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.di$'
|
||||
if exists('g:syntastic_d_check_header')
|
||||
let makeprg = g:syntastic_d_compiler .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' -of' . syntastic#util#DevNull() .
|
||||
\ ' ' . g:syntastic_d_compiler_options .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('d')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_d_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_d_no_include_search') ||
|
||||
\ g:syntastic_d_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_d_auto_refresh_includes') &&
|
||||
\ g:syntastic_d_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_d_includes')
|
||||
let b:syntastic_d_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_d_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_d_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_d_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_d_remove_include_errors') &&
|
||||
\ g:syntastic_d_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'd',
|
||||
\ 'name': 'dmd'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,66 @@
|
||||
"============================================================================
|
||||
"File: dart_analyzer.vim
|
||||
"Description: Dart syntax checker - using dart_analyzer
|
||||
"Maintainer: Maksim Ryzhikov <rv.maksim 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("g:loaded_syntastic_dart_dart_analyzer_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_dart_dart_analyzer_checker=1
|
||||
|
||||
if !exists("g:syntastic_dart_analyzer_conf")
|
||||
let g:syntastic_dart_analyzer_conf = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_dart_dart_analyzer_IsAvailable()
|
||||
return executable("dart_analyzer")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_dart_dart_analyzer_GetHighlightRegex(error)
|
||||
let lcol = a:error['col'] - 1
|
||||
let rcol = a:error['nr'] + lcol + 1
|
||||
|
||||
return '\%>'.lcol.'c\%<'.rcol.'c'
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_dart_dart_analyzer_GetLocList()
|
||||
let args = !empty(g:syntastic_dart_analyzer_conf) ? ' ' . g:syntastic_dart_analyzer_conf : ''
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'dart_analyzer',
|
||||
\ 'args': '--error_format machine',
|
||||
\ 'post_args': args,
|
||||
\ 'filetype': 'dart',
|
||||
\ 'subchecker': 'dart_analyzer' })
|
||||
|
||||
" Machine readable format looks like:
|
||||
" SEVERITY|TYPE|ERROR_CODE|file:FILENAME|LINE_NUMBER|COLUMN|LENGTH|MESSAGE
|
||||
" SEVERITY: (WARNING|ERROR)
|
||||
" TYPE: (RESOLVER|STATIC_TYPE|...)
|
||||
" ERROR_CODE: (NO_SUCH_TYPE|...)
|
||||
" FILENAME: String
|
||||
" LINE_NUMBER: int
|
||||
" COLUMN: int
|
||||
" LENGHT: int
|
||||
" MESSAGE: String
|
||||
|
||||
" We use %n to grab the error length to be able to access it in the matcher.
|
||||
let commonformat = '|%.%#|%.%#|file:%f|%l|%c|%n|%m'
|
||||
|
||||
" TODO(amouravski): simply take everything after ERROR|WARNING as a message
|
||||
" and then parse it by hand later.
|
||||
let errorformat = '%EERROR'.l:commonformat.','.
|
||||
\'%WWARNING'.l:commonformat
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'dart',
|
||||
\ 'name': 'dart_analyzer'})
|
@ -0,0 +1,30 @@
|
||||
"============================================================================
|
||||
"File: docbk.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_docbk_xmllint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_docbk_xmllint_checker=1
|
||||
|
||||
function! SyntaxCheckers_docbk_xmllint_IsAvailable()
|
||||
return SyntaxCheckers_xml_xmllint_IsAvailable()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_docbk_xmllint_GetLocList()
|
||||
return SyntaxCheckers_xml_xmllint_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'docbk',
|
||||
\ 'name': 'xmllint'})
|
||||
|
||||
runtime! syntax_checkers/xml/*.vim
|
@ -0,0 +1,45 @@
|
||||
"============================================================================
|
||||
"File: elixir.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Richard Ramsden <rramsden 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("g:loaded_syntastic_elixir_elixir_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_elixir_elixir_checker=1
|
||||
|
||||
" TODO: we should probably split this into separate checkers
|
||||
function! SyntaxCheckers_elixir_elixir_IsAvailable()
|
||||
return executable('elixir') && executable('mix')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_elixir_elixir_GetLocList()
|
||||
|
||||
let make_options = {}
|
||||
let compile_command = 'elixir'
|
||||
let mix_file = syntastic#util#findInParent('mix.exs', expand('%:p:h'))
|
||||
|
||||
if filereadable(mix_file)
|
||||
let compile_command = 'mix compile'
|
||||
let make_options['cwd'] = fnamemodify(mix_file, ':p:h')
|
||||
endif
|
||||
|
||||
let make_options['makeprg'] = syntastic#makeprg#build({
|
||||
\ 'exe': compile_command,
|
||||
\ 'filetype': 'elixir',
|
||||
\ 'subchecker': 'elixir' })
|
||||
|
||||
let make_options['errorformat'] = '** %*[^\ ] %f:%l: %m'
|
||||
|
||||
return SyntasticMake(make_options)
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'elixir',
|
||||
\ 'name': 'elixir'})
|
@ -0,0 +1,51 @@
|
||||
"============================================================================
|
||||
"File: erlang.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Pawel Salata <rockplayer.pl 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("g:loaded_syntastic_erlang_erlang_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_erlang_erlang_checker=1
|
||||
|
||||
let s:check_file = expand('<sfile>:p:h') . '/erlang_check_file.erl'
|
||||
if !exists("g:syntastic_erlc_include_path")
|
||||
let g:syntastic_erlc_include_path=""
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_erlang_escript_IsAvailable()
|
||||
return executable('escript')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_erlang_escript_GetLocList()
|
||||
let extension = expand('%:e')
|
||||
if match(extension, 'hrl') >= 0
|
||||
return []
|
||||
endif
|
||||
let shebang = getbufline(bufnr('%'), 1)[0]
|
||||
if len(shebang) > 0
|
||||
if match(shebang, 'escript') >= 0
|
||||
let makeprg = 'escript -s ' . syntastic#util#shexpand('%:p')
|
||||
else
|
||||
let makeprg = 'escript ' . s:check_file . ' ' . syntastic#util#shexpand('%:p') . ' ' . g:syntastic_erlc_include_path
|
||||
endif
|
||||
else
|
||||
let makeprg = 'escript ' . s:check_file . ' ' . syntastic#util#shexpand('%:p') . ' '. g:syntastic_erlc_include_path
|
||||
endif
|
||||
let errorformat =
|
||||
\ '%f:%l:\ %tarning:\ %m,'.
|
||||
\ '%E%f:%l:\ %m'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'erlang',
|
||||
\ 'name': 'escript'})
|
34
sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl
Executable file
34
sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl
Executable file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env escript
|
||||
-export([main/1]).
|
||||
|
||||
main([FileName]) ->
|
||||
LibDirs = filelib:wildcard("{lib,deps}/*/ebin"),
|
||||
compile(FileName, LibDirs);
|
||||
main([FileName | LibDirs]) ->
|
||||
compile(FileName, LibDirs).
|
||||
|
||||
compile(FileName, LibDirs) ->
|
||||
Root = get_root(filename:dirname(FileName)),
|
||||
ok = code:add_pathsa(LibDirs),
|
||||
compile:file(FileName, [warn_obsolete_guard,
|
||||
warn_unused_import,
|
||||
warn_shadow_vars,
|
||||
warn_export_vars,
|
||||
strong_validation,
|
||||
report,
|
||||
{i, filename:join(Root, "include")},
|
||||
{i, filename:join(Root, "deps")},
|
||||
{i, filename:join(Root, "apps")},
|
||||
{i, filename:join(Root, "lib")}
|
||||
]).
|
||||
|
||||
get_root(Dir) ->
|
||||
Path = filename:split(filename:absname(Dir)),
|
||||
filename:join(get_root(lists:reverse(Path), Path)).
|
||||
|
||||
get_root([], Path) ->
|
||||
Path;
|
||||
get_root(["src" | Tail], _Path) ->
|
||||
lists:reverse(Tail);
|
||||
get_root([_ | Tail], Path) ->
|
||||
get_root(Tail, Path).
|
65
sources_non_forked/syntastic/syntax_checkers/eruby/ruby.vim
Normal file
65
sources_non_forked/syntastic/syntax_checkers/eruby/ruby.vim
Normal file
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: ruby.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_eruby_ruby_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_eruby_ruby_checker=1
|
||||
|
||||
if !exists("g:syntastic_ruby_exec")
|
||||
let g:syntastic_ruby_exec = "ruby"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_eruby_ruby_IsAvailable()
|
||||
return executable(expand(g:syntastic_ruby_exec))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_eruby_ruby_GetLocList()
|
||||
let exe = expand(g:syntastic_ruby_exec)
|
||||
if !has('win32')
|
||||
let exe = 'RUBYOPT= ' . exe
|
||||
endif
|
||||
|
||||
let fname = "'" . escape(expand('%'), "\\'") . "'"
|
||||
|
||||
" TODO: encodings became useful in ruby 1.9 :)
|
||||
if syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('ruby --version'), [1, 9])
|
||||
let enc = &fileencoding != '' ? &fileencoding : &encoding
|
||||
let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"'
|
||||
else
|
||||
let encoding_spec = ''
|
||||
endif
|
||||
|
||||
"gsub fixes issue #7, rails has it's own eruby syntax
|
||||
let makeprg =
|
||||
\ exe . ' -rerb -e ' .
|
||||
\ syntastic#util#shescape('puts ERB.new(File.read(' .
|
||||
\ fname . encoding_spec .
|
||||
\ ').gsub(''<\%='',''<\%''), nil, ''-'').src') .
|
||||
\ ' \| ' . exe . ' -c'
|
||||
|
||||
let errorformat =
|
||||
\ '%-GSyntax OK,'.
|
||||
\ '%E-:%l: syntax error\, %m,%Z%p^,'.
|
||||
\ '%W-:%l: warning: %m,'.
|
||||
\ '%Z%p^,'.
|
||||
\ '%-C%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': { 'bufnr': bufnr(""), 'vcol': 1 } })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'eruby',
|
||||
\ 'name': 'ruby'})
|
@ -0,0 +1,63 @@
|
||||
"============================================================================
|
||||
"File: fortran.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net>
|
||||
"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.
|
||||
"Note: This syntax checker uses gfortran with the option -fsyntax-only
|
||||
" to check for errors and warnings. Additional flags may be
|
||||
" supplied through both local and global variables,
|
||||
" b:syntastic_fortran_flags,
|
||||
" g:syntastic_fortran_flags.
|
||||
" This is particularly useful when the source requires module files
|
||||
" in order to compile (that is when it needs modules defined in
|
||||
" separate files).
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_fortran_gfortran_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_fortran_gfortran_checker=1
|
||||
|
||||
if !exists('g:syntastic_fortran_flags')
|
||||
let g:syntastic_fortran_flags = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_fortran_gfortran_IsAvailable()
|
||||
return executable('gfortran')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_fortran_gfortran_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'gfortran',
|
||||
\ 'args': s:args(),
|
||||
\ 'filetype': 'fortran',
|
||||
\ 'subchecker': 'gfortran' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-C %#,'.
|
||||
\ '%-C %#%.%#,'.
|
||||
\ '%A%f:%l.%c:,'.
|
||||
\ '%Z%m,'.
|
||||
\ '%G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
function s:args()
|
||||
let rv = '-fsyntax-only ' . g:syntastic_fortran_flags
|
||||
if exists('b:syntastic_fortran_flags')
|
||||
let rv .= " " . b:syntastic_fortran_flags
|
||||
endif
|
||||
return rv
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'fortran',
|
||||
\ 'name': 'gfortran'})
|
75
sources_non_forked/syntastic/syntax_checkers/go/go.vim
Normal file
75
sources_non_forked/syntastic/syntax_checkers/go/go.vim
Normal file
@ -0,0 +1,75 @@
|
||||
"============================================================================
|
||||
"File: go.vim
|
||||
"Description: Check go syntax using 'gofmt -l' followed by 'go [build|test]'
|
||||
"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
|
||||
"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.
|
||||
"
|
||||
" This syntax checker does not reformat your source code.
|
||||
" Use a BufWritePre autocommand to that end:
|
||||
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_go_go_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_go_checker=1
|
||||
|
||||
function! SyntaxCheckers_go_go_IsAvailable()
|
||||
return executable('go')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_go_GetLocList()
|
||||
" Check with gofmt first, since `go build` and `go test` might not report
|
||||
" syntax errors in the current file if another file with syntax error is
|
||||
" compiled first.
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'gofmt',
|
||||
\ 'args': '-l',
|
||||
\ 'tail': '1>' . syntastic#util#DevNull(),
|
||||
\ 'filetype': 'go',
|
||||
\ 'subchecker': 'go' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let errors = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
if !empty(errors)
|
||||
return errors
|
||||
endif
|
||||
|
||||
" Test files, i.e. files with a name ending in `_test.go`, are not
|
||||
" compiled by `go build`, therefore `go test` must be called for those.
|
||||
if match(expand('%'), '_test.go$') == -1
|
||||
let makeprg = 'go build ' . syntastic#c#GetNullDevice()
|
||||
else
|
||||
let makeprg = 'go test -c ' . syntastic#c#GetNullDevice()
|
||||
endif
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l:%c:%m,' .
|
||||
\ '%f:%l%m,' .
|
||||
\ '%-G#%.%#'
|
||||
|
||||
" The go compiler needs to either be run with an import path as an
|
||||
" argument or directly from the package directory. Since figuring out
|
||||
" the proper import path is fickle, just cwd to the package.
|
||||
|
||||
let errors = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h'),
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
|
||||
return errors
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'go',
|
||||
\ 'name': 'go'})
|
42
sources_non_forked/syntastic/syntax_checkers/go/gofmt.vim
Normal file
42
sources_non_forked/syntastic/syntax_checkers/go/gofmt.vim
Normal file
@ -0,0 +1,42 @@
|
||||
"============================================================================
|
||||
"File: gofmt.vim
|
||||
"Description: Check go syntax using 'gofmt -l'
|
||||
"Maintainer: Brandon Thomson <bt@brandonthomson.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.
|
||||
"
|
||||
" This syntax checker does not reformat your source code.
|
||||
" Use a BufWritePre autocommand to that end:
|
||||
" autocmd FileType go autocmd BufWritePre <buffer> Fmt
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_go_gofmt_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_gofmt_checker=1
|
||||
|
||||
function! SyntaxCheckers_go_gofmt_IsAvailable()
|
||||
return executable('gofmt')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_gofmt_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'gofmt',
|
||||
\ 'args': '-l',
|
||||
\ 'tail': '1>' . syntastic#util#DevNull(),
|
||||
\ 'filetype': 'go',
|
||||
\ 'subchecker': 'gofmt' })
|
||||
|
||||
let errorformat = '%f:%l:%c: %m,%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'type': 'e'} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'go',
|
||||
\ 'name': 'gofmt'})
|
37
sources_non_forked/syntastic/syntax_checkers/go/golint.vim
Normal file
37
sources_non_forked/syntastic/syntax_checkers/go/golint.vim
Normal file
@ -0,0 +1,37 @@
|
||||
"============================================================================
|
||||
"File: golint.vim
|
||||
"Description: Check go syntax using 'golint'
|
||||
"Maintainer: Hiroshi Ioka <hirochachacha@gmail.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("g:loaded_syntastic_go_golint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_golint_checker=1
|
||||
|
||||
function! SyntaxCheckers_go_golint_IsAvailable()
|
||||
return executable('golint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_golint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'golint',
|
||||
\ 'filetype': 'go',
|
||||
\ 'subchecker': 'golint' })
|
||||
|
||||
let errorformat = '%f:%l:%c: %m,%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'go',
|
||||
\ 'name': 'golint'})
|
40
sources_non_forked/syntastic/syntax_checkers/go/govet.vim
Normal file
40
sources_non_forked/syntastic/syntax_checkers/go/govet.vim
Normal file
@ -0,0 +1,40 @@
|
||||
"============================================================================
|
||||
"File: govet.vim
|
||||
"Description: Perform static analysis of Go code with the vet tool
|
||||
"Maintainer: Kamil Kisiel <kamil@kamilkisiel.net>
|
||||
"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("g:loaded_syntastic_go_govet_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_go_govet_checker=1
|
||||
|
||||
function! SyntaxCheckers_go_govet_IsAvailable()
|
||||
return executable('go')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_govet_GetLocList()
|
||||
let makeprg = 'go vet'
|
||||
let errorformat = '%Evet: %.%\+: %f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
|
||||
|
||||
" The go compiler needs to either be run with an import path as an
|
||||
" argument or directly from the package directory. Since figuring out
|
||||
" the proper import path is fickle, just cwd to the package.
|
||||
|
||||
let errors = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': expand('%:p:h'),
|
||||
\ 'defaults': {'type': 'w'} })
|
||||
|
||||
return errors
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'go',
|
||||
\ 'name': 'govet'})
|
45
sources_non_forked/syntastic/syntax_checkers/haml/haml.vim
Normal file
45
sources_non_forked/syntastic/syntax_checkers/haml/haml.vim
Normal file
@ -0,0 +1,45 @@
|
||||
"============================================================================
|
||||
"File: haml.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_haml_haml_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haml_haml_checker=1
|
||||
|
||||
if !exists("g:syntastic_haml_interpreter")
|
||||
let g:syntastic_haml_interpreter = "haml"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_haml_haml_IsAvailable()
|
||||
return executable(g:syntastic_haml_interpreter)
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haml_haml_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': g:syntastic_haml_interpreter,
|
||||
\ 'args': '-c',
|
||||
\ 'filetype': 'haml',
|
||||
\ 'subchecker': 'haml' })
|
||||
|
||||
let errorformat =
|
||||
\ 'Haml error on line %l: %m,' .
|
||||
\ 'Syntax error on line %l: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haml',
|
||||
\ 'name': 'haml'})
|
@ -0,0 +1,47 @@
|
||||
"============================================================================
|
||||
"File: ghc-mod.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Anthony Carapetis <anthony.carapetis 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("g:loaded_syntastic_haskell_ghc_mod_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_ghc_mod_checker=1
|
||||
|
||||
function! SyntaxCheckers_haskell_ghc_mod_IsAvailable()
|
||||
return executable('ghc-mod')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haskell_ghc_mod_GetLocList()
|
||||
let errorformat =
|
||||
\ '%-G%\s%#,' .
|
||||
\ '%f:%l:%c:%trror: %m,' .
|
||||
\ '%f:%l:%c:%tarning: %m,'.
|
||||
\ '%f:%l:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c:%m,' .
|
||||
\ '%E%f:%l:%c:,' .
|
||||
\ '%Z%m'
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'ghc-mod check',
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'subchecker': 'ghc_mod' })
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'name': 'ghc_mod'})
|
@ -0,0 +1,46 @@
|
||||
"============================================================================
|
||||
"File: hdevtools.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Anthony Carapetis <anthony.carapetis 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("g:loaded_syntastic_haskell_hdevtools_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_hdevtools_checker=1
|
||||
|
||||
function! SyntaxCheckers_haskell_hdevtools_IsAvailable()
|
||||
return executable('hdevtools')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haskell_hdevtools_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'hdevtools check',
|
||||
\ 'args': get(g:, 'hdevtools_options', ''),
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'subchecker': 'hdevtools' })
|
||||
|
||||
let errorformat= '\%-Z\ %#,'.
|
||||
\ '%W%f:%l:%c:\ Warning:\ %m,'.
|
||||
\ '%E%f:%l:%c:\ %m,'.
|
||||
\ '%E%>%f:%l:%c:,'.
|
||||
\ '%+C\ \ %#%m,'.
|
||||
\ '%W%>%f:%l:%c:,'.
|
||||
\ '%+C\ \ %#%tarning:\ %m,'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['compressWhitespace'] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'name': 'hdevtools'})
|
||||
|
@ -0,0 +1,38 @@
|
||||
"============================================================================
|
||||
"File: hlint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Nicolas Wu <nicolas.wu at gmail dot com>
|
||||
"License: BSD
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_haskell_hlint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_hlint_checker=1
|
||||
|
||||
function! SyntaxCheckers_haskell_hlint_IsAvailable()
|
||||
return executable('hlint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haskell_hlint_GetLocList()
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: Error: %m,' .
|
||||
\ '%W%f:%l:%c: Warning: %m,' .
|
||||
\ '%C%m'
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'hlint',
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'subchecker': 'hlint' })
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['compressWhitespace'] })
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'name': 'hlint'})
|
52
sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim
Normal file
52
sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim
Normal file
@ -0,0 +1,52 @@
|
||||
"============================================================================
|
||||
"File: haxe.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: David Bernard <david.bernard.31 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("g:loaded_syntastic_haxe_haxe_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_haxe_haxe_checker=1
|
||||
|
||||
function! SyntaxCheckers_haxe_haxe_IsAvailable()
|
||||
return executable('haxe')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haxe_haxe_GetLocList()
|
||||
if exists('b:vaxe_hxml')
|
||||
let hxml = b:vaxe_hxml
|
||||
elseif exists('g:vaxe_hxml')
|
||||
let hxml = g:vaxe_hxml
|
||||
else
|
||||
let hxml = syntastic#util#findInParent('*.hxml', expand('%:p:h'))
|
||||
endif
|
||||
let hxml = fnamemodify(hxml, ':p')
|
||||
|
||||
if !empty(hxml)
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'haxe',
|
||||
\ 'fname': syntastic#util#shescape(fnameescape(fnamemodify(hxml, ':t'))),
|
||||
\ 'filetype': 'haxe',
|
||||
\ 'subchecker': 'haxe' })
|
||||
|
||||
let errorformat = '%E%f:%l: characters %c-%*[0-9] : %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'cwd': fnamemodify(hxml, ':h') })
|
||||
endif
|
||||
|
||||
return []
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haxe',
|
||||
\ 'name': 'haxe'})
|
38
sources_non_forked/syntastic/syntax_checkers/hss/hss.vim
Normal file
38
sources_non_forked/syntastic/syntax_checkers/hss/hss.vim
Normal file
@ -0,0 +1,38 @@
|
||||
"============================================================================
|
||||
"File: hss.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Justin Donaldson (jdonaldson@gmail.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("g:loaded_syntastic_hss_hss_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_hss_hss_checker=1
|
||||
|
||||
function! SyntaxCheckers_hss_hss_IsAvailable()
|
||||
return executable('hss')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_hss_hss_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'hss',
|
||||
\ 'args' : '-output ' . syntastic#util#DevNull(),
|
||||
\ 'filetype': 'hss',
|
||||
\ 'subchecker': 'hss' })
|
||||
|
||||
let errorformat = '%E%f:%l: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'hss',
|
||||
\ 'name': 'hss'})
|
174
sources_non_forked/syntastic/syntax_checkers/html/tidy.vim
Normal file
174
sources_non_forked/syntastic/syntax_checkers/html/tidy.vim
Normal file
@ -0,0 +1,174 @@
|
||||
"============================================================================
|
||||
"File: tidy.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" Checker option:
|
||||
"
|
||||
" - g:syntastic_html_tidy_ignore_errors (list; default: [])
|
||||
" list of errors to ignore
|
||||
" - g:syntastic_html_tidy_blocklevel_tags (list; default: [])
|
||||
" list of additional blocklevel tags, to be added to "--new-blocklevel-tags"
|
||||
" - g:syntastic_html_tidy_inline_tags (list; default: [])
|
||||
" list of additional inline tags, to be added to "--new-inline-tags"
|
||||
" - g:syntastic_html_tidy_empty_tags (list; default: [])
|
||||
" list of additional empty tags, to be added to "--new-empty-tags"
|
||||
|
||||
if exists("g:loaded_syntastic_html_tidy_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_tidy_checker = 1
|
||||
|
||||
if !exists('g:syntastic_html_tidy_ignore_errors')
|
||||
let g:syntastic_html_tidy_ignore_errors = []
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_html_tidy_blocklevel_tags')
|
||||
let g:syntastic_html_tidy_blocklevel_tags = []
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_html_tidy_inline_tags')
|
||||
let g:syntastic_html_tidy_inline_tags = []
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_html_tidy_empty_tags')
|
||||
let g:syntastic_html_tidy_empty_tags = []
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_html_tidy_IsAvailable()
|
||||
return executable('tidy')
|
||||
endfunction
|
||||
|
||||
" TODO: join this with xhtml.vim for DRY's sake?
|
||||
function! s:TidyEncOptByFenc()
|
||||
let tidy_opts = {
|
||||
\'utf-8' : '-utf8',
|
||||
\'ascii' : '-ascii',
|
||||
\'latin1' : '-latin1',
|
||||
\'iso-2022-jp' : '-iso-2022',
|
||||
\'cp1252' : '-win1252',
|
||||
\'macroman' : '-mac',
|
||||
\'utf-16le' : '-utf16le',
|
||||
\'utf-16' : '-utf16',
|
||||
\'big5' : '-big5',
|
||||
\'cp932' : '-shiftjis',
|
||||
\'sjis' : '-shiftjis',
|
||||
\'cp850' : '-ibm858',
|
||||
\}
|
||||
return get(tidy_opts, &fileencoding, '-utf8')
|
||||
endfunction
|
||||
|
||||
let s:ignore_errors = [
|
||||
\ "<table> lacks \"summary\" attribute",
|
||||
\ "not approved by W3C",
|
||||
\ "attribute \"placeholder\"",
|
||||
\ "<meta> proprietary attribute \"charset\"",
|
||||
\ "<meta> lacks \"content\" attribute",
|
||||
\ "inserting \"type\" attribute",
|
||||
\ "proprietary attribute \"data-",
|
||||
\ "missing <!DOCTYPE> declaration",
|
||||
\ "inserting implicit <body>",
|
||||
\ "inserting missing 'title' element",
|
||||
\ "attribute \"[+",
|
||||
\ "unescaped & or unknown entity",
|
||||
\ "<input> attribute \"type\" has invalid value \"search\""
|
||||
\ ]
|
||||
|
||||
let s:blocklevel_tags = [
|
||||
\ "main",
|
||||
\ "section",
|
||||
\ "article",
|
||||
\ "aside",
|
||||
\ "hgroup",
|
||||
\ "header",
|
||||
\ "footer",
|
||||
\ "nav",
|
||||
\ "figure",
|
||||
\ "figcaption"
|
||||
\ ]
|
||||
|
||||
let s:inline_tags = [
|
||||
\ "video",
|
||||
\ "audio",
|
||||
\ "source",
|
||||
\ "embed",
|
||||
\ "mark",
|
||||
\ "progress",
|
||||
\ "meter",
|
||||
\ "time",
|
||||
\ "ruby",
|
||||
\ "rt",
|
||||
\ "rp",
|
||||
\ "canvas",
|
||||
\ "command",
|
||||
\ "details",
|
||||
\ "datalist"
|
||||
\ ]
|
||||
|
||||
let s:empty_tags = [
|
||||
\ "wbr",
|
||||
\ "keygen"
|
||||
\ ]
|
||||
|
||||
function! s:IgnoreError(text)
|
||||
for i in s:ignore_errors + g:syntastic_html_tidy_ignore_errors
|
||||
if stridx(a:text, i) != -1
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:NewTags(name)
|
||||
return syntastic#util#shescape(join( s:{a:name} + g:syntastic_html_tidy_{a:name}, ',' ))
|
||||
endfunction
|
||||
|
||||
function s:Args()
|
||||
let args = s:TidyEncOptByFenc() .
|
||||
\ ' --new-blocklevel-tags ' . s:NewTags('blocklevel_tags') .
|
||||
\ ' --new-inline-tags ' . s:NewTags('inline_tags') .
|
||||
\ ' --new-empty-tags ' . s:NewTags('empty_tags') .
|
||||
\ ' -e'
|
||||
return args
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_html_tidy_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'tidy',
|
||||
\ 'args': s:Args(),
|
||||
\ 'tail': '2>&1',
|
||||
\ 'filetype': 'html',
|
||||
\ 'subchecker': 'tidy' })
|
||||
|
||||
let errorformat =
|
||||
\ '%Wline %l column %v - Warning: %m,' .
|
||||
\ '%Eline %l column %v - Error: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'returns': [0, 1, 2] })
|
||||
|
||||
" filter out valid HTML5 from the errors
|
||||
for n in range(len(loclist))
|
||||
if loclist[n]['valid'] && s:IgnoreError(loclist[n]['text']) == 1
|
||||
let loclist[n]['valid'] = 0
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'html',
|
||||
\ 'name': 'tidy'})
|
||||
|
@ -0,0 +1,78 @@
|
||||
"============================================================================
|
||||
"File: validator.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" For detail;s about validator see: http://about.validator.nu/
|
||||
"
|
||||
" Checker options:
|
||||
"
|
||||
" - g:syntastic_html_validator_api (string; default: 'http://validator.nu/')
|
||||
" URL of the service to use for checking; leave it to the default to run the
|
||||
" checks against http://validator.nu/, or set it to 'http://localhost:8888/'
|
||||
" if you're running a local service as per http://about.validator.nu/#src
|
||||
"
|
||||
" - g:syntastic_html_validator_parser (string; default: empty)
|
||||
" parser to use; legal values are: xml, xmldtd, html, html5, html4, html4tr;
|
||||
" set it to 'html5' to check HTML5 files; see the wiki for reference:
|
||||
" http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#parser
|
||||
"
|
||||
" - g:syntastic_html_validator_nsfilter (string; default: empty)
|
||||
" sets the nsfilter for the parser; see the wiki for details:
|
||||
" http://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters#nsfilter
|
||||
|
||||
if exists("g:loaded_syntastic_html_validator_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_validator_checker=1
|
||||
|
||||
if !exists('g:syntastic_html_validator_api')
|
||||
let g:syntastic_html_validator_api = 'http://validator.nu/'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_html_validator_parser')
|
||||
let g:syntastic_html_validator_parser = ''
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_html_validator_nsfilter')
|
||||
let g:syntastic_html_validator_nsfilter = ''
|
||||
endif
|
||||
|
||||
let s:decoder = 'awk -f ' . syntastic#util#shescape(expand('<sfile>:p:h') . '/validator_decode.awk')
|
||||
|
||||
function! SyntaxCheckers_html_validator_IsAvailable()
|
||||
return executable('curl') && executable('awk')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_html_validator_GetLocList()
|
||||
let makeprg = 'curl -s --compressed -F out=gnu -F asciiquotes=yes' .
|
||||
\ (!empty(g:syntastic_html_validator_parser) ? ' -F parser=' . g:syntastic_html_validator_parser : '') .
|
||||
\ (!empty(g:syntastic_html_validator_nsfilter) ? ' -F nsfilter=' . g:syntastic_html_validator_nsfilter : '') .
|
||||
\ ' -F doc=@' . syntastic#util#shexpand('%') . '\;type=text/html\;filename=' . syntastic#util#shexpand('%') . ' ' .
|
||||
\ g:syntastic_html_validator_api . ' \| ' . s:decoder
|
||||
let errorformat =
|
||||
\ '%E"%f":%l: %trror: %m,' .
|
||||
\ '%E"%f":%l-%\d%\+: %trror: %m,' .
|
||||
\ '%E"%f":%l%\%.%c: %trror: %m,' .
|
||||
\ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror: %m,' .
|
||||
\ '%E"%f":%l: %trror fatal: %m,' .
|
||||
\ '%E"%f":%l-%\d%\+: %trror fatal: %m,' .
|
||||
\ '%E"%f":%l%\%.%c: %trror fatal: %m,' .
|
||||
\ '%E"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: %trror fatal: %m,' .
|
||||
\ '%W"%f":%l: info %tarning: %m,' .
|
||||
\ '%W"%f":%l-%\d%\+: info %tarning: %m,' .
|
||||
\ '%W"%f":%l%\%.%c: info %tarning: %m,' .
|
||||
\ '%W"%f":%l%\%.%c-%\d%\+%\%.%\d%\+: info %tarning: %m'
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'html',
|
||||
\ 'name': 'validator'})
|
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/awk -f
|
||||
#============================================================================
|
||||
#File: validator_decode.awk
|
||||
#Description: Helper script for validator.vim
|
||||
#Maintainer: LCD 47 <lcd047 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.
|
||||
#
|
||||
#============================================================================
|
||||
|
||||
BEGIN {
|
||||
FS = OFS = "\""
|
||||
hextab ["0"] = 0; hextab ["8"] = 8;
|
||||
hextab ["1"] = 1; hextab ["9"] = 9;
|
||||
hextab ["2"] = 2; hextab ["A"] = hextab ["a"] = 10
|
||||
hextab ["3"] = 3; hextab ["B"] = hextab ["b"] = 11;
|
||||
hextab ["4"] = 4; hextab ["C"] = hextab ["c"] = 12;
|
||||
hextab ["5"] = 5; hextab ["D"] = hextab ["d"] = 13;
|
||||
hextab ["6"] = 6; hextab ["E"] = hextab ["e"] = 14;
|
||||
hextab ["7"] = 7; hextab ["F"] = hextab ["f"] = 15;
|
||||
}
|
||||
|
||||
function urldecode (url) {
|
||||
decoded = ""
|
||||
i = 1
|
||||
len = length (url)
|
||||
while ( i <= len ) {
|
||||
c = substr (url, i, 1)
|
||||
if ( c == "%" ) {
|
||||
if ( i + 2 <= len ) {
|
||||
c1 = substr (url, i + 1, 1)
|
||||
c2 = substr (url, i + 2, 1)
|
||||
if ( hextab [c1] != "" && hextab [c2] != "" ) {
|
||||
code = 0 + hextab [c1] * 16 + hextab [c2] + 0
|
||||
c = sprintf ("%c", code)
|
||||
}
|
||||
else
|
||||
c = c c1 c2
|
||||
i += 2
|
||||
}
|
||||
else if ( i + 1 <= len ) {
|
||||
c = substr (url, i, 2)
|
||||
i++
|
||||
}
|
||||
}
|
||||
else if ( c == "+" )
|
||||
c = " "
|
||||
decoded = decoded c
|
||||
i++
|
||||
}
|
||||
return decoded
|
||||
}
|
||||
|
||||
{
|
||||
$2 = urldecode($2)
|
||||
gsub ("\\\\\"", "\"", $2)
|
||||
print
|
||||
}
|
65
sources_non_forked/syntastic/syntax_checkers/html/w3.vim
Normal file
65
sources_non_forked/syntastic/syntax_checkers/html/w3.vim
Normal file
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: w3.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" Checker option:
|
||||
"
|
||||
" - g:syntastic_html_w3_api (string; default: 'http://validator.w3.org/check')
|
||||
" URL of the service to use for checking; leave it to the default to run the
|
||||
" checks against http://validator.w3.org/, or set it to
|
||||
" 'http://localhost/w3c-validator/check' if you're running a local service
|
||||
|
||||
if exists("g:loaded_syntastic_html_w3_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_html_w3_checker = 1
|
||||
|
||||
if !exists('g:syntastic_html_w3_api')
|
||||
let g:syntastic_html_w3_api = 'http://validator.w3.org/check'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_html_w3_IsAvailable()
|
||||
return executable('curl')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_html_w3_GetLocList()
|
||||
let makeprg = 'curl -s -F output=json ' .
|
||||
\ '-F uploaded_file=@' . syntastic#util#shexpand('%:p') . '\;type=text/html ' .
|
||||
\ g:syntastic_html_w3_api
|
||||
|
||||
let errorformat =
|
||||
\ '%A %\+{,' .
|
||||
\ '%C %\+"lastLine": %l\,%\?,' .
|
||||
\ '%C %\+"lastColumn": %c\,%\?,' .
|
||||
\ '%C %\+"message": "%m"\,%\?,' .
|
||||
\ '%C %\+"type": "%trror"\,%\?,' .
|
||||
\ '%-G %\+"type": "%tnfo"\,%\?,' .
|
||||
\ '%C %\+"subtype": "%tarning"\,%\?,' .
|
||||
\ '%Z %\+}\,,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")},
|
||||
\ 'returns': [0] })
|
||||
|
||||
for n in range(len(loclist))
|
||||
let loclist[n]['text'] = substitute(loclist[n]['text'], '\\\([\"]\)', '\1', 'g')
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'html',
|
||||
\ 'name': 'w3'})
|
||||
|
@ -0,0 +1,60 @@
|
||||
"============================================================================
|
||||
"File: checkstyle.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Dmitry Geurkov <d.geurkov 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.
|
||||
"
|
||||
" Tested with checkstyle 5.5
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_java_checkstyle_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_java_checkstyle_checker=1
|
||||
|
||||
if !exists("g:syntastic_java_checkstyle_classpath")
|
||||
let g:syntastic_java_checkstyle_classpath = 'checkstyle-5.5-all.jar'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_checkstyle_conf_file")
|
||||
let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_java_checkstyle_IsAvailable()
|
||||
return executable('java')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_java_checkstyle_GetLocList()
|
||||
|
||||
let fname = fnameescape( expand('%:p:h') . '/' . expand('%:t') )
|
||||
|
||||
if has('win32unix')
|
||||
let fname = substitute(system('cygpath -m ' . fname), '\%x00', '', 'g')
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'java',
|
||||
\ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath .
|
||||
\ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file,
|
||||
\ 'fname': fname,
|
||||
\ 'filetype': 'java',
|
||||
\ 'subchecker': 'checkstyle' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l:%c:\ %m,' .
|
||||
\ '%f:%l:\ %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style',
|
||||
\ 'postprocess': ['cygwinRemoveCR'] })
|
||||
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'java',
|
||||
\ 'name': 'checkstyle'})
|
366
sources_non_forked/syntastic/syntax_checkers/java/javac.vim
Normal file
366
sources_non_forked/syntastic/syntax_checkers/java/javac.vim
Normal file
@ -0,0 +1,366 @@
|
||||
"============================================================================
|
||||
"File: javac.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Jochen Keil <jochen.keil at gmail dot com>
|
||||
" Dmitry Geurkov <d.geurkov 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("g:loaded_syntastic_java_javac_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_java_javac_checker=1
|
||||
let g:syntastic_java_javac_maven_pom_tags = ["build", "properties"]
|
||||
let g:syntastic_java_javac_maven_pom_properties = {}
|
||||
|
||||
" Global Options
|
||||
if !exists("g:syntastic_java_javac_executable")
|
||||
let g:syntastic_java_javac_executable = 'javac'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_maven_executable")
|
||||
let g:syntastic_java_maven_executable = 'mvn'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_javac_options")
|
||||
let g:syntastic_java_javac_options = '-Xlint'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_javac_classpath")
|
||||
let g:syntastic_java_javac_classpath = ''
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_javac_delete_output")
|
||||
let g:syntastic_java_javac_delete_output = 1
|
||||
endif
|
||||
|
||||
function! s:CygwinPath(path)
|
||||
return substitute(system("cygpath -m ".a:path), '\%x00', '', 'g')
|
||||
endfunction
|
||||
|
||||
if !exists("g:syntastic_java_javac_temp_dir")
|
||||
if has('win32') || has('win64')
|
||||
let g:syntastic_java_javac_temp_dir = $TEMP."\\vim-syntastic-javac"
|
||||
elseif has('win32unix')
|
||||
let g:syntastic_java_javac_temp_dir = s:CygwinPath('/tmp/vim-syntastic-javac')
|
||||
else
|
||||
let g:syntastic_java_javac_temp_dir = '/tmp/vim-syntastic-javac'
|
||||
endif
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_javac_autoload_maven_classpath")
|
||||
let g:syntastic_java_javac_autoload_maven_classpath = 1
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_java_javac_config_file_enabled')
|
||||
let g:syntastic_java_javac_config_file_enabled = 0
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_java_javac_config_file')
|
||||
let g:syntastic_java_javac_config_file = '.syntastic_javac_config'
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_javac_maven_pom_ftime")
|
||||
let g:syntastic_java_javac_maven_pom_ftime = {}
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_java_javac_maven_pom_classpath")
|
||||
let g:syntastic_java_javac_maven_pom_classpath = {}
|
||||
endif
|
||||
|
||||
function! s:RemoveCarriageReturn(line)
|
||||
return substitute(a:line, '\r', '', 'g')
|
||||
endfunction
|
||||
|
||||
" recursively remove directory and all it's sub-directories
|
||||
function! s:RemoveDir(dir)
|
||||
if isdirectory(a:dir)
|
||||
for f in split(globpath(a:dir, '*'), "\n")
|
||||
call s:RemoveDir(f)
|
||||
endfor
|
||||
silent! call system('rmdir ' . a:dir)
|
||||
else
|
||||
silent! call delete(a:dir)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:AddToClasspath(classpath,path)
|
||||
if a:path == ''
|
||||
return a:classpath
|
||||
endif
|
||||
if a:classpath != '' && a:path != ''
|
||||
if has('win32') || has('win32unix') || has('win64')
|
||||
return a:classpath . ";" . a:path
|
||||
else
|
||||
return a:classpath . ":" . a:path
|
||||
endif
|
||||
else
|
||||
return a:path
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:LoadClasspathFromConfigFile()
|
||||
if filereadable(g:syntastic_java_javac_config_file)
|
||||
let path = ''
|
||||
let lines = readfile(g:syntastic_java_javac_config_file)
|
||||
for l in lines
|
||||
if l != ''
|
||||
let path .= l . "\n"
|
||||
endif
|
||||
endfor
|
||||
return path
|
||||
else
|
||||
return ''
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:SaveClasspath()
|
||||
let path = ''
|
||||
let lines = getline(1, line('$'))
|
||||
" save classpath to config file
|
||||
if g:syntastic_java_javac_config_file_enabled
|
||||
call writefile(lines,g:syntastic_java_javac_config_file)
|
||||
endif
|
||||
for l in lines
|
||||
if l != ''
|
||||
let path .= l . "\n"
|
||||
endif
|
||||
endfor
|
||||
let g:syntastic_java_javac_classpath = path
|
||||
let &modified = 0
|
||||
endfunction
|
||||
|
||||
function! s:EditClasspath()
|
||||
let command = 'syntastic javac classpath'
|
||||
let winnr = bufwinnr('^' . command . '$')
|
||||
if winnr < 0
|
||||
let pathlist = split(g:syntastic_java_javac_classpath,"\n")
|
||||
execute (len(pathlist) + 5) . 'sp ' . fnameescape(command)
|
||||
|
||||
augroup syntastic
|
||||
autocmd BufWriteCmd <buffer> call s:SaveClasspath() | bwipeout
|
||||
augroup END
|
||||
|
||||
setlocal buftype=acwrite bufhidden=wipe nobuflisted noswapfile nowrap number
|
||||
for p in pathlist
|
||||
call append(line('$') - 1, p)
|
||||
endfor
|
||||
else
|
||||
execute winnr . 'wincmd w'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:GetMavenProperties()
|
||||
let mvn_properties = {}
|
||||
let pom = findfile("pom.xml", ".;")
|
||||
if filereadable(pom)
|
||||
if !has_key(g:syntastic_java_javac_maven_pom_properties, pom)
|
||||
let mvn_cmd = g:syntastic_java_maven_executable . ' -f ' . pom
|
||||
let mvn_is_managed_tag = 1
|
||||
let mvn_settings_output = split(system(mvn_cmd . ' help:effective-pom'), "\n")
|
||||
let current_path = 'project'
|
||||
for line in mvn_settings_output
|
||||
let matches = matchlist(line, '^\s*<\([a-zA-Z0-9\-\.]\+\)>\s*$')
|
||||
if mvn_is_managed_tag && !empty(matches)
|
||||
let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) >= 0
|
||||
let current_path .= '.' . matches[1]
|
||||
else
|
||||
let matches = matchlist(line, '^\s*</\([a-zA-Z0-9\-\.]\+\)>\s*$')
|
||||
if !empty(matches)
|
||||
let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) < 0
|
||||
let current_path = substitute(current_path, '\.' . matches[1] . "$", '', '')
|
||||
else
|
||||
let matches = matchlist(line, '^\s*<\([a-zA-Z0-9\-\.]\+\)>\(.\+\)</[a-zA-Z0-9\-\.]\+>\s*$')
|
||||
if mvn_is_managed_tag && !empty(matches)
|
||||
let mvn_properties[current_path . '.' . matches[1]] = matches[2]
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
let g:syntastic_java_javac_maven_pom_properties[pom] = mvn_properties
|
||||
endif
|
||||
return g:syntastic_java_javac_maven_pom_properties[pom]
|
||||
endif
|
||||
return mvn_properties
|
||||
endfunction
|
||||
|
||||
command! SyntasticJavacEditClasspath call s:EditClasspath()
|
||||
|
||||
function! s:GetMavenClasspath()
|
||||
let pom = findfile("pom.xml", ".;")
|
||||
if filereadable(pom)
|
||||
if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(pom)
|
||||
let mvn_cmd = g:syntastic_java_maven_executable . ' -f ' . pom
|
||||
let mvn_classpath_output = split(system(mvn_cmd . ' dependency:build-classpath'), "\n")
|
||||
let class_path_next = 0
|
||||
|
||||
for line in mvn_classpath_output
|
||||
if class_path_next == 1
|
||||
let mvn_classpath = s:RemoveCarriageReturn(line)
|
||||
break
|
||||
endif
|
||||
if match(line,'Dependencies classpath:') >= 0
|
||||
let class_path_next = 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
let mvn_properties = s:GetMavenProperties()
|
||||
|
||||
let output_dir = 'target/classes'
|
||||
if has_key(mvn_properties, 'project.build.outputDirectory')
|
||||
let output_dir = mvn_properties['project.build.outputDirectory']
|
||||
endif
|
||||
let mvn_classpath = s:AddToClasspath(mvn_classpath, output_dir)
|
||||
|
||||
let test_output_dir = 'target/test-classes'
|
||||
if has_key(mvn_properties, 'project.build.testOutputDirectory')
|
||||
let test_output_dir = mvn_properties['project.build.testOutputDirectory']
|
||||
endif
|
||||
let mvn_classpath = s:AddToClasspath(mvn_classpath, test_output_dir)
|
||||
|
||||
let g:syntastic_java_javac_maven_pom_ftime[pom] = getftime(pom)
|
||||
let g:syntastic_java_javac_maven_pom_classpath[pom] = mvn_classpath
|
||||
endif
|
||||
return g:syntastic_java_javac_maven_pom_classpath[pom]
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_java_javac_IsAvailable()
|
||||
return executable(g:syntastic_java_javac_executable)
|
||||
endfunction
|
||||
|
||||
function! s:MavenOutputDirectory()
|
||||
let pom = findfile("pom.xml", ".;")
|
||||
if filereadable(pom)
|
||||
let mvn_properties = s:GetMavenProperties()
|
||||
let output_dir = getcwd()
|
||||
if has_key(mvn_properties, 'project.properties.build.dir')
|
||||
let output_dir = mvn_properties['project.properties.build.dir']
|
||||
endif
|
||||
if match(expand( '%:p:h' ), "src.main.java") >= 0
|
||||
let output_dir .= '/target/classes'
|
||||
if has_key(mvn_properties, 'project.build.outputDirectory')
|
||||
let output_dir = mvn_properties['project.build.outputDirectory']
|
||||
endif
|
||||
endif
|
||||
if match(expand( '%:p:h' ), "src.test.java") >= 0
|
||||
let output_dir .= '/target/test-classes'
|
||||
if has_key(mvn_properties, 'project.build.testOutputDirectory')
|
||||
let output_dir = mvn_properties['project.build.testOutputDirectory']
|
||||
endif
|
||||
endif
|
||||
|
||||
if has('win32unix')
|
||||
let output_dir=s:CygwinPath(output_dir)
|
||||
endif
|
||||
return output_dir
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_java_javac_GetLocList()
|
||||
|
||||
let javac_opts = g:syntastic_java_javac_options
|
||||
|
||||
if g:syntastic_java_javac_delete_output
|
||||
let output_dir = g:syntastic_java_javac_temp_dir
|
||||
let javac_opts .= ' -d ' . output_dir
|
||||
endif
|
||||
|
||||
" load classpath from config file
|
||||
if g:syntastic_java_javac_config_file_enabled
|
||||
let loaded_classpath = s:LoadClasspathFromConfigFile()
|
||||
if loaded_classpath != ''
|
||||
let g:syntastic_java_javac_classpath = loaded_classpath
|
||||
endif
|
||||
endif
|
||||
|
||||
let javac_classpath = ''
|
||||
|
||||
" add classpathes to javac_classpath
|
||||
for path in split(g:syntastic_java_javac_classpath,"\n")
|
||||
if path != ''
|
||||
try
|
||||
let ps = glob(path,0,1)
|
||||
catch
|
||||
let ps = split(glob(path,0),"\n")
|
||||
endtry
|
||||
if type(ps) == type([])
|
||||
for p in ps
|
||||
if p != ''
|
||||
let javac_classpath = s:AddToClasspath(javac_classpath,p)
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let javac_classpath = s:AddToClasspath(javac_classpath,ps)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
if g:syntastic_java_javac_autoload_maven_classpath
|
||||
if !g:syntastic_java_javac_delete_output
|
||||
let maven_output_dir = s:MavenOutputDirectory()
|
||||
let javac_opts .= ' -d ' . maven_output_dir
|
||||
endif
|
||||
let maven_classpath = s:GetMavenClasspath()
|
||||
let javac_classpath = s:AddToClasspath(javac_classpath,maven_classpath)
|
||||
endif
|
||||
|
||||
if javac_classpath != ''
|
||||
let javac_opts .= ' -cp "' . fnameescape(javac_classpath) . '"'
|
||||
endif
|
||||
|
||||
" path seperator
|
||||
if has('win32') || has('win32unix') || has('win64')
|
||||
let sep = "\\"
|
||||
else
|
||||
let sep = '/'
|
||||
endif
|
||||
|
||||
let fname = fnameescape(expand ( '%:p:h' ) . sep . expand ( '%:t' ))
|
||||
|
||||
if has('win32unix')
|
||||
let fname = s:CygwinPath(fname)
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': g:syntastic_java_javac_executable,
|
||||
\ 'args': javac_opts,
|
||||
\ 'fname': fname,
|
||||
\ 'tail': '2>&1',
|
||||
\ 'filetype': 'java',
|
||||
\ 'subchecker': 'javac' })
|
||||
|
||||
" unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types
|
||||
let errorformat =
|
||||
\ '%E%f:%l:\ error:\ %m,'.
|
||||
\ '%W%f:%l:\ warning:\ %m,'.
|
||||
\ '%A%f:%l:\ %m,'.
|
||||
\ '%+Z%p^,'.
|
||||
\ '%+C%.%#,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
if g:syntastic_java_javac_delete_output
|
||||
silent! call mkdir(output_dir,'p')
|
||||
endif
|
||||
let errors = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['cygwinRemoveCR'] })
|
||||
|
||||
if g:syntastic_java_javac_delete_output
|
||||
call s:RemoveDir(output_dir)
|
||||
endif
|
||||
return errors
|
||||
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'java',
|
||||
\ 'name': 'javac'})
|
||||
|
@ -0,0 +1,66 @@
|
||||
"============================================================================
|
||||
"File: closurecompiler.vim
|
||||
"Description: Javascript syntax checker - using Google Closure Compiler
|
||||
"Maintainer: Motohiro Takayama <mootoh 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.
|
||||
"============================================================================
|
||||
"
|
||||
" To enable this plugin, edit the .vimrc like this:
|
||||
"
|
||||
" let g:syntastic_javascript_checker = "closurecompiler"
|
||||
"
|
||||
" and set the path to the Google Closure Compiler:
|
||||
"
|
||||
" let g:syntastic_javascript_closure_compiler_path = '/path/to/google-closure-compiler.jar'
|
||||
"
|
||||
" It takes additional options for Google Closure Compiler with the variable
|
||||
" g:syntastic_javascript_closure_compiler_options.
|
||||
"
|
||||
|
||||
if exists("g:loaded_syntastic_javascript_closurecompiler_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_closurecompiler_checker=1
|
||||
|
||||
if !exists("g:syntastic_javascript_closure_compiler_options")
|
||||
let g:syntastic_javascript_closure_compiler_options = ""
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_closurecompiler_IsAvailable()
|
||||
return exists("g:syntastic_javascript_closure_compiler_path")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_closurecompiler_GetLocList()
|
||||
if exists("g:syntastic_javascript_closure_compiler_file_list")
|
||||
let file_list = join(readfile(g:syntastic_javascript_closure_compiler_file_list), ' ')
|
||||
else
|
||||
let file_list = syntastic#util#shexpand('%')
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'java -jar ' . g:syntastic_javascript_closure_compiler_path,
|
||||
\ 'args': g:syntastic_javascript_closure_compiler_options . ' --js' ,
|
||||
\ 'fname': file_list,
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'subchecker': 'closurecompiler' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-GOK,'.
|
||||
\ '%E%f:%l: ERROR - %m,'.
|
||||
\ '%Z%p^,'.
|
||||
\ '%W%f:%l: WARNING - %m,'.
|
||||
\ '%Z%p^'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'closurecompiler'})
|
||||
|
@ -0,0 +1,46 @@
|
||||
"============================================================================
|
||||
"File: gjslint.vim
|
||||
"Description: Javascript syntax checker - using gjslint
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_javascript_gjslint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_gjslint_checker=1
|
||||
|
||||
if !exists("g:syntastic_javascript_gjslint_conf")
|
||||
let g:syntastic_javascript_gjslint_conf = ""
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_gjslint_IsAvailable()
|
||||
return executable('gjslint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_gjslint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'gjslint',
|
||||
\ 'args': g:syntastic_javascript_gjslint_conf . " --nosummary --unix_mode --nodebug_indentation --nobeep",
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'subchecker': 'gjslint' })
|
||||
|
||||
let errorformat =
|
||||
\ "%f:%l:(New Error -%\\?\%n) %m," .
|
||||
\ "%f:%l:(-%\\?%n) %m," .
|
||||
\ "%-G1 files checked," .
|
||||
\ " no errors found.," .
|
||||
\ "%-G%.%#"
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'gjslint'})
|
||||
|
@ -0,0 +1,55 @@
|
||||
"============================================================================
|
||||
"File: jshint.vim
|
||||
"Description: Javascript syntax checker - using jshint
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_javascript_jshint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_jshint_checker=1
|
||||
|
||||
if !exists("g:syntastic_javascript_jshint_conf")
|
||||
let g:syntastic_javascript_jshint_conf = ""
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_jshint_IsAvailable()
|
||||
return executable('jshint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jshint_GetLocList()
|
||||
let jshint_new = s:JshintNew()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jshint',
|
||||
\ 'post_args': (jshint_new ? ' --verbose ' : '') . s:Args(),
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'subchecker': 'jshint' })
|
||||
|
||||
let errorformat = jshint_new ?
|
||||
\ '%f: line %l\, col %c\, %m \(%t%*\d\)' :
|
||||
\ '%E%f: line %l\, col %c\, %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
function s:JshintNew()
|
||||
return syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('jshint --version'), [1, 1])
|
||||
endfunction
|
||||
|
||||
function s:Args()
|
||||
" node-jshint uses .jshintrc as config unless --config arg is present
|
||||
return !empty(g:syntastic_javascript_jshint_conf) ? ' --config ' . g:syntastic_javascript_jshint_conf : ''
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'jshint'})
|
||||
|
@ -0,0 +1,56 @@
|
||||
"============================================================================
|
||||
"File: jsl.vim
|
||||
"Description: Javascript syntax checker - using jsl
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_javascript_jsl_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_jsl_checker=1
|
||||
|
||||
if !exists("g:syntastic_javascript_jsl_conf")
|
||||
let g:syntastic_javascript_jsl_conf = ""
|
||||
endif
|
||||
|
||||
function s:ConfFlag()
|
||||
if !empty(g:syntastic_javascript_jsl_conf)
|
||||
return "-conf " . g:syntastic_javascript_jsl_conf
|
||||
endif
|
||||
|
||||
return ""
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jsl_IsAvailable()
|
||||
return executable('jsl')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jsl_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jsl',
|
||||
\ 'args': s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process",
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'subchecker': 'jsl' })
|
||||
|
||||
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
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'jsl'})
|
||||
|
@ -0,0 +1,53 @@
|
||||
"============================================================================
|
||||
"File: jslint.vim
|
||||
"Description: Javascript syntax checker - using jslint
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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.
|
||||
"
|
||||
"Tested with jslint 0.1.4.
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_javascript_jslint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_javascript_jslint_checker=1
|
||||
|
||||
if !exists("g:syntastic_javascript_jslint_conf")
|
||||
let g:syntastic_javascript_jslint_conf = "--white --undef --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_jslint_IsAvailable()
|
||||
return executable('jslint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jslint_HighlightTerm(error)
|
||||
let unexpected = matchstr(a:error['text'], 'Expected.*and instead saw \'\zs.*\ze\'')
|
||||
if len(unexpected) < 1 | return '' | end
|
||||
return '\V'.split(unexpected, "'")[1]
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jslint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jslint',
|
||||
\ 'args': g:syntastic_javascript_jslint_conf,
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'subchecker': 'jslint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E %##%n %m,'.
|
||||
\ '%-Z%.%#Line %l\, Pos %c,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'jslint'})
|
||||
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"File: jsonlint.vim
|
||||
"Description: JSON syntax checker - using jsonlint
|
||||
"Maintainer: Miller Medeiros <contact at millermedeiros 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("g:loaded_syntastic_json_jsonlint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_json_jsonlint_checker=1
|
||||
|
||||
function! SyntaxCheckers_json_jsonlint_IsAvailable()
|
||||
return executable('jsonlint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_json_jsonlint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jsonlint',
|
||||
\ 'post_args': '--compact',
|
||||
\ 'filetype': 'json',
|
||||
\ 'subchecker': 'jsonlint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%ELine %l:%c,'.
|
||||
\ '%Z\\s%#Reason: %m,'.
|
||||
\ '%C%.%#,'.
|
||||
\ '%f: line %l\, col %c\, %m,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'json',
|
||||
\ 'name': 'jsonlint'})
|
@ -0,0 +1,40 @@
|
||||
"============================================================================
|
||||
"File: jsonval.vim
|
||||
"Description: JSON syntax checker - using jsonval
|
||||
"Maintainer: Miller Medeiros <contact at millermedeiros 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("g:loaded_syntastic_json_jsonval_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_json_jsonval_checker=1
|
||||
|
||||
function! SyntaxCheckers_json_jsonval_IsAvailable()
|
||||
return executable('jsonval')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_json_jsonval_GetLocList()
|
||||
" based on https://gist.github.com/1196345
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jsonval',
|
||||
\ 'filetype': 'json',
|
||||
\ 'subchecker': 'jsonval' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:\ %m\ at\ line\ %l,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'json',
|
||||
\ 'name': 'jsonval'})
|
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
fs = require 'fs'
|
||||
less = require 'less'
|
||||
args = process.argv.slice(1)
|
||||
options = {}
|
||||
|
||||
args = args.filter (arg) ->
|
||||
match = arg.match(/^-I(.+)$/)
|
||||
if match
|
||||
options.paths.push(match[1]);
|
||||
return false
|
||||
|
||||
match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i)
|
||||
if match
|
||||
arg = match[1]
|
||||
else
|
||||
return arg
|
||||
|
||||
switch arg
|
||||
when 'strict-imports' then options.strictImports = true
|
||||
when 'include-path'
|
||||
options.paths = match[2].split(if os.type().match(/Windows/) then ';' else ':')
|
||||
.map (p) ->
|
||||
if p
|
||||
return path.resolve(process.cwd(), p)
|
||||
when 'O0' then options.optimization = 0
|
||||
when 'O1' then options.optimization = 1
|
||||
when 'O2' then options.optimization = 2
|
||||
|
||||
options.filename = args[1]
|
||||
|
||||
parser = new(less.Parser) options
|
||||
|
||||
fs.readFile(options.filename, 'utf-8', (err,data) ->
|
||||
parser.parse(data, (err, tree) ->
|
||||
if err
|
||||
less.writeError err
|
||||
process.exit(1)
|
||||
)
|
||||
)
|
@ -0,0 +1,57 @@
|
||||
// Generated by CoffeeScript 1.3.3
|
||||
(function() {
|
||||
var args, fs, less, options, parser;
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
less = require('less');
|
||||
|
||||
args = process.argv.slice(1);
|
||||
|
||||
options = {};
|
||||
|
||||
args = args.filter(function(arg) {
|
||||
var match;
|
||||
match = arg.match(/^-I(.+)$/);
|
||||
if (match) {
|
||||
options.paths.push(match[1]);
|
||||
return false;
|
||||
}
|
||||
match = arg.match(/^--?([a-z][\-0-9a-z]*)(?:=([^\s]+))?$/i);
|
||||
if (match) {
|
||||
arg = match[1];
|
||||
} else {
|
||||
return arg;
|
||||
}
|
||||
switch (arg) {
|
||||
case 'strict-imports':
|
||||
return options.strictImports = true;
|
||||
case 'include-path':
|
||||
return options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':').map(function(p) {
|
||||
if (p) {
|
||||
return path.resolve(process.cwd(), p);
|
||||
}
|
||||
});
|
||||
case 'O0':
|
||||
return options.optimization = 0;
|
||||
case 'O1':
|
||||
return options.optimization = 1;
|
||||
case 'O2':
|
||||
return options.optimization = 2;
|
||||
}
|
||||
});
|
||||
|
||||
options.filename = args[1];
|
||||
|
||||
parser = new less.Parser(options);
|
||||
|
||||
fs.readFile(options.filename, 'utf-8', function(err, data) {
|
||||
return parser.parse(data, function(err, tree) {
|
||||
if (err) {
|
||||
less.writeError(err);
|
||||
return process.exit(1);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}).call(this);
|
61
sources_non_forked/syntastic/syntax_checkers/less/lessc.vim
Normal file
61
sources_non_forked/syntastic/syntax_checkers/less/lessc.vim
Normal file
@ -0,0 +1,61 @@
|
||||
"============================================================================
|
||||
"File: less.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Julien Blanchard <julien at sideburns dot eu>
|
||||
"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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" To send additional options to less use the variable g:syntastic_less_options.
|
||||
" The default is
|
||||
" let g:syntastic_less_options = "--no-color"
|
||||
"
|
||||
" To use less-lint instead of less set the variable
|
||||
" g:syntastic_less_use_less_lint.
|
||||
|
||||
if exists("g:loaded_syntastic_less_lessc_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_less_lessc_checker=1
|
||||
|
||||
if !exists("g:syntastic_less_options")
|
||||
let g:syntastic_less_options = "--no-color"
|
||||
endif
|
||||
|
||||
if !exists("g:syntastic_less_use_less_lint")
|
||||
let g:syntastic_less_use_less_lint = 0
|
||||
endif
|
||||
|
||||
if g:syntastic_less_use_less_lint
|
||||
let s:check_file = 'node ' . expand('<sfile>:p:h') . '/less-lint.js'
|
||||
else
|
||||
let s:check_file = 'lessc'
|
||||
end
|
||||
|
||||
function! SyntaxCheckers_less_lessc_IsAvailable()
|
||||
return executable('lessc')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_less_lessc_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': s:check_file,
|
||||
\ 'args': g:syntastic_less_options,
|
||||
\ 'tail': syntastic#util#DevNull(),
|
||||
\ 'filetype': 'less',
|
||||
\ 'subchecker': 'lessc' })
|
||||
|
||||
let errorformat = '%m in %f:%l:%c'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'less',
|
||||
\ 'name': 'lessc'})
|
47
sources_non_forked/syntastic/syntax_checkers/lisp/clisp.vim
Normal file
47
sources_non_forked/syntastic/syntax_checkers/lisp/clisp.vim
Normal file
@ -0,0 +1,47 @@
|
||||
"============================================================================
|
||||
"File: lisp.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Karl Yngve Lervåg <karl.yngve@lervag.net>
|
||||
"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("g:loaded_syntastic_lisp_clisp_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_lisp_clisp_checker=1
|
||||
|
||||
function! SyntaxCheckers_lisp_clisp_IsAvailable()
|
||||
return executable("clisp")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_lisp_clisp_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'clisp',
|
||||
\ 'args': '-q -c',
|
||||
\ 'tail': '-o /tmp/clisp-vim-compiled-file',
|
||||
\ 'filetype': 'lisp',
|
||||
\ 'subchecker': 'clisp' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G;%.%#,' .
|
||||
\ '%W%>WARNING:%.%#line %l : %m,' .
|
||||
\ '%Z %#%m,' .
|
||||
\ '%W%>WARNING:%.%#lines %l..%\d\# : %m,' .
|
||||
\ '%Z %#%m,' .
|
||||
\ '%E%>The following functions were %m,' .
|
||||
\ '%Z %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr('')} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'lisp',
|
||||
\ 'name': 'clisp'})
|
38
sources_non_forked/syntastic/syntax_checkers/llvm/llvm.vim
Normal file
38
sources_non_forked/syntastic/syntax_checkers/llvm/llvm.vim
Normal file
@ -0,0 +1,38 @@
|
||||
"============================================================================
|
||||
"File: llvm.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Andrew Kelley <superjoe30@gmail.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("g:loaded_syntastic_llvm_llvm_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_llvm_llvm_checker=1
|
||||
|
||||
function! SyntaxCheckers_llvm_llvm_IsAvailable()
|
||||
return executable("llc")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_llvm_llvm_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'llc',
|
||||
\ 'args': syntastic#c#GetNullDevice(),
|
||||
\ 'filetype': 'llvm',
|
||||
\ 'subchecker': 'llvm' })
|
||||
|
||||
let errorformat = 'llc: %f:%l:%c: %trror: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'llvm',
|
||||
\ 'name': 'llvm'})
|
||||
|
64
sources_non_forked/syntastic/syntax_checkers/lua/luac.vim
Normal file
64
sources_non_forked/syntastic/syntax_checkers/lua/luac.vim
Normal file
@ -0,0 +1,64 @@
|
||||
"============================================================================
|
||||
"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("g:loaded_syntastic_lua_luac_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_lua_luac_checker=1
|
||||
|
||||
function! SyntaxCheckers_lua_luac_IsAvailable()
|
||||
return executable('luac')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
|
||||
let near = matchstr(a:pos['text'], "near '[^']\\+'")
|
||||
let result = ''
|
||||
if len(near) > 0
|
||||
let near = split(near, "'")[1]
|
||||
if near == '<eof>'
|
||||
let p = getpos('$')
|
||||
let a:pos['lnum'] = p[1]
|
||||
let a:pos['col'] = p[2]
|
||||
let result = '\%'.p[2].'c'
|
||||
else
|
||||
let result = '\V'.near
|
||||
endif
|
||||
let open = matchstr(a:pos['text'], "(to close '[^']\\+' at line [0-9]\\+)")
|
||||
if len(open) > 0
|
||||
let oline = split(open, "'")[1:2]
|
||||
let line = 0+strpart(oline[1], 9)
|
||||
call matchadd('SpellCap', '\%'.line.'l\V'.oline[0])
|
||||
endif
|
||||
endif
|
||||
return result
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_lua_luac_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'luac',
|
||||
\ 'args': '-p',
|
||||
\ 'filetype': 'lua',
|
||||
\ 'subchecker': 'luac' })
|
||||
|
||||
let errorformat = 'luac: %#%f:%l: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } })
|
||||
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'lua',
|
||||
\ 'name': 'luac'})
|
@ -0,0 +1,41 @@
|
||||
"============================================================================
|
||||
"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("g:loaded_syntastic_matlab_mlint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_matlab_mlint_checker=1
|
||||
|
||||
function! SyntaxCheckers_matlab_mlint_IsAvailable()
|
||||
return executable("mlint")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_matlab_mlint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'mlint',
|
||||
\ 'args': '-id $*',
|
||||
\ 'filetype': 'matlab',
|
||||
\ 'subchecker': 'mlint' })
|
||||
|
||||
let errorformat =
|
||||
\ 'L %l (C %c): %*[a-zA-Z0-9]: %m,'.
|
||||
\ 'L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'bufnr': bufnr("")} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'matlab',
|
||||
\ 'name': 'mlint'})
|
38
sources_non_forked/syntastic/syntax_checkers/nasm/nasm.vim
Normal file
38
sources_non_forked/syntastic/syntax_checkers/nasm/nasm.vim
Normal file
@ -0,0 +1,38 @@
|
||||
"============================================================================
|
||||
"File: nasm.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Håvard Pettersson <haavard.pettersson 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("g:loaded_syntastic_nasm_nasm_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_nasm_nasm_checker=1
|
||||
|
||||
function! SyntaxCheckers_nasm_nasm_IsAvailable()
|
||||
return executable("nasm")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_nasm_nasm_GetLocList()
|
||||
let wd = syntastic#util#shescape(expand("%:p:h") . "/")
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'nasm',
|
||||
\ 'args': '-X gnu -f elf -I ' . wd . ' ' . syntastic#c#GetNullDevice()
|
||||
\ 'filetype': 'nasm',
|
||||
\ 'subchecker': 'nasm' })
|
||||
|
||||
let errorformat = '%f:%l: %t%*[^:]: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'nasm',
|
||||
\ 'name': 'nasm'})
|
@ -0,0 +1,41 @@
|
||||
"============================================================================
|
||||
"File: mandoc.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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("g:loaded_syntastic_nroff_mandoc_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_nroff_mandoc_checker=1
|
||||
|
||||
function! SyntaxCheckers_nroff_mandoc_IsAvailable()
|
||||
return executable("mandoc")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_nroff_mandoc_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'mandoc',
|
||||
\ 'args': '-Tlint',
|
||||
\ 'filetype': 'nroff',
|
||||
\ 'subchecker': 'mandoc' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: %tRROR: %m,' .
|
||||
\ '%W%f:%l:%c: %tARNING: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 2, 3, 4] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'nroff',
|
||||
\ 'name': 'mandoc'})
|
||||
|
184
sources_non_forked/syntastic/syntax_checkers/objc/gcc.vim
Normal file
184
sources_non_forked/syntastic/syntax_checkers/objc/gcc.vim
Normal file
@ -0,0 +1,184 @@
|
||||
"============================================================================
|
||||
"File: objc.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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
" (this usually creates a .gch file in your source directory)
|
||||
"
|
||||
" let g:syntastic_objc_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_objc_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_objc_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_objc_includes. Then the header files are being re-checked on
|
||||
" the next file write.
|
||||
"
|
||||
" let g:syntastic_objc_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_objc_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_objc_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" gcc command line you can add those to the global variable
|
||||
" g:syntastic_objc_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_objc_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_objc_compiler_options':
|
||||
"
|
||||
" let g:syntastic_objc_compiler_options = ' -ansi'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_objc_config_file' allows you to define a
|
||||
" file that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_objc_config':
|
||||
"
|
||||
" let g:syntastic_objc_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_objc_remove_include_errors' you can
|
||||
" specify whether errors of files included via the g:syntastic_objc_include_dirs'
|
||||
" setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_objc_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_objc_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_objc_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to gcc)
|
||||
"
|
||||
" let g:syntastic_objc_compiler = 'clang'
|
||||
|
||||
if exists('g:loaded_syntastic_objc_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_objc_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_objc_compiler')
|
||||
let g:syntastic_objc_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_objc_gcc_IsAvailable()
|
||||
return executable(g:syntastic_objc_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_objc_compiler_options')
|
||||
let g:syntastic_objc_compiler_options = '-std=gnu99'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_objc_config_file')
|
||||
let g:syntastic_objc_config_file = '.syntastic_objc_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_objc_gcc_GetLocList()
|
||||
let makeprg = g:syntastic_objc_compiler . ' -x objective-c -fsyntax-only -lobjc'
|
||||
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:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,' .
|
||||
\ '%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_objc_errorformat')
|
||||
let errorformat = g:syntastic_objc_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_objc_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('objc')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.h$'
|
||||
if exists('g:syntastic_objc_check_header')
|
||||
let makeprg = g:syntastic_objc_compiler .
|
||||
\ ' -x objective-c-header ' .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . g:syntastic_objc_compiler_options .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('objc')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_objc_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_objc_no_include_search') ||
|
||||
\ g:syntastic_objc_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_objc_auto_refresh_includes') &&
|
||||
\ g:syntastic_objc_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_objc_includes')
|
||||
let b:syntastic_objc_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_objc_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_objc_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_objc_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_objc_remove_include_errors') &&
|
||||
\ g:syntastic_objc_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'objc',
|
||||
\ 'name': 'gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
36
sources_non_forked/syntastic/syntax_checkers/objc/oclint.vim
Normal file
36
sources_non_forked/syntastic/syntax_checkers/objc/oclint.vim
Normal file
@ -0,0 +1,36 @@
|
||||
"============================================================================
|
||||
"File: oclint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_oclint_config':
|
||||
"
|
||||
" let g:syntastic_oclint_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_objc_oclint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_objc_oclint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_objc_oclint_IsAvailable()
|
||||
return SyntaxCheckers_c_oclint_IsAvailable()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_objc_oclint_GetLocList()
|
||||
return SyntaxCheckers_c_oclint_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'objc',
|
||||
\ 'name': 'oclint'})
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
34
sources_non_forked/syntastic/syntax_checkers/objc/ycm.vim
Normal file
34
sources_non_forked/syntastic/syntax_checkers/objc/ycm.vim
Normal file
@ -0,0 +1,34 @@
|
||||
"============================================================================
|
||||
"File: ycm.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Val Markovic <val at markovic dot io>
|
||||
"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("g:loaded_syntastic_objc_ycm_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_objc_ycm_checker = 1
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
||||
|
||||
function! SyntaxCheckers_objc_ycm_IsAvailable()
|
||||
return SyntaxCheckers_c_ycm_IsAvailable()
|
||||
endfunction
|
||||
|
||||
if !exists('g:loaded_youcompleteme')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_objc_ycm_GetLocList()
|
||||
return SyntaxCheckers_c_ycm_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'objc',
|
||||
\ 'name': 'ycm'})
|
184
sources_non_forked/syntastic/syntax_checkers/objcpp/gcc.vim
Normal file
184
sources_non_forked/syntastic/syntax_checkers/objcpp/gcc.vim
Normal file
@ -0,0 +1,184 @@
|
||||
"============================================================================
|
||||
"File: objcpp.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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" In order to also check header files add this to your .vimrc:
|
||||
" (this usually creates a .gch file in your source directory)
|
||||
"
|
||||
" let g:syntastic_objcpp_check_header = 1
|
||||
"
|
||||
" To disable the search of included header files after special
|
||||
" libraries like gtk and glib add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_objcpp_no_include_search = 1
|
||||
"
|
||||
" To disable the include of the default include dirs (such as /usr/include)
|
||||
" add this line to your .vimrc:
|
||||
"
|
||||
" let g:syntastic_objcpp_no_default_include_dirs = 1
|
||||
"
|
||||
" To enable header files being re-checked on every file write add the
|
||||
" following line to your .vimrc. Otherwise the header files are checked only
|
||||
" one time on initially loading the file.
|
||||
" In order to force syntastic to refresh the header includes simply
|
||||
" unlet b:syntastic_objcpp_includes. Then the header files are being re-checked on
|
||||
" the next file write.
|
||||
"
|
||||
" let g:syntastic_objcpp_auto_refresh_includes = 1
|
||||
"
|
||||
" Alternatively you can set the buffer local variable b:syntastic_objcpp_cflags.
|
||||
" If this variable is set for the current buffer no search for additional
|
||||
" libraries is done. I.e. set the variable like this:
|
||||
"
|
||||
" let b:syntastic_objcpp_cflags = ' -I/usr/include/libsoup-2.4'
|
||||
"
|
||||
" In order to add some custom include directories that should be added to the
|
||||
" gcc command line you can add those to the global variable
|
||||
" g:syntastic_objcpp_include_dirs. This list can be used like this:
|
||||
"
|
||||
" let g:syntastic_objcpp_include_dirs = [ 'includes', 'headers' ]
|
||||
"
|
||||
" Moreover it is possible to add additional compiler options to the syntax
|
||||
" checking execution via the variable 'g:syntastic_objcpp_compiler_options':
|
||||
"
|
||||
" let g:syntastic_objcpp_compiler_options = ' -ansi'
|
||||
"
|
||||
" Additionally the setting 'g:syntastic_objcpp_config_file' allows you to define a
|
||||
" file that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_objcpp_config':
|
||||
"
|
||||
" let g:syntastic_objcpp_config_file = '.config'
|
||||
"
|
||||
" Using the global variable 'g:syntastic_objcpp_remove_include_errors' you can
|
||||
" specify whether errors of files included via the g:syntastic_objcpp_include_dirs'
|
||||
" setting are removed from the result set:
|
||||
"
|
||||
" let g:syntastic_objcpp_remove_include_errors = 1
|
||||
"
|
||||
" Use the variable 'g:syntastic_objcpp_errorformat' to override the default error
|
||||
" format:
|
||||
"
|
||||
" let g:syntastic_objcpp_errorformat = '%f:%l:%c: %trror: %m'
|
||||
"
|
||||
" Set your compiler executable with e.g. (defaults to gcc)
|
||||
"
|
||||
" let g:syntastic_objcpp_compiler = 'clang'
|
||||
|
||||
if exists('g:loaded_syntastic_objcpp_gcc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_objcpp_gcc_checker = 1
|
||||
|
||||
if !exists('g:syntastic_objcpp_compiler')
|
||||
let g:syntastic_objcpp_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_objcpp_gcc_IsAvailable()
|
||||
return executable(g:syntastic_objcpp_compiler)
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:syntastic_objcpp_compiler_options')
|
||||
let g:syntastic_objcpp_compiler_options = '-std=gnu99'
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_objcpp_config_file')
|
||||
let g:syntastic_objcpp_config_file = '.syntastic_objcpp_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_objcpp_gcc_GetLocList()
|
||||
let makeprg = g:syntastic_objcpp_compiler . ' -x objective-c++ -fsyntax-only -lobjc'
|
||||
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:%c: %trror: %m,' .
|
||||
\ '%f:%l:%c: %tarning: %m,' .
|
||||
\ '%f:%l:%c: %m,' .
|
||||
\ '%f:%l: %trror: %m,' .
|
||||
\ '%f:%l: %tarning: %m,' .
|
||||
\ '%f:%l: %m'
|
||||
|
||||
if exists('g:syntastic_objcpp_errorformat')
|
||||
let errorformat = g:syntastic_objcpp_errorformat
|
||||
endif
|
||||
|
||||
" add optional user-defined compiler options
|
||||
let makeprg .= g:syntastic_objcpp_compiler_options
|
||||
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('objcpp')
|
||||
|
||||
" determine whether to parse header files as well
|
||||
if expand('%') =~? '\.h$'
|
||||
if exists('g:syntastic_objcpp_check_header')
|
||||
let makeprg = g:syntastic_objcpp_compiler .
|
||||
\ ' -x objective-c++-header ' .
|
||||
\ ' -c ' . syntastic#util#shexpand('%') .
|
||||
\ ' ' . g:syntastic_objcpp_compiler_options .
|
||||
\ ' ' . syntastic#c#GetIncludeDirs('objcpp')
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" check if the user manually set some cflags
|
||||
if !exists('b:syntastic_objcpp_cflags')
|
||||
" check whether to search for include files at all
|
||||
if !exists('g:syntastic_objcpp_no_include_search') ||
|
||||
\ g:syntastic_objcpp_no_include_search != 1
|
||||
" refresh the include file search if desired
|
||||
if exists('g:syntastic_objcpp_auto_refresh_includes') &&
|
||||
\ g:syntastic_objcpp_auto_refresh_includes != 0
|
||||
let makeprg .= syntastic#c#SearchHeaders()
|
||||
else
|
||||
" search for header includes if not cached already
|
||||
if !exists('b:syntastic_objcpp_includes')
|
||||
let b:syntastic_objcpp_includes = syntastic#c#SearchHeaders()
|
||||
endif
|
||||
let makeprg .= b:syntastic_objcpp_includes
|
||||
endif
|
||||
endif
|
||||
else
|
||||
" use the user-defined cflags
|
||||
let makeprg .= b:syntastic_objcpp_cflags
|
||||
endif
|
||||
|
||||
" add optional config file parameters
|
||||
let makeprg .= ' ' . syntastic#c#ReadConfig(g:syntastic_objcpp_config_file)
|
||||
|
||||
" process makeprg
|
||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
" filter the processed errors if desired
|
||||
if exists('g:syntastic_objcpp_remove_include_errors') &&
|
||||
\ g:syntastic_objcpp_remove_include_errors != 0
|
||||
return filter(errors,
|
||||
\ 'has_key(v:val, "bufnr") && v:val["bufnr"]=='.bufnr(''))
|
||||
else
|
||||
return errors
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'objcpp',
|
||||
\ 'name': 'gcc'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set et sts=4 sw=4:
|
@ -0,0 +1,36 @@
|
||||
"============================================================================
|
||||
"File: oclint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: "UnCO" Lin <undercooled aT lavabit 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.
|
||||
"============================================================================
|
||||
"
|
||||
" The setting 'g:syntastic_oclint_config_file' allows you to define a file
|
||||
" that contains additional compiler arguments like include directories or
|
||||
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||
" given the filename defaults to '.syntastic_oclint_config':
|
||||
"
|
||||
" let g:syntastic_oclint_config_file = '.config'
|
||||
|
||||
if exists("g:loaded_syntastic_objcpp_oclint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_objcpp_oclint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_objcpp_oclint_IsAvailable()
|
||||
return SyntaxCheckers_c_oclint_IsAvailable()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_objcpp_oclint_GetLocList()
|
||||
return SyntaxCheckers_c_oclint_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'objcpp',
|
||||
\ 'name': 'oclint'})
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
34
sources_non_forked/syntastic/syntax_checkers/objcpp/ycm.vim
Normal file
34
sources_non_forked/syntastic/syntax_checkers/objcpp/ycm.vim
Normal file
@ -0,0 +1,34 @@
|
||||
"============================================================================
|
||||
"File: ycm.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Val Markovic <val at markovic dot io>
|
||||
"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("g:loaded_syntastic_objcpp_ycm_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_objcpp_ycm_checker = 1
|
||||
|
||||
runtime! syntax_checkers/c/*.vim
|
||||
|
||||
function! SyntaxCheckers_objcpp_ycm_IsAvailable()
|
||||
return SyntaxCheckers_c_ycm_IsAvailable()
|
||||
endfunction
|
||||
|
||||
if !exists('g:loaded_youcompleteme')
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_objcpp_ycm_GetLocList()
|
||||
return SyntaxCheckers_c_ycm_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'objcpp',
|
||||
\ 'name': 'ycm'})
|
149
sources_non_forked/syntastic/syntax_checkers/ocaml/camlp4o.vim
Normal file
149
sources_non_forked/syntastic/syntax_checkers/ocaml/camlp4o.vim
Normal file
@ -0,0 +1,149 @@
|
||||
"============================================================================
|
||||
"File: ocaml.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Török Edwin <edwintorok 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" The more reliable way to check for a single .ml file is to use ocamlc.
|
||||
" You can do that setting this in your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ocaml_use_ocamlc = 1
|
||||
" It's possible to use ocamlc in conjuction with Jane Street's Core. In order
|
||||
" to do that, you have to specify this in your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ocaml_use_janestreet_core = 1
|
||||
" let g:syntastic_ocaml_janestreet_core_dir = <path>
|
||||
"
|
||||
" Where path is the path to your core installation (usually a collection of
|
||||
" .cmx and .cmxa files).
|
||||
"
|
||||
"
|
||||
" By default the camlp4o preprocessor is used to check the syntax of .ml, and .mli files,
|
||||
" ocamllex is used to check .mll files and menhir is used to check .mly files.
|
||||
" The output is all redirected to /dev/null, nothing is written to the disk.
|
||||
"
|
||||
" If your source code needs camlp4r then you can define this in your .vimrc:
|
||||
"
|
||||
" let g:syntastic_ocaml_camlp4r = 1
|
||||
"
|
||||
" If you used some syntax extensions, or you want to also typecheck the source
|
||||
" code, then you can define this:
|
||||
"
|
||||
" let g:syntastic_ocaml_use_ocamlbuild = 1
|
||||
"
|
||||
" This will run ocamlbuild <name>.inferred.mli, so it will write to your _build
|
||||
" directory (and possibly rebuild your myocamlbuild.ml plugin), only enable this
|
||||
" if you are ok with that.
|
||||
"
|
||||
" If you are using syntax extensions / external libraries and have a properly
|
||||
" set up _tags (and myocamlbuild.ml file) then it should just work
|
||||
" to enable this flag and get syntax / type checks through syntastic.
|
||||
"
|
||||
" For best results your current directory should be the project root
|
||||
" (same situation if you want useful output from :make).
|
||||
|
||||
if exists("g:loaded_syntastic_ocaml_camlp4o_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_ocaml_camlp4o_checker=1
|
||||
|
||||
if exists('g:syntastic_ocaml_camlp4r') &&
|
||||
\ g:syntastic_ocaml_camlp4r != 0
|
||||
let s:ocamlpp="camlp4r"
|
||||
else
|
||||
let s:ocamlpp="camlp4o"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ocaml_camlp4o_IsAvailable()
|
||||
return executable(s:ocamlpp)
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc')
|
||||
let g:syntastic_ocaml_use_ocamlc = 0
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_ocaml_use_janestreet_core')
|
||||
let g:syntastic_ocaml_use_ocamlc = 0
|
||||
endif
|
||||
|
||||
if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable("ocamlbuild")
|
||||
let g:syntastic_ocaml_use_ocamlbuild = 0
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ocaml_camlp4o_GetLocList()
|
||||
let makeprg = s:GetMakeprg()
|
||||
if makeprg == ""
|
||||
return []
|
||||
endif
|
||||
|
||||
let errorformat =
|
||||
\ '%AFile "%f"\, line %l\, characters %c-%*\d:,'.
|
||||
\ '%AFile "%f"\, line %l\, characters %c-%*\d (end at line %*\d\, character %*\d):,'.
|
||||
\ '%AFile "%f"\, line %l\, character %c:,'.
|
||||
\ '%AFile "%f"\, line %l\, character %c:%m,'.
|
||||
\ '%-GPreprocessing error %.%#,'.
|
||||
\ '%-GCommand exited %.%#,'.
|
||||
\ '%C%tarning %n: %m,'.
|
||||
\ '%C%m,'.
|
||||
\ '%-G+%.%#'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
function s:GetMakeprg()
|
||||
if g:syntastic_ocaml_use_ocamlc
|
||||
return s:GetOcamlcMakeprg()
|
||||
endif
|
||||
|
||||
if g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build')
|
||||
return s:GetOcamlBuildMakeprg()
|
||||
endif
|
||||
|
||||
return s:GetOtherMakeprg()
|
||||
endfunction
|
||||
|
||||
function s:GetOcamlcMakeprg()
|
||||
if g:syntastic_ocaml_use_janestreet_core
|
||||
let build_cmd = "ocamlc -I "
|
||||
let build_cmd .= expand(g:syntastic_ocaml_janestreet_core_dir)
|
||||
let build_cmd .= " -c " . syntastic#util#shexpand('%')
|
||||
return build_cmd
|
||||
else
|
||||
return "ocamlc -c " . syntastic#util#shexpand('%')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function s:GetOcamlBuildMakeprg()
|
||||
return "ocamlbuild -quiet -no-log -tag annot," . s:ocamlpp . " -no-links -no-hygiene -no-sanitize " .
|
||||
\ syntastic#util#shexpand('%:r') . ".cmi"
|
||||
endfunction
|
||||
|
||||
function s:GetOtherMakeprg()
|
||||
"TODO: give this function a better name?
|
||||
"
|
||||
"TODO: should use throw/catch instead of returning an empty makeprg
|
||||
|
||||
let extension = expand('%:e')
|
||||
let makeprg = ""
|
||||
|
||||
if match(extension, 'mly') >= 0 && executable("menhir")
|
||||
" ocamlyacc output can't be redirected, so use menhir
|
||||
let makeprg = "menhir --only-preprocess " . syntastic#util#shexpand('%') . " >" . syntastic#util#DevNull()
|
||||
elseif match(extension,'mll') >= 0 && executable("ocamllex")
|
||||
let makeprg = "ocamllex -q " . syntastic#c#GetNullDevice() . " " . syntastic#util#shexpand('%')
|
||||
else
|
||||
let makeprg = "camlp4o " . syntastic#c#GetNullDevice() . " " . syntastic#util#shexpand('%')
|
||||
endif
|
||||
|
||||
return makeprg
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ocaml',
|
||||
\ 'name': 'camlp4o'})
|
186
sources_non_forked/syntastic/syntax_checkers/perl/efm_perl.pl
Normal file
186
sources_non_forked/syntastic/syntax_checkers/perl/efm_perl.pl
Normal file
@ -0,0 +1,186 @@
|
||||
#!/usr/bin/env perl
|
||||
# vimparse.pl - Reformats the error messages of the Perl interpreter for use
|
||||
# with the quickfix mode of Vim
|
||||
#
|
||||
# Copyright (c) 2001 by Jörg Ziefle <joerg.ziefle@gmx.de>
|
||||
# Copyright (c) 2012 Eric Harmon <http://eharmon.net>
|
||||
# You may use and distribute this software under the same terms as Perl itself.
|
||||
#
|
||||
# Usage: put one of the two configurations below in your ~/.vimrc (without the
|
||||
# description and '# ') and enjoy (be sure to adjust the paths to vimparse.pl
|
||||
# before):
|
||||
#
|
||||
# Program is run interactively with 'perl -w':
|
||||
#
|
||||
# set makeprg=$HOME/bin/vimparse.pl\ %\ $*
|
||||
# set errorformat=%t:%f:%l:%m
|
||||
#
|
||||
# Program is only compiled with 'perl -wc':
|
||||
#
|
||||
# set makeprg=$HOME/bin/vimparse.pl\ -c\ %\ $*
|
||||
# set errorformat=%t:%f:%l:%m
|
||||
#
|
||||
# Usage:
|
||||
# vimparse.pl [-c] [-w] [-f <errorfile>] <programfile> [programargs]
|
||||
#
|
||||
# -c compile only, don't run (perl -wc)
|
||||
# -w output warnings as warnings instead of errors (slightly slower)
|
||||
# -f write errors to <errorfile>
|
||||
#
|
||||
# Example usages:
|
||||
# * From the command line:
|
||||
# vimparse.pl program.pl
|
||||
#
|
||||
# vimparse.pl -c -w -f errorfile program.pl
|
||||
# Then run vim -q errorfile to edit the errors with Vim.
|
||||
# This uses the custom errorformat: %t:%f:%l:%m.
|
||||
#
|
||||
# * From Vim:
|
||||
# Edit in Vim (and save, if you don't have autowrite on), then
|
||||
# type ':mak' or ':mak args' (args being the program arguments)
|
||||
# to error check.
|
||||
#
|
||||
# Version history:
|
||||
# 0.3 (05/31/2012):
|
||||
# * Added support for the seperate display of warnings
|
||||
# * Switched output format to %t:%f:%l:%m to support error levels
|
||||
# 0.2 (04/12/2001):
|
||||
# * First public version (sent to Bram)
|
||||
# * -c command line option for compiling only
|
||||
# * grammatical fix: 'There was 1 error.'
|
||||
# * bug fix for multiple arguments
|
||||
# * more error checks
|
||||
# * documentation (top of file, &usage)
|
||||
# * minor code clean ups
|
||||
# 0.1 (02/02/2001):
|
||||
# * Initial version
|
||||
# * Basic functionality
|
||||
#
|
||||
# Todo:
|
||||
# * test on more systems
|
||||
# * use portable way to determine the location of perl ('use Config')
|
||||
# * include option that shows perldiag messages for each error
|
||||
# * allow to pass in program by STDIN
|
||||
# * more intuitive behaviour if no error is found (show message)
|
||||
#
|
||||
# Tested under SunOS 5.7 with Perl 5.6.0. Let me know if it's not working for
|
||||
# you.
|
||||
use warnings;
|
||||
use strict;
|
||||
use Getopt::Std;
|
||||
use File::Temp qw( tempfile );
|
||||
|
||||
use vars qw/$opt_I $opt_c $opt_w $opt_f $opt_h/; # needed for Getopt in combination with use strict 'vars'
|
||||
|
||||
use constant VERSION => 0.2;
|
||||
|
||||
getopts('cwf:hI:');
|
||||
|
||||
&usage if $opt_h; # not necessarily needed, but good for further extension
|
||||
|
||||
if (defined $opt_f) {
|
||||
|
||||
open FILE, "> $opt_f" or do {
|
||||
warn "Couldn't open $opt_f: $!. Using STDOUT instead.\n";
|
||||
undef $opt_f;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
my $handle = (defined $opt_f ? \*FILE : \*STDOUT);
|
||||
|
||||
(my $file = shift) or &usage; # display usage if no filename is supplied
|
||||
my $args = (@ARGV ? ' ' . join ' ', @ARGV : '');
|
||||
|
||||
if ($file eq '-') { # make STDIN seek-able, so it can be read twice
|
||||
my $fh = tempfile();
|
||||
print {$fh} <STDIN>;
|
||||
open \*STDIN, '<&', $fh or die "open: $!";
|
||||
seek \*STDIN, 0, 0 or die "seek: $!";
|
||||
}
|
||||
|
||||
my $libs = join ' ', map {"-I$_"} split ',', $opt_I || '';
|
||||
my @error_lines = `$^X $libs @{[defined $opt_c ? '-c ' : '' ]} @{[defined $opt_w ? '-X ' : '-Mwarnings ']} "$file$args" 2>&1`;
|
||||
|
||||
my @lines = map { "E:$_" } @error_lines;
|
||||
|
||||
my @warn_lines;
|
||||
if(defined($opt_w)) {
|
||||
if ($file eq '-') {
|
||||
seek \*STDIN, 0, 0 or die "seek: $!";
|
||||
}
|
||||
@warn_lines = `$^X $libs @{[defined $opt_c ? '-c ' : '' ]} -Mwarnings "$file$args" 2>&1`;
|
||||
}
|
||||
|
||||
# Any new errors must be warnings
|
||||
foreach my $line (@warn_lines) {
|
||||
if(!grep { $_ eq $line } @error_lines) {
|
||||
push(@lines, "W:$line");
|
||||
}
|
||||
}
|
||||
|
||||
my $errors = 0;
|
||||
foreach my $line (@lines) {
|
||||
|
||||
chomp($line);
|
||||
my ($file, $lineno, $message, $rest, $severity);
|
||||
|
||||
if ($line =~ /^([EW]):(.*)\sat\s(.*)\sline\s(\d+)(.*)$/) {
|
||||
($severity, $message, $file, $lineno, $rest) = ($1, $2, $3, $4, $5);
|
||||
$errors++;
|
||||
$message .= $rest if ($rest =~ s/^,//);
|
||||
print $handle "$severity:$file:$lineno:$message\n";
|
||||
|
||||
} else { next };
|
||||
|
||||
}
|
||||
|
||||
if (defined $opt_f) {
|
||||
|
||||
my $msg;
|
||||
if ($errors == 1) {
|
||||
|
||||
$msg = "There was 1 error.\n";
|
||||
|
||||
} else {
|
||||
|
||||
$msg = "There were $errors errors.\n";
|
||||
|
||||
};
|
||||
|
||||
print STDOUT $msg;
|
||||
close FILE;
|
||||
unlink $opt_f unless $errors;
|
||||
|
||||
};
|
||||
|
||||
sub usage {
|
||||
|
||||
(local $0 = $0) =~ s/^.*\/([^\/]+)$/$1/; # remove path from name of program
|
||||
print<<EOT;
|
||||
Usage:
|
||||
$0 [-c] [-w] [-f <errorfile>] <programfile> [programargs]
|
||||
|
||||
-c compile only, don't run (executes 'perl -c')
|
||||
-w output warnings as warnings instead of errors (slightly slower)
|
||||
-f write errors to <errorfile>
|
||||
-I specify \@INC/#include directory <perl_lib_path>
|
||||
|
||||
Examples:
|
||||
* At the command line:
|
||||
$0 program.pl
|
||||
Displays output on STDOUT.
|
||||
|
||||
$0 -c -w -f errorfile program.pl
|
||||
Then run 'vim -q errorfile' to edit the errors with Vim.
|
||||
This uses the custom errorformat: %t:%f:%l:%m.
|
||||
|
||||
* In Vim:
|
||||
Edit in Vim (and save, if you don't have autowrite on), then
|
||||
type ':mak' or ':mak args' (args being the program arguments)
|
||||
to error check.
|
||||
EOT
|
||||
|
||||
exit 0;
|
||||
|
||||
};
|
71
sources_non_forked/syntastic/syntax_checkers/perl/perl.vim
Normal file
71
sources_non_forked/syntastic/syntax_checkers/perl/perl.vim
Normal file
@ -0,0 +1,71 @@
|
||||
"============================================================================
|
||||
"File: perl.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Anthony Carapetis <anthony.carapetis at gmail dot com>,
|
||||
" Eric Harmon <http://eharmon.net>
|
||||
"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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" In order to add some custom lib directories that should be added to the
|
||||
" perl command line you can add those as a comma-separated list to the variable
|
||||
" g:syntastic_perl_lib_path.
|
||||
"
|
||||
" let g:syntastic_perl_lib_path = './lib,./lib/auto'
|
||||
"
|
||||
" To use your own perl error output munger script, use the
|
||||
" g:syntastic_perl_efm_program option. Any command line parameters should be
|
||||
" included in the variable declaration. The program should expect a single
|
||||
" parameter; the fully qualified filename of the file to be checked.
|
||||
"
|
||||
" let g:syntastic_perl_efm_program = "foo.pl -o -m -g"
|
||||
"
|
||||
|
||||
if exists("g:loaded_syntastic_perl_perl_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_perl_perl_checker=1
|
||||
|
||||
if !exists("g:syntastic_perl_interpreter")
|
||||
let g:syntastic_perl_interpreter = "perl"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_perl_perl_IsAvailable()
|
||||
return executable(g:syntastic_perl_interpreter)
|
||||
endfunction
|
||||
|
||||
if !exists("g:syntastic_perl_efm_program")
|
||||
let g:syntastic_perl_efm_program =
|
||||
\ g:syntastic_perl_interpreter . ' ' .
|
||||
\ syntastic#util#shescape(expand('<sfile>:p:h') . '/efm_perl.pl') .
|
||||
\ ' -c -w'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_perl_perl_GetLocList()
|
||||
let makeprg = exists("b:syntastic_perl_efm_program") ? b:syntastic_perl_efm_program : g:syntastic_perl_efm_program
|
||||
if exists("g:syntastic_perl_lib_path")
|
||||
let makeprg .= ' -I' . g:syntastic_perl_lib_path
|
||||
endif
|
||||
let makeprg .= ' ' . syntastic#util#shexpand('%') . s:ExtraMakeprgArgs()
|
||||
|
||||
let errorformat = '%t:%f:%l:%m'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
function! s:ExtraMakeprgArgs()
|
||||
let shebang = syntastic#util#parseShebang()
|
||||
if index(shebang['args'], '-T') != -1
|
||||
return ' -Tc'
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'perl',
|
||||
\ 'name': 'perl'})
|
@ -0,0 +1,65 @@
|
||||
"============================================================================
|
||||
"File: perlcritic.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" For details about perlcritic see:
|
||||
"
|
||||
" - http://perlcritic.tigris.org/
|
||||
" - https://metacpan.org/module/Perl::Critic
|
||||
"
|
||||
" Checker options:
|
||||
"
|
||||
" - g:syntastic_perl_perlcritic_thres (integer; default: 5)
|
||||
" error threshold: policy violations with a severity above this
|
||||
" value are highlighted as errors, the others are warnings
|
||||
"
|
||||
" - g:syntastic_perl_perlcritic_args (string; default: empty)
|
||||
" command line options to pass to perlcritic
|
||||
|
||||
if exists("g:loaded_syntastic_perl_perlcritic_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_perl_perlcritic_checker=1
|
||||
|
||||
if !exists('g:syntastic_perl_perlcritic_thres')
|
||||
let g:syntastic_perl_perlcritic_thres = 5
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_perl_perlcritic_IsAvailable()
|
||||
return executable('perlcritic')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_perl_perlcritic_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'perlcritic',
|
||||
\ 'post_args': '--quiet --nocolor --verbose "\%s:\%f:\%l:\%c:(\%s) \%m (\%e)\n"',
|
||||
\ 'filetype': 'perl',
|
||||
\ 'subchecker': 'perlcritic' })
|
||||
|
||||
let errorformat = '%t:%f:%l:%c:%m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 2],
|
||||
\ 'subtype': 'Style' })
|
||||
|
||||
" change error types according to the prescribed threshold
|
||||
for n in range(len(loclist))
|
||||
let loclist[n]['type'] = loclist[n]['type'] < g:syntastic_perl_perlcritic_thres ? 'W' : 'E'
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'perl',
|
||||
\ 'name': 'perlcritic'})
|
@ -0,0 +1,30 @@
|
||||
"============================================================================
|
||||
"File: podchecker.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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("g:loaded_syntastic_perl_podchecker_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_perl_podchecker_checker=1
|
||||
|
||||
function! SyntaxCheckers_perl_podchecker_IsAvailable()
|
||||
return SyntaxCheckers_pod_podchecker_IsAvailable()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_perl_podchecker_GetLocList()
|
||||
return SyntaxCheckers_pod_podchecker_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'perl',
|
||||
\ 'name': 'podchecker'})
|
||||
|
||||
runtime! syntax_checkers/pod/*.vim
|
52
sources_non_forked/syntastic/syntax_checkers/php/php.vim
Normal file
52
sources_non_forked/syntastic/syntax_checkers/php/php.vim
Normal file
@ -0,0 +1,52 @@
|
||||
"============================================================================
|
||||
"File: php.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_php_php_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_php_checker=1
|
||||
|
||||
function! SyntaxCheckers_php_php_IsAvailable()
|
||||
return executable("php")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_php_GetHighlightRegex(item)
|
||||
let unexpected = matchstr(a:item['text'], "unexpected '[^']\\+'")
|
||||
if len(unexpected) < 1
|
||||
return ''
|
||||
endif
|
||||
return '\V'.split(unexpected, "'")[1]
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_php_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'php',
|
||||
\ 'args': '-l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 -d xdebug.cli_color=0',
|
||||
\ 'filetype': 'php',
|
||||
\ 'subchecker': 'php' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-GNo syntax errors detected in%.%#,'.
|
||||
\ 'Parse error: %#syntax %trror\, %m in %f on line %l,'.
|
||||
\ 'Parse %trror: %m in %f on line %l,'.
|
||||
\ 'Fatal %trror: %m in %f on line %l,'.
|
||||
\ '%-G\s%#,'.
|
||||
\ '%-GErrors parsing %.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'php',
|
||||
\ 'name': 'php'})
|
44
sources_non_forked/syntastic/syntax_checkers/php/phpcs.vim
Normal file
44
sources_non_forked/syntastic/syntax_checkers/php/phpcs.vim
Normal file
@ -0,0 +1,44 @@
|
||||
"============================================================================
|
||||
"File: phpcs.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" See here for details of phpcs
|
||||
" - phpcs (see http://pear.php.net/package/PHP_CodeSniffer)
|
||||
"
|
||||
if exists("g:loaded_syntastic_php_phpcs_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phpcs_checker=1
|
||||
|
||||
function! SyntaxCheckers_php_phpcs_IsAvailable()
|
||||
return executable('phpcs')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phpcs_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'phpcs',
|
||||
\ 'args': '--report=csv',
|
||||
\ 'filetype': 'php',
|
||||
\ 'subchecker': 'phpcs' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,'.
|
||||
\ '"%f"\,%l\,%c\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'php',
|
||||
\ 'name': 'phpcs'})
|
78
sources_non_forked/syntastic/syntax_checkers/php/phpmd.vim
Normal file
78
sources_non_forked/syntastic/syntax_checkers/php/phpmd.vim
Normal file
@ -0,0 +1,78 @@
|
||||
"============================================================================
|
||||
"File: phpmd.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" See here for details of phpmd
|
||||
" - phpmd (see http://phpmd.org)
|
||||
|
||||
if exists("g:loaded_syntastic_php_phpmd_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_php_phpmd_checker=1
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_IsAvailable()
|
||||
return executable('phpmd')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)')
|
||||
if term != ''
|
||||
return '\V'.substitute(term, '\C^The \S\+ \(\w\+\)\(()\)\= .*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\C^Avoid \(variables with short\|excessively long variable\) names like \S\+\.')
|
||||
if term != ''
|
||||
return '\V'.substitute(term, '\C^Avoid \(variables with short\|excessively long variable\) names like \(\S\+\)\..*', '\2', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\C^Avoid using short method names like \S\+::\S\+()\.')
|
||||
if term != ''
|
||||
return '\V'.substitute(term, '\C^Avoid using short method names like \S\+::\(\S\+\)()\..*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\C^\S\+ accesses the super-global variable ')
|
||||
if term != ''
|
||||
return '\V'.substitute(term, '\C accesses the super-global variable .*$', '', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\C^Constant \S\+ should be defined in uppercase')
|
||||
if term != ''
|
||||
return '\V'.substitute(term, '\C^Constant \(\S\+\) should be defined in uppercase', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], "\\C^The '\\S\\+()' method which returns ")
|
||||
if term != ''
|
||||
return '\V'.substitute(term, "\\C^The '\\(\\S\\+\\()' method which returns.*", '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], '\C variable \S\+ should begin with ')
|
||||
if term != ''
|
||||
return '\V'.substitute(term, '\C.* variable \(\S\+\) should begin with .*', '\1', '')
|
||||
endif
|
||||
let term = matchstr(a:item['text'], "\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\S\\+'")
|
||||
if term != ''
|
||||
return '\V'.substitute(term, "\\C^Avoid unused \\(private fields\\|local variables\\|private methods\\|parameters\\) such as '\\(\\S\\+\\)'.*", '\2', '')
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'phpmd',
|
||||
\ 'post_args': 'text codesize,design,unusedcode,naming',
|
||||
\ 'filetype': 'php',
|
||||
\ 'subchecker': 'phpmd' })
|
||||
|
||||
let errorformat = '%E%f:%l%\s%#%m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype' : 'Style' })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'php',
|
||||
\ 'name': 'phpmd'})
|
@ -0,0 +1,51 @@
|
||||
"============================================================================
|
||||
"File: podchecker.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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("g:loaded_syntastic_pod_podchecker_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_pod_podchecker_checker=1
|
||||
|
||||
function! SyntaxCheckers_pod_podchecker_IsAvailable()
|
||||
return executable("podchecker")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_pod_podchecker_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'podchecker',
|
||||
\ 'filetype': 'pod',
|
||||
\ 'subchecker': 'podchecker' })
|
||||
|
||||
let errorformat =
|
||||
\ '%W%[%#]%[%#]%[%#] WARNING: %m at line %l in file %f,' .
|
||||
\ '%W%[%#]%[%#]%[%#] WARNING: %m at line EOF in file %f,' .
|
||||
\ '%E%[%#]%[%#]%[%#] ERROR: %m at line %l in file %f,' .
|
||||
\ '%E%[%#]%[%#]%[%#] ERROR: %m at line EOF in file %f'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'returns': [0, 1, 2] })
|
||||
|
||||
for n in range(len(loclist))
|
||||
let e = loclist[n]
|
||||
if e['valid'] && e['lnum'] == 0
|
||||
let e['lnum'] = str2nr(matchstr(e['text'], '\m\<line \zs\d\+\ze'))
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'pod',
|
||||
\ 'name': 'podchecker'})
|
||||
|
@ -0,0 +1,52 @@
|
||||
"============================================================================
|
||||
"File: puppet.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Eivind Uggedal <eivind at uggedal 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("g:loaded_syntastic_puppet_puppet_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_puppet_puppet_checker=1
|
||||
|
||||
function! SyntaxCheckers_puppet_puppet_IsAvailable()
|
||||
return executable("puppet")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_puppet_puppet_GetLocList()
|
||||
|
||||
let ver = syntastic#util#parseVersion('puppet --version 2>' . syntastic#util#DevNull())
|
||||
|
||||
if syntastic#util#versionIsAtLeast(ver, [2,7,0])
|
||||
let args = 'parser validate --color=false'
|
||||
else
|
||||
let args = '--color=false --parseonly'
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'puppet',
|
||||
\ 'args': args,
|
||||
\ 'filetype': 'puppet',
|
||||
\ 'subchecker': 'puppet' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-Gerr: Try ''puppet help parser validate'' for usage,' .
|
||||
\ '%-GError: Try ''puppet help parser validate'' for usage,' .
|
||||
\ '%Eerr: Could not parse for environment %*[a-z]: %m at %f:%l,' .
|
||||
\ '%EError: Could not parse for environment %*[a-z]: %m at %f:%l'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'puppet',
|
||||
\ 'name': 'puppet'})
|
@ -0,0 +1,47 @@
|
||||
"============================================================================
|
||||
"File: puppetlint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Eivind Uggedal <eivind at uggedal 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("g:loaded_syntastic_puppet_puppetlint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_puppet_puppetlint_checker=1
|
||||
|
||||
if exists("g:syntastic_puppet_lint_arguments")
|
||||
let g:syntastic_puppet_puppetlint_args = g:syntastic_puppet_lint_arguments
|
||||
call syntastic#util#deprecationWarn("variable g:syntastic_puppet_lint_arguments is deprecated, please use g:syntastic_puppet_puppetlint_args instead")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_puppet_puppetlint_IsAvailable()
|
||||
return
|
||||
\ executable("puppet") &&
|
||||
\ executable("puppet-lint") &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('puppet-lint --version 2>' .
|
||||
\ syntastic#util#DevNull()), [0,1,10])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_puppet_puppetlint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'puppet-lint',
|
||||
\ 'post_args': '--log-format "\%{KIND} [\%{check}] \%{message} at \%{fullpath}:\%{linenumber}"',
|
||||
\ 'filetype': 'puppet',
|
||||
\ 'subchecker': 'puppetlint' })
|
||||
|
||||
let errorformat = '%t%*[a-zA-Z] %m at %f:%l'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'puppet',
|
||||
\ 'name': 'puppetlint'})
|
@ -0,0 +1,44 @@
|
||||
"============================================================================
|
||||
"File: flake8.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Authors: Sylvain Soliman <Sylvain dot Soliman+git at gmail dot com>
|
||||
" kstep <me@kstep.me>
|
||||
"
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_python_flake8_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_flake8_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_flake8_IsAvailable()
|
||||
return executable('flake8')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_flake8_GetHighlightRegex(i)
|
||||
return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i)
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_flake8_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'flake8',
|
||||
\ 'filetype': 'python',
|
||||
\ 'subchecker': 'flake8' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l: could not compile,%-Z%p^,'.
|
||||
\ '%W%f:%l:%c: F%n %m,'.
|
||||
\ '%W%f:%l:%c: C%n %m,'.
|
||||
\ '%E%f:%l:%c: %t%n %m,'.
|
||||
\ '%E%f:%l: %t%n %m,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'python',
|
||||
\ 'name': 'flake8'})
|
||||
|
||||
runtime! syntax_checkers/python/pyflakes.vim
|
46
sources_non_forked/syntastic/syntax_checkers/python/pep8.vim
Normal file
46
sources_non_forked/syntastic/syntax_checkers/python/pep8.vim
Normal file
@ -0,0 +1,46 @@
|
||||
"============================================================================
|
||||
"File: pep8.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" For details about pep8 see: https://github.com/jcrocholl/pep8
|
||||
|
||||
if exists("g:loaded_syntastic_python_pep8_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_pep8_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_pep8_IsAvailable()
|
||||
return executable('pep8')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pep8_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'pep8',
|
||||
\ 'filetype': 'python',
|
||||
\ 'subchecker': 'pep8' })
|
||||
|
||||
let errorformat = '%f:%l:%c: %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style' })
|
||||
|
||||
for n in range(len(loclist))
|
||||
let loclist[n]['type'] = loclist[n]['text'] =~? '^W' ? 'W' : 'E'
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'python',
|
||||
\ 'name': 'pep8'})
|
@ -0,0 +1,31 @@
|
||||
"============================================================================
|
||||
"File: py3kwarn.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Authors: Liam Curry <liam@curry.name>
|
||||
"
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_python_py3kwarn_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_py3kwarn_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_py3kwarn_IsAvailable()
|
||||
return executable('py3kwarn')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_py3kwarn_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'py3kwarn',
|
||||
\ 'filetype': 'python',
|
||||
\ 'subchecker': 'py3kwarn' })
|
||||
|
||||
let errorformat = '%W%f:%l:%c: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'python',
|
||||
\ 'name': 'py3kwarn'})
|
@ -0,0 +1,63 @@
|
||||
"============================================================================
|
||||
"File: pyflakes.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Authors: Martin Grenfell <martin.grenfell@gmail.com>
|
||||
" kstep <me@kstep.me>
|
||||
" Parantapa Bhattacharya <parantapa@gmail.com>
|
||||
"
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_python_pyflakes_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_pyflakes_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_pyflakes_IsAvailable()
|
||||
return executable('pyflakes')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i)
|
||||
if match(a:i['text'], 'is assigned to but never used') > -1
|
||||
\ || match(a:i['text'], 'imported but unused') > -1
|
||||
\ || match(a:i['text'], 'undefined name') > -1
|
||||
\ || match(a:i['text'], 'redefinition of') > -1
|
||||
\ || match(a:i['text'], 'referenced before assignment') > -1
|
||||
\ || match(a:i['text'], 'duplicate argument') > -1
|
||||
\ || match(a:i['text'], 'after other statements') > -1
|
||||
\ || match(a:i['text'], 'shadowed by loop variable') > -1
|
||||
|
||||
" fun with Python's %r: try "..." first, then '...'
|
||||
let terms = split(a:i['text'], '"', 1)
|
||||
if len(terms) > 2
|
||||
return terms[1]
|
||||
endif
|
||||
|
||||
let terms = split(a:i['text'], "'", 1)
|
||||
if len(terms) > 2
|
||||
return terms[1]
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pyflakes_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'pyflakes',
|
||||
\ 'filetype': 'python',
|
||||
\ 'subchecker': 'pyflakes' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l: could not compile,'.
|
||||
\ '%-Z%p^,'.
|
||||
\ '%E%f:%l:%c: %m,'.
|
||||
\ '%E%f:%l: %m,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': {'text': "Syntax error"} })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'python',
|
||||
\ 'name': 'pyflakes'})
|
@ -0,0 +1,53 @@
|
||||
"============================================================================
|
||||
"File: pylama.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: LCD 47 <lcd047 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("g:loaded_syntastic_python_pylama_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_pylama_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_pylama_IsAvailable()
|
||||
return executable('pylama')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pylama_GetHighlightRegex(i)
|
||||
return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i)
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pylama_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'pylama',
|
||||
\ 'post_args': ' -f pep8',
|
||||
\ 'filetype': 'python',
|
||||
\ 'subchecker': 'pylama' })
|
||||
|
||||
let errorformat = '%A%f:%l:%c: %m'
|
||||
|
||||
let loclist=SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['sort'] })
|
||||
|
||||
for n in range(len(loclist))
|
||||
let loclist[n]['type'] = match(['R', 'C', 'W'], loclist[n]['text'][0]) >= 0 ? 'W' : 'E'
|
||||
if loclist[n]['text'] =~# '\v\[%(pep8|pep257|mccabe)\]$'
|
||||
let loclist[n]['subtype'] = 'Style'
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'python',
|
||||
\ 'name': 'pylama' })
|
||||
|
||||
runtime! syntax_checkers/python/pyflakes.vim
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"File: pylint.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Author: Parantapa Bhattacharya <parantapa at gmail dot com>
|
||||
"
|
||||
"============================================================================
|
||||
if exists("g:loaded_syntastic_python_pylint_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_python_pylint_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_pylint_IsAvailable()
|
||||
return executable('pylint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pylint_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'pylint',
|
||||
\ 'args': ' -f parseable -r n -i y',
|
||||
\ 'filetype': 'python',
|
||||
\ 'subchecker': 'pylint' })
|
||||
|
||||
let errorformat =
|
||||
\ '%A%f:%l:%m,' .
|
||||
\ '%A%f:(%l):%m,' .
|
||||
\ '%-Z%p^%.%#,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist=SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['sort'] })
|
||||
|
||||
for n in range(len(loclist))
|
||||
let loclist[n]['type'] = match(['R', 'C', 'W'], loclist[n]['text'][2]) >= 0 ? 'W' : 'E'
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'python',
|
||||
\ 'name': 'pylint' })
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"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_IsAvailable()
|
||||
return executable('python')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_python_GetLocList()
|
||||
let fname = "'" . escape(expand('%'), "\\'") . "'"
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'python',
|
||||
\ 'args': '-c',
|
||||
\ 'fname': syntastic#util#shescape("compile(open(" . fname . ").read(), " . fname . ", 'exec')"),
|
||||
\ 'filetype': 'python',
|
||||
\ 'subchecker': 'python' })
|
||||
|
||||
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'})
|
@ -0,0 +1,62 @@
|
||||
"============================================================================
|
||||
"File: rst.vim
|
||||
"Description: Syntax checking plugin for docutil's reStructuredText files
|
||||
"Maintainer: James Rowe <jnrowe 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.
|
||||
"
|
||||
"============================================================================
|
||||
|
||||
" We use rst2pseudoxml.py, as it is ever so marginally faster than the other
|
||||
" rst2${x} tools in docutils.
|
||||
|
||||
if exists("g:loaded_syntastic_rst_rst2pseudoxml_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_rst_rst2pseudoxml_checker=1
|
||||
|
||||
function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable()
|
||||
return executable("rst2pseudoxml.py") || executable("rst2pseudoxml")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': s:exe(),
|
||||
\ 'args': '--report=2 --exit-status=1',
|
||||
\ 'tail': syntastic#util#DevNull(),
|
||||
\ 'filetype': 'rst',
|
||||
\ 'subchecker': 'rst2pseudoxml' })
|
||||
|
||||
let errorformat =
|
||||
\ '%f:%l: (%tNFO/1) %m,'.
|
||||
\ '%f:%l: (%tARNING/2) %m,'.
|
||||
\ '%f:%l: (%tRROR/3) %m,'.
|
||||
\ '%f:%l: (%tEVERE/4) %m,'.
|
||||
\ '%-G%.%#'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
for n in range(len(loclist))
|
||||
if loclist[n]['type'] ==? 'S'
|
||||
let loclist[n]['type'] = 'E'
|
||||
elseif loclist[n]['type'] ==? 'I'
|
||||
let loclist[n]['type'] = 'W'
|
||||
let loclist[n]['subtype'] = 'Style'
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
function s:exe()
|
||||
return executable("rst2pseudoxml.py") ? "rst2pseudoxml.py" : "rst2pseudoxml"
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'rst',
|
||||
\ 'name': 'rst2pseudoxml'})
|
52
sources_non_forked/syntastic/syntax_checkers/ruby/jruby.vim
Normal file
52
sources_non_forked/syntastic/syntax_checkers/ruby/jruby.vim
Normal file
@ -0,0 +1,52 @@
|
||||
"============================================================================
|
||||
"File: jruby.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Leonid Shevtsov <leonid at shevtsov dot me>
|
||||
"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("g:loaded_syntastic_ruby_jruby_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_ruby_jruby_checker=1
|
||||
|
||||
function! SyntaxCheckers_ruby_jruby_IsAvailable()
|
||||
return executable('jruby')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_jruby_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': s:exe(),
|
||||
\ 'args': s:args(),
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'subchecker': 'jruby' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-GSyntax OK for %f,'.
|
||||
\ '%ESyntaxError in %f:%l: syntax error\, %m,'.
|
||||
\ '%Z%p^,'.
|
||||
\ '%W%f:%l: warning: %m,'.
|
||||
\ '%Z%p^,'.
|
||||
\ '%W%f:%l: %m,'.
|
||||
\ '%-C%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
function s:args()
|
||||
return has('win32') ? '-W1 -T1 -c' : '-W1 -c'
|
||||
endfunction
|
||||
|
||||
function s:exe()
|
||||
return has('win32') ? 'jruby' : 'RUBYOPT= jruby'
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'name': 'jruby'})
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"File: macruby.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"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("g:loaded_syntastic_ruby_macruby_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_ruby_macruby_checker=1
|
||||
|
||||
function! SyntaxCheckers_ruby_macruby_IsAvailable()
|
||||
return executable('macruby')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_macruby_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'RUBYOPT= macruby',
|
||||
\ 'args': '-W1 -c',
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'subchecker': 'macruby' })
|
||||
|
||||
let errorformat =
|
||||
\ '%-GSyntax OK,'.
|
||||
\ '%E%f:%l: syntax error\, %m,'.
|
||||
\ '%Z%p^,'.
|
||||
\ '%W%f:%l: warning: %m,'.
|
||||
\ '%Z%p^,'.
|
||||
\ '%W%f:%l: %m,'.
|
||||
\ '%-C%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'name': 'macruby'})
|
77
sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim
Normal file
77
sources_non_forked/syntastic/syntax_checkers/ruby/mri.vim
Normal file
@ -0,0 +1,77 @@
|
||||
"============================================================================
|
||||
"File: mri.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_ruby_mri_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_ruby_mri_checker=1
|
||||
|
||||
if !exists("g:syntastic_ruby_exec")
|
||||
let g:syntastic_ruby_exec = "ruby"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ruby_mri_IsAvailable()
|
||||
return executable(expand(g:syntastic_ruby_exec))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
|
||||
if match(a:i['text'], 'assigned but unused variable') > -1
|
||||
let term = split(a:i['text'], ' - ')[1]
|
||||
return '\V\<'.term.'\>'
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_mri_GetLocList()
|
||||
let exe = expand(g:syntastic_ruby_exec)
|
||||
if !has('win32')
|
||||
let exe = 'RUBYOPT= ' . exe
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': exe,
|
||||
\ 'args': '-w -T1 -c',
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'subchecker': 'mri' })
|
||||
|
||||
"this is a hack to filter out a repeated useless warning in rspec files
|
||||
"containing lines like
|
||||
"
|
||||
" foo.should == 'bar'
|
||||
"
|
||||
"Which always generate the warning below. Note that ruby >= 1.9.3 includes
|
||||
"the word "possibly" in the warning
|
||||
let errorformat = '%-G%.%#warning: %\(possibly %\)%\?useless use of == in void context,'
|
||||
|
||||
" filter out lines starting with ...
|
||||
" long lines are truncated and wrapped in ... %p then returns the wrong
|
||||
" column offset
|
||||
let errorformat .= '%-G%\%.%\%.%\%.%.%#,'
|
||||
|
||||
let errorformat .=
|
||||
\ '%-GSyntax OK,'.
|
||||
\ '%E%f:%l: syntax error\, %m,'.
|
||||
\ '%Z%p^,'.
|
||||
\ '%W%f:%l: warning: %m,'.
|
||||
\ '%Z%p^,'.
|
||||
\ '%W%f:%l: %m,'.
|
||||
\ '%-C%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'name': 'mri'})
|
@ -0,0 +1,55 @@
|
||||
"============================================================================
|
||||
"File: rubocop.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Recai Oktaş <roktas@bil.omu.edu.tr>
|
||||
"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.
|
||||
"
|
||||
"============================================================================
|
||||
"
|
||||
" In order to use rubocop with the default ruby checker (mri):
|
||||
" let g:syntastic_ruby_checkers = ['mri', 'rubocop']
|
||||
|
||||
if exists("g:loaded_syntastic_ruby_rubocop_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_ruby_rubocop_checker=1
|
||||
|
||||
function! SyntaxCheckers_ruby_rubocop_IsAvailable()
|
||||
return
|
||||
\ executable('rubocop') &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('rubocop --version'), [0,9,0])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_rubocop_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'rubocop',
|
||||
\ 'args': '--format emacs --silent',
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'subchecker': 'rubocop' })
|
||||
|
||||
let errorformat = '%f:%l:%c: %t: %m'
|
||||
|
||||
let loclist = SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style'})
|
||||
|
||||
" convert rubocop severities to error types recognized by syntastic
|
||||
for n in range(len(loclist))
|
||||
if loclist[n]['type'] == 'F'
|
||||
let loclist[n]['type'] = 'E'
|
||||
elseif loclist[n]['type'] != 'W' && loclist[n]['type'] != 'E'
|
||||
let loclist[n]['type'] = 'W'
|
||||
endif
|
||||
endfor
|
||||
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'name': 'rubocop'})
|
42
sources_non_forked/syntastic/syntax_checkers/rust/rustc.vim
Normal file
42
sources_non_forked/syntastic/syntax_checkers/rust/rustc.vim
Normal file
@ -0,0 +1,42 @@
|
||||
"============================================================================
|
||||
"File: rust.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Chad Jablonski <chad.jablonski 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("g:loaded_syntastic_rust_rustc_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_rust_rustc_checker=1
|
||||
|
||||
function! SyntaxCheckers_rust_rustc_IsAvailable()
|
||||
return executable("rustc")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_rust_rustc_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'rustc',
|
||||
\ 'args': '--parse-only',
|
||||
\ 'filetype': 'rust',
|
||||
\ 'subchecker': 'rustc' })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: \\d%#:\\d%# %.%\{-}error:%.%\{-} %m,' .
|
||||
\ '%W%f:%l:%c: \\d%#:\\d%# %.%\{-}warning:%.%\{-} %m,' .
|
||||
\ '%C%f:%l %m,' .
|
||||
\ '%-Z%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'rust',
|
||||
\ 'name': 'rustc'})
|
78
sources_non_forked/syntastic/syntax_checkers/sass/sass.vim
Normal file
78
sources_non_forked/syntastic/syntax_checkers/sass/sass.vim
Normal file
@ -0,0 +1,78 @@
|
||||
"============================================================================
|
||||
"File: sass.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_sass_sass_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_sass_sass_checker=1
|
||||
|
||||
function! SyntaxCheckers_sass_sass_IsAvailable()
|
||||
return executable("sass")
|
||||
endfunction
|
||||
|
||||
"sass caching for large files drastically speeds up the checking, but store it
|
||||
"in a temp location otherwise sass puts .sass_cache dirs in the users project
|
||||
let s:sass_cache_location = tempname()
|
||||
|
||||
"By default do not check partials as unknown variables are a syntax error
|
||||
if !exists("g:syntastic_sass_check_partials")
|
||||
let g:syntastic_sass_check_partials = 0
|
||||
endif
|
||||
|
||||
"use compass imports if available
|
||||
let s:imports = ""
|
||||
if executable("compass")
|
||||
let s:imports = "--compass"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_sass_sass_GetLocList()
|
||||
if !g:syntastic_sass_check_partials && expand('%:t')[0] == '_'
|
||||
return []
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'sass',
|
||||
\ 'args': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check',
|
||||
\ 'filetype': 'sass',
|
||||
\ 'subchecker': 'sass' })
|
||||
|
||||
let errorformat =
|
||||
\ '%ESyntax %trror: %m,' .
|
||||
\ '%+C %.%#,' .
|
||||
\ '%C on line %l of %f\, %.%#,' .
|
||||
\ '%C on line %l of %f,' .
|
||||
\ '%-G %\+from line %.%#,' .
|
||||
\ '%-G %\+Use --trace for backtrace.,' .
|
||||
\ '%W%>DEPRECATION WARNING on line %l of %f:,' .
|
||||
\ '%+C%> %.%#,' .
|
||||
\ '%W%>WARNING: on line %l of %f:,' .
|
||||
\ '%+C%> %.%#,' .
|
||||
\ '%W%>WARNING on line %l of %f: %m,' .
|
||||
\ '%+C%> %.%#,' .
|
||||
\ '%W%>WARNING on line %l of %f:,' .
|
||||
\ '%Z%m,' .
|
||||
\ '%W%>WARNING: %m,' .
|
||||
\ '%C on line %l of %f\, %.%#,' .
|
||||
\ '%C on line %l of %f,' .
|
||||
\ '%-G %\+from line %.%#,' .
|
||||
\ 'Syntax %trror on line %l: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'postprocess': ['compressWhitespace'] })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'sass',
|
||||
\ 'name': 'sass'})
|
46
sources_non_forked/syntastic/syntax_checkers/scala/fsc.vim
Normal file
46
sources_non_forked/syntastic/syntax_checkers/scala/fsc.vim
Normal file
@ -0,0 +1,46 @@
|
||||
"============================================================================
|
||||
"File: fsc.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('g:loaded_syntastic_scala_fsc_checker')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_scala_fsc_checker = 1
|
||||
|
||||
function! SyntaxCheckers_scala_fsc_IsAvailable()
|
||||
return executable('fsc')
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_scala_options')
|
||||
let g:syntastic_scala_options = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_scala_fsc_GetLocList()
|
||||
" fsc has some serious problems with the
|
||||
" working directory changing after being started
|
||||
" that's why we better pass an absolute path
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'fsc',
|
||||
\ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options,
|
||||
\ 'fname': syntastic#util#shexpand('%:p'),
|
||||
\ 'filetype': 'scala',
|
||||
\ 'subchecker': 'fsc' })
|
||||
|
||||
let errorformat = '%f:%l: %trror: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'scala',
|
||||
\ 'name': 'fsc'})
|
@ -0,0 +1,43 @@
|
||||
"============================================================================
|
||||
"File: scala.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Rickey Visinski <rickeyvisinski 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("g:loaded_syntastic_scala_scalac_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_scala_scalac_checker=1
|
||||
|
||||
function! SyntaxCheckers_scala_scalac_IsAvailable()
|
||||
return executable("scalac")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_scala_options')
|
||||
let g:syntastic_scala_options = ''
|
||||
endif
|
||||
|
||||
|
||||
function! SyntaxCheckers_scala_scalac_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'scalac',
|
||||
\ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options,
|
||||
\ 'filetype': 'scala',
|
||||
\ 'subchecker': 'scalac' })
|
||||
|
||||
let errorformat = '%f:%l: %trror: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'scala',
|
||||
\ 'name': 'scalac'})
|
31
sources_non_forked/syntastic/syntax_checkers/scss/sass.vim
Normal file
31
sources_non_forked/syntastic/syntax_checkers/scss/sass.vim
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
"============================================================================
|
||||
"File: scss.vim
|
||||
"Description: scss syntax checking plugin for syntastic
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_scss_sass_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_scss_sass_checker=1
|
||||
|
||||
function! SyntaxCheckers_scss_sass_IsAvailable()
|
||||
return SyntaxCheckers_sass_sass_IsAvailable()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_scss_sass_GetLocList()
|
||||
return SyntaxCheckers_sass_sass_GetLocList()
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'scss',
|
||||
\ 'name': 'sass'})
|
||||
|
||||
runtime! syntax_checkers/sass/*.vim
|
@ -0,0 +1,45 @@
|
||||
"============================================================================
|
||||
"File: checkbashisms.vim
|
||||
"Description: Shell script syntax/style checking plugin for syntastic.vim
|
||||
"Notes: checkbashisms.pl can be downloaded from
|
||||
" http://debian.inode.at/debian/pool/main/d/devscripts/
|
||||
" as part of the devscripts package.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_sh_checkbashisms_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_sh_checkbashisms_checker=1
|
||||
|
||||
|
||||
function! SyntaxCheckers_sh_checkbashisms_IsAvailable()
|
||||
return executable('checkbashisms')
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_sh_checkbashisms_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'checkbashisms',
|
||||
\ 'args': '-fx',
|
||||
\ 'filetype': 'sh',
|
||||
\ 'subchecker': 'checkbashisms'})
|
||||
|
||||
let errorformat =
|
||||
\ '%-Gscript %f is already a bash script; skipping,' .
|
||||
\ '%Eerror: %f: %m\, opened in line %l,' .
|
||||
\ '%Eerror: %f: %m,' .
|
||||
\ '%Ecannot open script %f for reading: %m,' .
|
||||
\ '%Wscript %f %m,%C%.# lines,' .
|
||||
\ '%Wpossible bashism in %f line %l (%m):,%C%.%#,%Z.%#,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'subtype': 'Style'})
|
||||
endfunction
|
||||
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'sh',
|
||||
\ 'name': 'checkbashisms'})
|
83
sources_non_forked/syntastic/syntax_checkers/sh/sh.vim
Normal file
83
sources_non_forked/syntastic/syntax_checkers/sh/sh.vim
Normal file
@ -0,0 +1,83 @@
|
||||
"============================================================================
|
||||
"File: sh.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("g:loaded_syntastic_sh_sh_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_sh_sh_checker=1
|
||||
|
||||
function! s:GetShell()
|
||||
if !exists('b:shell') || b:shell == ''
|
||||
let b:shell = ''
|
||||
let shebang = getbufline(bufnr('%'), 1)[0]
|
||||
if len(shebang) > 0
|
||||
if match(shebang, 'bash') >= 0
|
||||
let b:shell = 'bash'
|
||||
elseif match(shebang, 'zsh') >= 0
|
||||
let b:shell = 'zsh'
|
||||
elseif match(shebang, 'sh') >= 0
|
||||
let b:shell = 'sh'
|
||||
endif
|
||||
endif
|
||||
" try to use env variable in case no shebang could be found
|
||||
if b:shell == ''
|
||||
let b:shell = fnamemodify(expand('$SHELL'), ':t')
|
||||
endif
|
||||
endif
|
||||
return b:shell
|
||||
endfunction
|
||||
|
||||
function! s:ForwardToZshChecker()
|
||||
let registry = g:SyntasticRegistry.Instance()
|
||||
if registry.checkable('zsh')
|
||||
return SyntaxCheckers_zsh_zsh_GetLocList()
|
||||
else
|
||||
return []
|
||||
endif
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:IsShellValid()
|
||||
return len(s:GetShell()) > 0 && executable(s:GetShell())
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_sh_sh_IsAvailable()
|
||||
return s:IsShellValid()
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_sh_sh_GetLocList()
|
||||
if s:GetShell() == 'zsh'
|
||||
return s:ForwardToZshChecker()
|
||||
endif
|
||||
|
||||
if !s:IsShellValid()
|
||||
return []
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': s:GetShell(),
|
||||
\ 'args': '-n',
|
||||
\ 'filetype': 'sh',
|
||||
\ 'subchecker': 'sh'})
|
||||
|
||||
let errorformat = '%f: line %l: %m'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat})
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'sh',
|
||||
\ 'name': 'sh'})
|
57
sources_non_forked/syntastic/syntax_checkers/slim/slimrb.vim
Normal file
57
sources_non_forked/syntastic/syntax_checkers/slim/slimrb.vim
Normal file
@ -0,0 +1,57 @@
|
||||
"============================================================================
|
||||
"File: slim.vim
|
||||
"Description: Syntax checking plugin for syntastic.vim
|
||||
"Maintainer: Martin Grenfell <martin.grenfell 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("g:loaded_syntastic_slim_slimrb_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_slim_slimrb_checker=1
|
||||
|
||||
function! SyntaxCheckers_slim_slimrb_IsAvailable()
|
||||
return executable("slimrb")
|
||||
endfunction
|
||||
|
||||
function! s:SlimrbVersion()
|
||||
if !exists('s:slimrb_version')
|
||||
let s:slimrb_version = syntastic#util#parseVersion('slimrb --version 2>' . syntastic#util#DevNull())
|
||||
end
|
||||
return s:slimrb_version
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_slim_slimrb_GetLocList()
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'slimrb',
|
||||
\ 'args': '-c',
|
||||
\ 'filetype': 'slim',
|
||||
\ 'subchecker': 'slimrb' })
|
||||
|
||||
if syntastic#util#versionIsAtLeast(s:SlimrbVersion(), [1,3,1])
|
||||
let errorformat =
|
||||
\ '%C\ %#%f\, Line %l\, Column %c,'.
|
||||
\ '%-G\ %.%#,'.
|
||||
\ '%ESlim::Parser::SyntaxError: %m,'.
|
||||
\ '%+C%.%#'
|
||||
else
|
||||
let errorformat =
|
||||
\ '%C\ %#%f\, Line %l,'.
|
||||
\ '%-G\ %.%#,'.
|
||||
\ '%ESlim::Parser::SyntaxError: %m,'.
|
||||
\ '%+C%.%#'
|
||||
endif
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'slim',
|
||||
\ 'name': 'slimrb'})
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user