refactor all the syntax checkers to use the new API and dir layout

This commit is contained in:
Martin Grenfell 2013-01-27 20:08:30 +00:00
parent 58ba8d3161
commit e0b8e87c93
89 changed files with 618 additions and 507 deletions

View File

@ -10,12 +10,19 @@ let g:SyntasticChecker = {}
function! g:SyntasticChecker.New(args) function! g:SyntasticChecker.New(args)
let newObj = copy(self) let newObj = copy(self)
let newObj._locListFunc = a:args['loclistFunc']
let newObj._isAvailableFunc = a:args['isAvailableFunc']
let newObj._filetype = a:args['filetype'] let newObj._filetype = a:args['filetype']
let newObj._name = a:args['name'] let newObj._name = a:args['name']
let newObj._highlightRegexFunc = get(a:args, 'highlightRegexFunc', '')
let prefix = 'SyntaxCheckers_' . newObj._filetype . '_' . newObj._name . '_'
let newObj._locListFunc = function(prefix . 'GetLocList')
let newObj._isAvailableFunc = function(prefix . 'IsAvailable')
if exists('*' . prefix . 'GetHighlightRegex')
let newObj._highlightRegexFunc = function(prefix. 'GetHighlightRegex')
else
let newObj._highlightRegexFunc = ''
endif
return newObj return newObj
endfunction endfunction

View File

@ -67,7 +67,11 @@ if !exists('g:syntastic_ada_config_file')
let g:syntastic_ada_config_file = '.syntastic_ada_config' let g:syntastic_ada_config_file = '.syntastic_ada_config'
endif endif
function! SyntaxCheckers_ada_GetLocList() function! SyntaxCheckers_ada_gcc_IsAvailable()
return executable('gcc')
endfunction
function! SyntaxCheckers_ada_gcc_GetLocList()
let makeprg = 'gcc -c -fsyntax-only ' let makeprg = 'gcc -c -fsyntax-only '
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m' let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
@ -121,6 +125,10 @@ function! SyntaxCheckers_ada_GetLocList()
endif endif
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ada',
\ 'name': 'gcc'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

View File

@ -24,13 +24,11 @@
" Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. " Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_applescript_osacompile_IsAvailable()
return executable('osacompile')
endfunction
"bail if the user doesnt have osacompile installed function! SyntaxCheckers_applescript_osacompile_GetLocList()
if !executable("osacompile")
finish
endif
function! SyntaxCheckers_applescript_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'osacompile', \ 'exe': 'osacompile',
\ 'args': '-o ' . tempname() . '.scpt ' }) \ 'args': '-o ' . tempname() . '.scpt ' })
@ -38,3 +36,7 @@ function! SyntaxCheckers_applescript_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'applescript',
\ 'name': 'osacompile'})

View File

@ -18,11 +18,14 @@ if executable("checkpatch.pl")
let g:syntastic_c_checker_checkpatch_location = 'checkpatch.pl' let g:syntastic_c_checker_checkpatch_location = 'checkpatch.pl'
elseif executable("./scripts/checkpatch.pl") elseif executable("./scripts/checkpatch.pl")
let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl' let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl'
else
finish
endif endif
function! SyntaxCheckers_c_GetLocList() function SyntaxCheckers_c_checkpatch_IsAvailable()
exists("g:syntastic_c_checker_checkpatch_location")
endfunction
function! SyntaxCheckers_c_checkpatch_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': g:syntastic_c_checker_checkpatch_location, \ 'exe': g:syntastic_c_checker_checkpatch_location,
\ 'args': '--no-summary --no-tree --terse --file', \ 'args': '--no-summary --no-tree --terse --file',
@ -30,8 +33,11 @@ function! SyntaxCheckers_c_GetLocList()
let errorformat = '%f:%l: %tARNING: %m,%f:%l: %tRROR: %m' let errorformat = '%f:%l: %tARNING: %m,%f:%l: %tRROR: %m'
let oclist = SyntasticMake({ 'makeprg': makeprg, return SyntasticMake({ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr("")} }) \ 'defaults': {'bufnr': bufnr("")} })
return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c',
\ 'name': 'checkpatch'})

View File

@ -73,8 +73,8 @@ if exists('loaded_gcc_syntax_checker')
endif endif
let loaded_gcc_syntax_checker = 1 let loaded_gcc_syntax_checker = 1
if !executable(g:syntastic_c_checker) function SyntaxCheckers_c_gcc_IsAvailable()
finish return executable(g:syntastic_c_checker)
endif endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
@ -88,7 +88,7 @@ if !exists('g:syntastic_c_config_file')
let g:syntastic_c_config_file = '.syntastic_c_config' let g:syntastic_c_config_file = '.syntastic_c_config'
endif endif
function! SyntaxCheckers_c_GetLocList() function! SyntaxCheckers_c_gcc_GetLocList()
let makeprg = g:syntastic_c_checker . ' -x c -fsyntax-only ' let makeprg = g:syntastic_c_checker . ' -x c -fsyntax-only '
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '. let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
\ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '. \ 'identifier is reported only%.%#,%-G%f:%l: %#error: %#for '.
@ -159,6 +159,10 @@ function! SyntaxCheckers_c_GetLocList()
endif endif
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c',
\ 'name': 'gcc'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

View File

@ -13,12 +13,11 @@ if exists("loaded_sparse_syntax_checker")
endif endif
let loaded_sparse_syntax_checker = 1 let loaded_sparse_syntax_checker = 1
" Bail if the user doesn't have `sparse.pl` or ./scripts/checkpatch.pl installed. function! SyntaxCheckers_c_sparse_IsAvailable()
if !executable("sparse") return executable("sparse")
finish endfunction
endif
function! SyntaxCheckers_c_GetLocList() function! SyntaxCheckers_c_sparse_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'sparse', \ 'exe': 'sparse',
\ 'args': syntastic#c#ReadConfig(g:syntastic_sparse_config_file) }) \ 'args': syntastic#c#ReadConfig(g:syntastic_sparse_config_file) })
@ -31,3 +30,7 @@ function! SyntaxCheckers_c_GetLocList()
\ 'defaults': {'bufnr': bufnr("")} }) \ 'defaults': {'bufnr': bufnr("")} })
return loclist return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c',
\ 'name': 'sparse'})

View File

@ -15,7 +15,11 @@ if !executable("coco")
finish finish
endif endif
function! SyntaxCheckers_co_GetLocList() function! SyntaxCheckers_co_coco_GetLocList()
return executable('coco')
endfunction
function! SyntaxCheckers_co_coco_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'coco', \ 'exe': 'coco',
\ 'args': '-c -o /tmp' }) \ 'args': '-c -o /tmp' })
@ -23,3 +27,7 @@ function! SyntaxCheckers_co_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'co',
\ 'name': 'coco'})

View File

@ -10,17 +10,17 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have coffee installed
if !executable("coffee")
finish
endif
if !exists('g:syntastic_coffee_lint_options') if !exists('g:syntastic_coffee_lint_options')
let g:syntastic_coffee_lint_options = "" let g:syntastic_coffee_lint_options = ""
endif endif
function! SyntaxCheckers_coffee_GetLocList() function! SyntaxCheckers_coffee_coffee_IsAvailable()
return executable("coffee") && executable('coffeelint')
endfunction
function! SyntaxCheckers_coffee_coffee_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'coffee', \ 'exe': 'coffee',
\ 'args': '-c -l -o /tmp' }) \ 'args': '-c -l -o /tmp' })
@ -45,3 +45,7 @@ function s:GetCoffeeLintErrors()
return lint_results return lint_results
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'coffee',
\ 'name': 'coffee'})

View File

@ -80,10 +80,6 @@ if !exists('g:syntastic_cpp_compiler_options')
let g:syntastic_cpp_compiler_options = '' let g:syntastic_cpp_compiler_options = ''
endif endif
if !executable(g:syntastic_cpp_compiler)
finish
endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
@ -91,7 +87,11 @@ if !exists('g:syntastic_cpp_config_file')
let g:syntastic_cpp_config_file = '.syntastic_cpp_config' let g:syntastic_cpp_config_file = '.syntastic_cpp_config'
endif endif
function! SyntaxCheckers_cpp_GetLocList() function! SyntaxCheckers_cpp_gpp_IsAvailable()
return executable(g:syntastic_cpp_compiler)
endfunction
function! SyntaxCheckers_cpp_gpp_GetLocList()
let makeprg = g:syntastic_cpp_compiler . ' -x c++ -fsyntax-only ' . let makeprg = g:syntastic_cpp_compiler . ' -x c++ -fsyntax-only ' .
\ g:syntastic_cpp_compiler_options \ g:syntastic_cpp_compiler_options
let errorformat = '%-G%f:%s:,%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: '. let errorformat = '%-G%f:%s:,%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: '.
@ -150,6 +150,10 @@ function! SyntaxCheckers_cpp_GetLocList()
endif endif
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp',
\ 'name': 'gpp'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

View File

@ -10,11 +10,11 @@
" "
"============================================================================ "============================================================================
if !executable('mcs') function! SyntaxCheckers_cs_mcs_IsAvailable()
finish return executable('mcs')
endif endfunction
function! SyntaxCheckers_cs_GetLocList() function! SyntaxCheckers_cs_mcs_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'mcs', \ 'exe': 'mcs',
\ 'args': '--parse' }) \ 'args': '--parse' })
@ -24,3 +24,6 @@ function! SyntaxCheckers_cs_GetLocList()
\ 'defaults': {'bufnr': bufnr("")} }) \ 'defaults': {'bufnr': bufnr("")} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cs',
\ 'name': 'mcs'})

View File

@ -18,12 +18,11 @@ if !exists('g:syntastic_csslint_options')
let g:syntastic_csslint_options = "" let g:syntastic_csslint_options = ""
endif endif
" Bail if the user doesn't have `csslint` installed. function! SyntaxCheckers_css_csslint_IsAvailable()
if !executable("csslint") return executable('csslint')
finish endfunction
endif
function! SyntaxCheckers_css_GetLocList() function! SyntaxCheckers_css_csslint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'csslint', \ 'exe': 'csslint',
\ 'args': '--format=compact ' . g:syntastic_csslint_options }) \ 'args': '--format=compact ' . g:syntastic_csslint_options })
@ -36,3 +35,7 @@ function! SyntaxCheckers_css_GetLocList()
\ 'defaults': {'bufnr': bufnr("")} }) \ 'defaults': {'bufnr': bufnr("")} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'css',
\ 'name': 'csslint'})

View File

@ -10,12 +10,11 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have cucumber installed function! SyntaxCheckers_cucumber_cucumber_IsAvailable()
if !executable("cucumber") return executable('cucumber')
finish endfunction
endif
function! SyntaxCheckers_cucumber_GetLocList() function! SyntaxCheckers_cucumber_cucumber_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'cucumber', \ 'exe': 'cucumber',
\ 'args': '--dry-run --quiet --strict --format pretty' }) \ 'args': '--dry-run --quiet --strict --format pretty' })
@ -23,3 +22,7 @@ function! SyntaxCheckers_cucumber_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cucumber',
\ 'name': 'cucumber'})

View File

@ -18,11 +18,12 @@
" "
" let g:syntastic_cuda_arch = "sm_20" " let g:syntastic_cuda_arch = "sm_20"
if !executable('nvcc')
finish
endif
function! SyntaxCheckers_cuda_GetLocList() function! SyntaxCheckers_cuda_nvcc_IsAvailable()
return executable('nvcc')
endfunction
function! SyntaxCheckers_cuda_nvcc_GetLocList()
if exists('g:syntastic_cuda_arch') if exists('g:syntastic_cuda_arch')
let arch_flag = '-arch='.g:syntastic_cuda_arch let arch_flag = '-arch='.g:syntastic_cuda_arch
else else
@ -42,3 +43,7 @@ function! SyntaxCheckers_cuda_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cuda',
\ 'name': 'nvcc'})

View File

@ -64,10 +64,6 @@
" "
" let g:syntastic_d_remove_include_errors = 1 " let g:syntastic_d_remove_include_errors = 1
if !executable('dmd')
finish
endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
@ -75,7 +71,11 @@ if !exists('g:syntastic_d_config_file')
let g:syntastic_d_config_file = '.syntastic_d_config' let g:syntastic_d_config_file = '.syntastic_d_config'
endif endif
function! SyntaxCheckers_d_GetLocList() function! SyntaxCheckers_d_dmd_IsAvailable()
return executable('dmd')
endfunction
function! SyntaxCheckers_d_dmd_GetLocList()
let makeprg = 'dmd -of/dev/null -c ' let makeprg = 'dmd -of/dev/null -c '
let errorformat = '%-G%f:%s:,%f(%l): %m,%f:%l: %m' let errorformat = '%-G%f:%s:,%f(%l): %m,%f:%l: %m'
@ -129,6 +129,10 @@ function! SyntaxCheckers_d_GetLocList()
endif endif
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'd',
\ 'name': 'dmd'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

View File

@ -1,14 +0,0 @@
"============================================================================
"File: dart.vim
"Description: Figures out which dart syntax checker (if any) to load
" from the dart directory.
"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.
"
"============================================================================
call SyntasticLoadChecker('dart')

View File

@ -12,7 +12,11 @@ if !exists("g:syntastic_dart_analyzer_conf")
let g:syntastic_dart_analyzer_conf = '' let g:syntastic_dart_analyzer_conf = ''
endif endif
function! SyntaxCheckers_dart_GetLocList() function! SyntaxCheckers_dart_dart_analyser_IsAvailable()
return executable("dart_analyser")
endif
function! SyntaxCheckers_dart_dart_analyser_GetLocList()
let args = !empty(g:syntastic_dart_analyzer_conf) ? ' ' . g:syntastic_dart_analyzer_conf : '' let args = !empty(g:syntastic_dart_analyzer_conf) ? ' ' . g:syntastic_dart_analyzer_conf : ''
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'dart_analyzer', \ 'exe': 'dart_analyzer',
@ -22,3 +26,7 @@ function! SyntaxCheckers_dart_GetLocList()
let errorformat = '%Efile:%f:%l:%c: %m' let errorformat = '%Efile:%f:%l:%c: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'dart',
\ 'name': 'dart_analyser'})

View File

@ -10,12 +10,12 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have tidy or grep installed
if !executable("xmllint")
finish
endif
function! SyntaxCheckers_docbk_GetLocList() function! SyntaxCheckers_docbk_xmllint_IsAvailable()
return executable('xmllint')
endfunction
function! SyntaxCheckers_docbk_xmllint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'xmllint', \ 'exe': 'xmllint',
\ 'args': '--xinclude --noout --postvalid' }) \ 'args': '--xinclude --noout --postvalid' })
@ -24,3 +24,7 @@ function! SyntaxCheckers_docbk_GetLocList()
return loclist return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'docbk',
\ 'name': 'xmllint'})

View File

@ -9,12 +9,11 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_elixir_elixir_IsAvailable()
return executable('elixir')
endfunction
if !executable('elixir') function! SyntaxCheckers_elixir_elixir_GetLocList()
finish
endif
function! SyntaxCheckers_elixir_GetLocList()
let makeprg = syntastic#makeprg#build({ 'exe': 'elixir' }) let makeprg = syntastic#makeprg#build({ 'exe': 'elixir' })
let errorformat = '** %*[^\ ] %f:%l: %m' let errorformat = '** %*[^\ ] %f:%l: %m'
@ -24,3 +23,7 @@ function! SyntaxCheckers_elixir_GetLocList()
return elixir_results return elixir_results
endif endif
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'elixir',
\ 'name': 'elixir'})

View File

@ -10,18 +10,16 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have escript installed
if !executable("escript")
finish
endif
let s:check_file = expand('<sfile>:p:h') . '/erlang_check_file.erl' let s:check_file = expand('<sfile>:p:h') . '/erlang_check_file.erl'
if !exists("g:syntastic_erlc_include_path") if !exists("g:syntastic_erlc_include_path")
let g:syntastic_erlc_include_path="" let g:syntastic_erlc_include_path=""
endif endif
function! SyntaxCheckers_erlang_escript_IsAvailable()
return executable('escript')
endfunction
function! SyntaxCheckers_erlang_GetLocList() function! SyntaxCheckers_erlang_escript_GetLocList()
let extension = expand('%:e') let extension = expand('%:e')
if match(extension, 'hrl') >= 0 if match(extension, 'hrl') >= 0
return [] return []
@ -40,3 +38,7 @@ function! SyntaxCheckers_erlang_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'erlang',
\ 'name': 'escript'})

View File

@ -14,12 +14,12 @@ if !exists("g:syntastic_ruby_exec")
let g:syntastic_ruby_exec = "ruby" let g:syntastic_ruby_exec = "ruby"
endif endif
"bail if the user doesnt have ruby installed
if !executable(expand(g:syntastic_ruby_exec))
finish
endif
function! SyntaxCheckers_eruby_GetLocList() function! SyntaxCheckers_eruby_ruby_IsAvailable()
executable(expand(g:syntastic_ruby_exec))
endfunction
function! SyntaxCheckers_eruby_ruby_GetLocList()
let ruby_exec=expand(g:syntastic_ruby_exec) let ruby_exec=expand(g:syntastic_ruby_exec)
if !has('win32') if !has('win32')
let ruby_exec='RUBYOPT= ' . ruby_exec let ruby_exec='RUBYOPT= ' . ruby_exec
@ -34,3 +34,7 @@ function! SyntaxCheckers_eruby_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat}) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat})
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'erlang',
\ 'name': 'ruby'})

View File

@ -18,16 +18,15 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have fortran installed
if !executable("gfortran")
finish
endif
if !exists('g:syntastic_fortran_flags') if !exists('g:syntastic_fortran_flags')
let g:syntastic_fortran_flags = '' let g:syntastic_fortran_flags = ''
endif endif
function! SyntaxCheckers_fortran_GetLocList() function! SyntaxCheckers_fortran_gfortran_IsAvailable()
return executable('gfortran')
endfunction
function! SyntaxCheckers_fortran_gfortran_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'gfortran', \ 'exe': 'gfortran',
\ 'args': s:args() }) \ 'args': s:args() })
@ -42,3 +41,7 @@ function s:args()
endif endif
return rv return rv
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'fortran',
\ 'name': 'gfortran'})

View File

@ -20,13 +20,8 @@
" See xmlcatalog(1) and http://www.xmlsoft.org/catalog.html for more " See xmlcatalog(1) and http://www.xmlsoft.org/catalog.html for more
" information. " information.
"bail if the user doesn't have xmllint installed runtime syntax_checkers/xml/xmllint.vim
if !executable("xmllint")
finish
endif
runtime syntax_checkers/xml.vim function! SyntaxCheckers_gentoo_metadata_xmllint_GetLocList()
return SyntaxCheckers_xml_xmllint_GetLocList()
function! SyntaxCheckers_gentoo_metadata_GetLocList()
return SyntaxCheckers_xml_GetLocList()
endfunction endfunction

View File

@ -1,17 +0,0 @@
"============================================================================
"File: go.vim
"Description: Loads a go syntax checker from the go directory
"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.
"
" Use g:syntastic_go_checker option to specify which go executable
" should be used (see below for a list of supported checkers).
" If g:syntastic_go_checker is not set, just use the first syntax
" checker that we find installed.
"============================================================================
call SyntasticLoadChecker('go')

View File

@ -12,7 +12,11 @@
" Use a BufWritePre autocommand to that end: " Use a BufWritePre autocommand to that end:
" autocmd FileType go autocmd BufWritePre <buffer> Fmt " autocmd FileType go autocmd BufWritePre <buffer> Fmt
"============================================================================ "============================================================================
function! SyntaxCheckers_go_GetLocList() 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 " 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 " syntax errors in the current file if another file with syntax error is
" compiled first. " compiled first.
@ -49,3 +53,7 @@ function! SyntaxCheckers_go_GetLocList()
return errors return errors
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'go',
\ 'name': 'go'})

View File

@ -12,7 +12,11 @@
" Use a BufWritePre autocommand to that end: " Use a BufWritePre autocommand to that end:
" autocmd FileType go autocmd BufWritePre <buffer> Fmt " autocmd FileType go autocmd BufWritePre <buffer> Fmt
"============================================================================ "============================================================================
function! SyntaxCheckers_go_GetLocList() function! SyntaxCheckers_go_gofmt_IsAvailable()
return executable('go')
endfunction
function! SyntaxCheckers_go_gofmt_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'gofmt', \ 'exe': 'gofmt',
\ 'args': '-l', \ 'args': '-l',
@ -21,3 +25,7 @@ function! SyntaxCheckers_go_GetLocList()
let errorformat = '%f:%l:%c: %m,%-G%.%#' let errorformat = '%f:%l:%c: %m,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'type': 'e'} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'go',
\ 'name': 'gofmt'})

View File

@ -10,15 +10,18 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have the haml binary installed function! SyntaxCheckers_haml_haml_IsAvailable()
if !executable("haml") return executable('haml')
finish endfunction
endif
function! SyntaxCheckers_haml_GetLocList() function! SyntaxCheckers_haml_haml_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'haml', \ 'exe': 'haml',
\ 'args': '-c' }) \ 'args': '-c' })
let errorformat = 'Haml error on line %l: %m,Syntax error on line %l: %m,%-G%.%#' let errorformat = 'Haml error on line %l: %m,Syntax error on line %l: %m,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'haml',
\ 'name': 'haml'})

View File

@ -1,27 +0,0 @@
"============================================================================
"File: haskell.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:syntastic_haskell_checker')
if executable('hdevtools')
runtime! syntax_checkers/haskell/hdevtools.vim
elseif executable('ghc-mod')
runtime! syntax_checkers/haskell/ghc-mod.vim
endif
elseif g:syntastic_haskell_checker == 'hdevtools'
if executable('hdevtools')
runtime! syntax_checkers/haskell/hdevtools.vim
endif
elseif g:syntastic_haskell_checker == 'ghc-mod'
if executable('ghc-mod')
runtime! syntax_checkers/haskell/ghc-mod.vim
endif
endif

View File

@ -14,7 +14,11 @@ if !exists('g:syntastic_haskell_checker_args')
let g:syntastic_haskell_checker_args = '--ghcOpt="-fno-code" --hlintOpt="--language=XmlSyntax"' let g:syntastic_haskell_checker_args = '--ghcOpt="-fno-code" --hlintOpt="--language=XmlSyntax"'
endif endif
function! SyntaxCheckers_haskell_GetLocList() function! SyntaxCheckers_haskell_ghc_mod_IsAvailable()
return executable('ghc-mod')
endfunction
function! SyntaxCheckers_haskell_ghc_mod_GetLocList()
let ghcmod = 'ghc-mod ' . g:syntastic_haskell_checker_args let ghcmod = 'ghc-mod ' . g:syntastic_haskell_checker_args
let makeprg = let makeprg =
\ "{ ". \ "{ ".
@ -28,6 +32,6 @@ function! SyntaxCheckers_haskell_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
function! SyntaxCheckers_lhaskell_GetLocList() call g:SyntasticRegistry.CreateAndRegisterChecker({
return SyntaxCheckers_haskell_GetLocList() \ 'filetype': 'haskell',
endfunction \ 'name': 'ghc_mod'})

View File

@ -10,7 +10,11 @@
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_haskell_GetLocList() function! SyntaxCheckers_haskell_hdevtools_IsAvailable()
return executable('hdevtools')
endfunction
function! SyntaxCheckers_haskell_hdevtools_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'hdevtools check', \ 'exe': 'hdevtools check',
\ 'args': get(g:, 'hdevtools_options', ''), \ 'args': get(g:, 'hdevtools_options', ''),
@ -27,6 +31,7 @@ function! SyntaxCheckers_haskell_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
function! SyntaxCheckers_lhaskell_GetLocList() call g:SyntasticRegistry.CreateAndRegisterChecker({
return SyntaxCheckers_haskell_GetLocList() \ 'filetype': 'haskell',
endfunction \ 'name': 'hdevtools'})

View File

@ -10,10 +10,9 @@
" "
"============================================================================ "============================================================================
"bail if the user doesn't have haxe installed function! SyntaxCheckers_haxe_haxe_IsAvailable()
if !executable("haxe") return executable('haxe')
finish endfunction
endif
" s:FindInParent " s:FindInParent
" find the file argument and returns the path to it. " find the file argument and returns the path to it.
@ -39,7 +38,7 @@ function! s:FindInParent(fln,flsrt,flstp)
return ['fail', '', ''] return ['fail', '', '']
endfunction endfunction
function! SyntaxCheckers_haxe_GetLocList() function! SyntaxCheckers_haxe_haxe_GetLocList()
let [success, hxmldir, hxmlname] = s:FindInParent('*.hxml', expand('%:p:h'), '/') let [success, hxmldir, hxmlname] = s:FindInParent('*.hxml', expand('%:p:h'), '/')
if success == 'ok' if success == 'ok'
let makeprg = 'cd ' . hxmldir . '; haxe ' . hxmlname let makeprg = 'cd ' . hxmldir . '; haxe ' . hxmlname
@ -49,3 +48,7 @@ function! SyntaxCheckers_haxe_GetLocList()
return SyntasticMake({}) return SyntasticMake({})
endif endif
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'haxe',
\ 'name': 'haxe'})

View File

@ -1,25 +0,0 @@
"============================================================================
"File: html.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:syntastic_html_checker')
let g:syntastic_html_checker = "tidy"
endif
if g:syntastic_html_checker == "tidy"
if executable("tidy") && executable("grep")
runtime! syntax_checkers/html/tidy.vim
endif
elseif g:syntastic_html_checker == "w3"
if executable("curl") && executable("sed")
runtime! syntax_checkers/html/w3.vim
endif
endif

View File

@ -57,7 +57,11 @@ function s:Args()
let args .= " -e" let args .= " -e"
endfunction endfunction
function! SyntaxCheckers_html_GetLocList() function! SyntaxCheckers_html_tidy_IsAvailable()
return executable('tidy')
endfunction
function! SyntaxCheckers_html_tidy_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'tidy', \ 'exe': 'tidy',
\ 'args': s:Args(), \ 'args': s:Args(),
@ -85,3 +89,8 @@ function! SyntaxCheckers_html_GetLocList()
return loclist return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'html',
\ 'name': 'tidy'})

View File

@ -9,7 +9,11 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_html_GetLocList() function! SyntaxCheckers_html_w3_IsAvailable()
return executable('curl') && executable('sed')
endfunction
function! SyntaxCheckers_html_w3_GetLocList()
let makeprg2="curl -s -F output=text -F \"uploaded_file=@".expand('%:p').";type=text/html\" http://validator.w3.org/check \\| sed -n -e '/\<em\>Line\.\*/ \{ N; s/\\n//; N; s/\\n//; /msg/p; \}' -e ''/msg_warn/p'' -e ''/msg_info/p'' \\| sed -e 's/[ ]\\+/ /g' -e 's/\<[\^\>]\*\>//g' -e 's/\^[ ]//g'" let makeprg2="curl -s -F output=text -F \"uploaded_file=@".expand('%:p').";type=text/html\" http://validator.w3.org/check \\| sed -n -e '/\<em\>Line\.\*/ \{ N; s/\\n//; N; s/\\n//; /msg/p; \}' -e ''/msg_warn/p'' -e ''/msg_info/p'' \\| sed -e 's/[ ]\\+/ /g' -e 's/\<[\^\>]\*\>//g' -e 's/\^[ ]//g'"
let errorformat2='Line %l\, Column %c: %m' let errorformat2='Line %l\, Column %c: %m'
let loclist = SyntasticMake({ 'makeprg': makeprg2, 'errorformat': errorformat2 }) let loclist = SyntasticMake({ 'makeprg': makeprg2, 'errorformat': errorformat2 })
@ -30,3 +34,8 @@ function! SyntaxCheckers_html_GetLocList()
return loclist return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'html',
\ 'name': 'w3'})

View File

@ -1,18 +0,0 @@
"============================================================================
"File: java.vim
"Description: Figures out which java syntax checker (if any) to load
" from the java directory.
"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.
"
" Use g:syntastic_java_checker option to specify which java syntax checker
" should be used (see below for a list of supported checkers).
" If g:syntastic_java_checker is not set, just use the first syntax
" checker that we find installed.
"============================================================================
call SyntasticLoadChecker('java')

View File

@ -17,7 +17,12 @@ endif
if !exists("g:syntastic_java_checkstyle_conf_file") if !exists("g:syntastic_java_checkstyle_conf_file")
let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml' let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml'
endif endif
function! SyntaxCheckers_java_GetLocList()
function! SyntaxCheckers_java_checkstyle_IsAvailable()
return executable('java')
endfunction
function! SyntaxCheckers_java_checkstyle_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'java', \ 'exe': 'java',
\ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath . ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file, \ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath . ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file,
@ -31,3 +36,8 @@ function! SyntaxCheckers_java_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'java',
\ 'name': 'checkstyle'})

View File

@ -158,7 +158,11 @@ function! s:GetMavenClasspath()
return '' return ''
endfunction endfunction
function! SyntaxCheckers_java_GetLocList() function! SyntaxCheckers_java_javac_IsAvailable()
return executable(g:syntastic_java_javac_executable)
endfunction
function! SyntaxCheckers_java_javac_GetLocList()
let javac_opts = g:syntastic_java_javac_options let javac_opts = g:syntastic_java_javac_options
@ -232,3 +236,8 @@ function! SyntaxCheckers_java_GetLocList()
return r return r
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'java',
\ 'name': 'javac'})

View File

@ -1,18 +0,0 @@
"============================================================================
"File: javascript.vim
"Description: Figures out which javascript syntax checker (if any) to load
" from the javascript directory.
"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.
"
" Use g:syntastic_javascript_checker option to specify which jslint executable
" should be used (see below for a list of supported checkers).
" If g:syntastic_javascript_checker is not set, just use the first syntax
" checker that we find installed.
"============================================================================
call SyntasticLoadChecker('javascript')

View File

@ -25,12 +25,11 @@ if !exists("g:syntastic_javascript_closure_compiler_options")
let g:syntastic_javascript_closure_compiler_options = "" let g:syntastic_javascript_closure_compiler_options = ""
endif endif
"bail if the user does not specify the path to closure compiler. function! SyntaxCheckers_javascript_closurecompiler_IsAvailable()
if !exists("g:syntastic_javascript_closure_compiler_path") return exists("g:syntastic_javascript_closure_compiler_path")
finish endfunction
endif
function! SyntaxCheckers_javascript_GetLocList() function! SyntaxCheckers_javascript_closurecompiler_GetLocList()
if exists("g:syntastic_javascript_closure_compiler_file_list") if exists("g:syntastic_javascript_closure_compiler_file_list")
let file_list = join(readfile(g:syntastic_javascript_closure_compiler_file_list), ' ') let file_list = join(readfile(g:syntastic_javascript_closure_compiler_file_list), ' ')
else else
@ -46,3 +45,8 @@ function! SyntaxCheckers_javascript_GetLocList()
let errorformat = '%-GOK,%E%f:%l: ERROR - %m,%Z%p^,%W%f:%l: WARNING - %m,%Z%p^' let errorformat = '%-GOK,%E%f:%l: ERROR - %m,%Z%p^,%W%f:%l: WARNING - %m,%Z%p^'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript',
\ 'name': 'closurecompiler'})

View File

@ -12,7 +12,11 @@ if !exists("g:syntastic_javascript_gjslint_conf")
let g:syntastic_javascript_gjslint_conf = "" let g:syntastic_javascript_gjslint_conf = ""
endif endif
function! SyntaxCheckers_javascript_GetLocList() function! SyntaxCheckers_javascript_gjslint_IsAvailable()
return executable('gjslint')
endfunction
function! SyntaxCheckers_javascript_gjslint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'gjslint', \ 'exe': 'gjslint',
\ 'args': g:syntastic_javascript_gjslint_conf . " --nosummary --unix_mode --nodebug_indentation --nobeep", \ 'args': g:syntastic_javascript_gjslint_conf . " --nosummary --unix_mode --nodebug_indentation --nobeep",
@ -21,3 +25,7 @@ function! SyntaxCheckers_javascript_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript',
\ 'name': 'gjslint'})

View File

@ -12,7 +12,11 @@ if !exists("g:syntastic_javascript_jshint_conf")
let g:syntastic_javascript_jshint_conf = "" let g:syntastic_javascript_jshint_conf = ""
endif endif
function! SyntaxCheckers_javascript_GetLocList() function! SyntaxCheckers_javascript_jshint_IsAvailable()
return executable('jshint')
endfunction
function! SyntaxCheckers_javascript_jshint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'jshint', \ 'exe': 'jshint',
\ 'post_args': s:Args(), \ 'post_args': s:Args(),
@ -26,3 +30,8 @@ function s:Args()
" node-jshint uses .jshintrc as config unless --config arg is present " node-jshint uses .jshintrc as config unless --config arg is present
return !empty(g:syntastic_javascript_jshint_conf) ? ' --config ' . g:syntastic_javascript_jshint_conf : '' return !empty(g:syntastic_javascript_jshint_conf) ? ' --config ' . g:syntastic_javascript_jshint_conf : ''
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript',
\ 'name': 'jshint'})

View File

@ -20,7 +20,11 @@ function s:ConfFlag()
return "" return ""
endfunction endfunction
function! SyntaxCheckers_javascript_GetLocList() function! SyntaxCheckers_javascript_jsl_IsAvailable()
return executable('jsl')
endfunction
function! SyntaxCheckers_javascript_jsl_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'jsl', \ 'exe': 'jsl',
\ 'args': s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process", \ 'args': s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process",
@ -29,3 +33,7 @@ function! SyntaxCheckers_javascript_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript',
\ 'name': 'jsl'})

View File

@ -14,13 +14,17 @@ if !exists("g:syntastic_javascript_jslint_conf")
let g:syntastic_javascript_jslint_conf = "--white --undef --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars" let g:syntastic_javascript_jslint_conf = "--white --undef --nomen --regexp --plusplus --bitwise --newcap --sloppy --vars"
endif endif
function! SyntaxCheckers_javascript_HighlightTerm(error) 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\'') let unexpected = matchstr(a:error['text'], 'Expected.*and instead saw \'\zs.*\ze\'')
if len(unexpected) < 1 | return '' | end if len(unexpected) < 1 | return '' | end
return '\V'.split(unexpected, "'")[1] return '\V'.split(unexpected, "'")[1]
endfunction endfunction
function! SyntaxCheckers_javascript_GetLocList() function! SyntaxCheckers_javascript_jslint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'jslint', \ 'exe': 'jslint',
\ 'args': g:syntastic_javascript_jslint_conf, \ 'args': g:syntastic_javascript_jslint_conf,
@ -29,3 +33,7 @@ function! SyntaxCheckers_javascript_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript',
\ 'name': 'jslint'})

View File

@ -1,18 +0,0 @@
"============================================================================
"File: json.vim
"Description: Figures out which json syntax checker (if any) to load
" from the json directory.
"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.
"
" Use g:syntastic_json_checker option to specify which jsonlint executable
" should be used (see below for a list of supported checkers).
" If g:syntastic_json_checker is not set, just use the first syntax
" checker that we find installed.
"============================================================================
call SyntasticLoadChecker('json')

View File

@ -1,7 +1,5 @@
"============================================================================ "============================================================================
"File: jsonlint.vim "File: jsonlint.vim "Description: JSON syntax checker - using jsonlint "Maintainer: Miller Medeiros <contact at millermedeiros dot com>
"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, "License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute " 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 " it and/or modify it under the terms of the Do What The Fuck You
@ -9,7 +7,11 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================ "============================================================================
function! SyntaxCheckers_json_GetLocList() function! SyntaxCheckers_json_jsonlint_IsAvailable()
return executable('jsonlint')
endfunction
function! SyntaxCheckers_json_jsonlint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'jsonlint', \ 'exe': 'jsonlint',
\ 'post_args': '--compact', \ 'post_args': '--compact',
@ -17,3 +19,7 @@ function! SyntaxCheckers_json_GetLocList()
let errorformat = '%ELine %l:%c,%Z\\s%#Reason: %m,%C%.%#,%f: line %l\, col %c\, %m,%-G%.%#' 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('')} }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'json',
\ 'name': 'jsonlint'})

View File

@ -9,9 +9,17 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================ "============================================================================
function! SyntaxCheckers_json_GetLocList() function! SyntaxCheckers_json_jsonlint_IsAvailable()
return executable('jsonval')
endfunction
function! SyntaxCheckers_json_jsonval_GetLocList()
" based on https://gist.github.com/1196345 " based on https://gist.github.com/1196345
let makeprg = syntastic#makeprg#build({ 'exe': 'jsonval', 'subchecker': 'jsonval' }) let makeprg = syntastic#makeprg#build({ 'exe': 'jsonval', 'subchecker': 'jsonval' })
let errorformat = '%E%f:\ %m\ at\ line\ %l,%-G%.%#' let errorformat = '%E%f:\ %m\ at\ line\ %l,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr('')} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'json',
\ 'name': 'jsonval'})

View File

@ -17,11 +17,6 @@
" To use less-lint instead of less set the variable " To use less-lint instead of less set the variable
" g:syntastic_less_use_less_lint. " g:syntastic_less_use_less_lint.
"bail if the user doesnt have the lessc binary installed
if !executable("lessc")
finish
endif
if !exists("g:syntastic_less_options") if !exists("g:syntastic_less_options")
let g:syntastic_less_options = "--no-color" let g:syntastic_less_options = "--no-color"
endif endif
@ -36,7 +31,11 @@ else
let s:check_file = 'lessc' let s:check_file = 'lessc'
end end
function! SyntaxCheckers_less_GetLocList() function! SyntaxCheckers_less_lessc_GetLocList()
return executable('lessc')
endfunction
function! SyntaxCheckers_less_lessc_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': s:check_file, \ 'exe': s:check_file,
\ 'args': g:syntastic_less_options, \ 'args': g:syntastic_less_options,
@ -48,3 +47,6 @@ function! SyntaxCheckers_less_GetLocList()
\ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} }) \ 'defaults': {'bufnr': bufnr(""), 'text': "Syntax error"} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'less',
\ 'name': 'lessc'})

View File

@ -9,13 +9,11 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_lisp_clisp_IsAvailable()
return executable("clisp")
endfunction
" Bail if the user doesnt have clisp installed function! SyntaxCheckers_lisp_clisp_GetLocList()
if !executable("clisp")
finish
endif
function! SyntaxCheckers_lisp_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'clisp', \ 'exe': 'clisp',
\ 'args': '-c' \ 'args': '-c'
@ -26,3 +24,7 @@ function! SyntaxCheckers_lisp_GetLocList()
let efm .= '%-G%.%#' let efm .= '%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': efm }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': efm })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'lisp',
\ 'name': 'clisp'})

View File

@ -10,10 +10,9 @@
" "
"============================================================================ "============================================================================
" check if the lua compiler is installed function! SyntaxCheckers_lua_luac_IsAvailable()
if !executable('luac') return executable('luac')
finish endfunction
endif
function! SyntaxCheckers_lua_GetHighlightRegex(pos) function! SyntaxCheckers_lua_GetHighlightRegex(pos)
let near = matchstr(a:pos['text'], "near '[^']\\+'") let near = matchstr(a:pos['text'], "near '[^']\\+'")
@ -38,7 +37,8 @@ function! SyntaxCheckers_lua_GetHighlightRegex(pos)
return result return result
endfunction endfunction
function! SyntaxCheckers_lua_GetLocList()
function! SyntaxCheckers_lua_luac_GetLocList()
let makeprg = syntastic#makeprg#build({ 'exe': 'luac', 'args': '-p' }) let makeprg = syntastic#makeprg#build({ 'exe': 'luac', 'args': '-p' })
let errorformat = 'luac: %#%f:%l: %m' let errorformat = 'luac: %#%f:%l: %m'
@ -48,3 +48,6 @@ function! SyntaxCheckers_lua_GetLocList()
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'lua',
\ 'name': 'luac'})

View File

@ -10,14 +10,16 @@
" "
"============================================================================ "============================================================================
"bail if the user doesn't have mlint installed function! SyntaxCheckers_matlab_mlint_IsAvailable()
if !executable("mlint") return executable("mlint")
finish endfunction
endif
function! SyntaxCheckers_matlab_GetLocList() function! SyntaxCheckers_matlab_mlint_GetLocList()
let makeprg = syntastic#makeprg#build({ 'exe': 'mlint', 'args': '-id $*' }) let makeprg = syntastic#makeprg#build({ 'exe': 'mlint', 'args': '-id $*' })
let errorformat = 'L %l (C %c): %*[a-zA-Z0-9]: %m,L %l (C %c-%*[0-9]): %*[a-zA-Z0-9]: %m' 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("")} }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'matlab',
\ 'name': 'mlint'})

View File

@ -9,13 +9,11 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_nasm_nasm_GetLocList()
return executable("nasm")
endfunction
"bail if the user doesnt have nasm installed function! SyntaxCheckers_nasm_nasm_GetLocList()
if !executable("nasm")
finish
endif
function! SyntaxCheckers_nasm_GetLocList()
if has("win32") if has("win32")
let outfile="NUL" let outfile="NUL"
else else
@ -28,3 +26,7 @@ function! SyntaxCheckers_nasm_GetLocList()
let errorformat = '%f:%l: %t%*[^:]: %m' let errorformat = '%f:%l: %t%*[^:]: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'nasm',
\ 'name': 'nasm'})

View File

@ -64,10 +64,6 @@
" "
" let g:syntastic_objc_errorformat = '%f:%l:%c: %trror: %m' " let g:syntastic_objc_errorformat = '%f:%l:%c: %trror: %m'
if !executable('gcc')
finish
endif
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
@ -79,7 +75,11 @@ if !exists('g:syntastic_objc_config_file')
let g:syntastic_objc_config_file = '.syntastic_objc_config' let g:syntastic_objc_config_file = '.syntastic_objc_config'
endif endif
function! SyntaxCheckers_objc_GetLocList() function! SyntaxCheckers_objc_gcc_IsAvailable()
return executable('gcc')
endfunction
function! SyntaxCheckers_objc_gcc_GetLocList()
let makeprg = 'gcc -fsyntax-only -lobjc' let makeprg = 'gcc -fsyntax-only -lobjc'
let errorformat = let errorformat =
\ '%-G%f:%s:,'. \ '%-G%f:%s:,'.
@ -149,6 +149,10 @@ function! SyntaxCheckers_objc_GetLocList()
endif endif
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'objc',
\ 'name': 'gcc'})
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo

View File

@ -55,10 +55,9 @@ else
let s:ocamlpp="camlp4o" let s:ocamlpp="camlp4o"
endif endif
"bail if the user doesnt have the preprocessor function! SyntaxCheckers_ocaml_camlp4o_IsAvailable()
if !executable(s:ocamlpp) return executable(s:ocamlpp)
finish endfunction
endif
if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc') if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc')
let g:syntastic_ocaml_use_ocamlc = 0 let g:syntastic_ocaml_use_ocamlc = 0
@ -72,7 +71,7 @@ if !exists('g:syntastic_ocaml_use_ocamlbuild') || !executable("ocamlbuild")
let g:syntastic_ocaml_use_ocamlbuild = 0 let g:syntastic_ocaml_use_ocamlbuild = 0
endif endif
function! SyntaxCheckers_ocaml_GetLocList() function! SyntaxCheckers_ocaml_camlp4o_GetLocList()
let makeprg = s:GetMakeprg() let makeprg = s:GetMakeprg()
if makeprg == "" if makeprg == ""
return [] return []
@ -138,3 +137,7 @@ function s:GetOtherMakeprg()
return makeprg return makeprg
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ocaml',
\ 'name': 'camlp4o'})

View File

@ -25,16 +25,15 @@
" let g:syntastic_perl_efm_program = "foo.pl -o -m -g" " let g:syntastic_perl_efm_program = "foo.pl -o -m -g"
" "
"bail if the user doesnt have perl installed function! SyntaxCheckers_perl_perl_IsAvailable()
if !executable("perl") return executable("perl")
finish endfunction
endif
if !exists("g:syntastic_perl_efm_program") if !exists("g:syntastic_perl_efm_program")
let g:syntastic_perl_efm_program = 'perl ' . shellescape(expand('<sfile>:p:h') . '/efm_perl.pl') . ' -c -w' let g:syntastic_perl_efm_program = 'perl ' . shellescape(expand('<sfile>:p:h') . '/efm_perl.pl') . ' -c -w'
endif endif
function! SyntaxCheckers_perl_GetLocList() function! SyntaxCheckers_perl_perl_GetLocList()
if exists("g:syntastic_perl_lib_path") if exists("g:syntastic_perl_lib_path")
let makeprg = g:syntastic_perl_efm_program . ' -I' . g:syntastic_perl_lib_path . ' ' . shellescape(expand('%')) let makeprg = g:syntastic_perl_efm_program . ' -I' . g:syntastic_perl_lib_path . ' ' . shellescape(expand('%'))
else else
@ -55,3 +54,7 @@ function! s:ExtraMakeprgArgs()
return '' return ''
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'perl',
\ 'name': 'perl'})

View File

@ -21,11 +21,9 @@
" "
"There are options below to config and disable phpcs and phpmd. "There are options below to config and disable phpcs and phpmd.
function! SyntaxCheckers_php_php_IsAvailable()
"bail if the user doesnt have php installed return executable("php")
if !executable("php") endfunction
finish
endif
"Support passing configuration directives to phpcs "Support passing configuration directives to phpcs
if !exists("g:syntastic_phpcs_conf") if !exists("g:syntastic_phpcs_conf")
@ -55,7 +53,7 @@ function! SyntaxCheckers_php_GetHighlightRegex(item)
return '\V'.split(unexpected, "'")[1] return '\V'.split(unexpected, "'")[1]
endfunction endfunction
function! SyntaxCheckers_php_GetLocList() function! SyntaxCheckers_php_php_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'php', \ 'exe': 'php',
\ 'args': '-l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0', \ 'args': '-l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0',
@ -94,3 +92,7 @@ function! s:GetPHPMDErrors()
let errorformat = '%E%f:%l%m' let errorformat = '%E%f:%l%m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype' : 'Style' }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'subtype' : 'Style' })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'php',
\ 'name': 'php'})

View File

@ -10,10 +10,9 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have puppet installed function! SyntaxCheckers_puppet_puppetlint_IsAvailable()
if !executable("puppet") return executable("puppet")
finish endfunction
endif
if !exists("g:syntastic_puppet_validate_disable") if !exists("g:syntastic_puppet_validate_disable")
let g:syntastic_puppet_validate_disable = 0 let g:syntastic_puppet_validate_disable = 0
@ -90,7 +89,7 @@ function! s:getPuppetEfm()
return errorformat return errorformat
endfunction endfunction
function! SyntaxCheckers_puppet_GetLocList() function! SyntaxCheckers_puppet_puppetlint_GetLocList()
let errors = [] let errors = []
if !g:syntastic_puppet_validate_disable if !g:syntastic_puppet_validate_disable
@ -104,3 +103,6 @@ function! SyntaxCheckers_puppet_GetLocList()
return errors return errors
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'puppet',
\ 'name': 'puppetlint'})

View File

@ -1,21 +0,0 @@
"============================================================================
"File: python.vim
"Description: Syntax checking plugin for syntastic.vim
"
"Authors: Martin Grenfell <martin.grenfell@gmail.com>
" kstep <me@kstep.me>
" Parantapa Bhattacharya <parantapa@gmail.com>
"
"
" For forcing the use of flake8, pyflakes, or pylint set
"
" let g:syntastic_python_checker = 'pyflakes'
"
" in your .vimrc. Default is flake8.
"============================================================================
if !exists('g:syntastic_python_checker_args')
let g:syntastic_python_checker_args = ''
endif
call SyntasticLoadChecker('python')

View File

@ -34,8 +34,5 @@ function! SyntaxCheckers_python_flake8_GetLocList()
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'loclistFunc': function("SyntaxCheckers_python_flake8_GetLocList"),
\ 'highlightRegexFunc': function("SyntaxCheckers_python_flake8_GetHighlightRegex"),
\ 'filetype': 'python', \ 'filetype': 'python',
\ 'name': 'flake8', \ 'name': 'flake8'})
\ 'isAvailableFunc': function("SyntaxCheckers_python_flake8_IsAvailable")} )

View File

@ -29,7 +29,6 @@ endfunction
function! SyntaxCheckers_python_pyflakes_GetLocList() function! SyntaxCheckers_python_pyflakes_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'pyflakes', \ 'exe': 'pyflakes',
\ 'args': g:syntastic_python_checker_args,
\ 'subchecker': 'pyflakes' }) \ 'subchecker': 'pyflakes' })
let errorformat = '%E%f:%l: could not compile,%-Z%p^,%E%f:%l:%c: %m,%E%f:%l: %m,%-G%.%#' let errorformat = '%E%f:%l: could not compile,%-Z%p^,%E%f:%l:%c: %m,%E%f:%l: %m,%-G%.%#'
@ -39,8 +38,5 @@ function! SyntaxCheckers_python_pyflakes_GetLocList()
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'loclistFunc': function('SyntaxCheckers_python_pyflakes_GetLocList'),
\ 'highlightRegexFunc': function('SyntaxCheckers_python_pyflakes_GetHighlightRegex'),
\ 'filetype': 'python', \ 'filetype': 'python',
\ 'name': 'pyflakes', \ 'name': 'pyflakes'})
\ 'isAvailableFunc': function('SyntaxCheckers_python_pyflakes_IsAvailable')} )

View File

@ -11,7 +11,7 @@ endfunction
function! SyntaxCheckers_python_pylint_GetLocList() function! SyntaxCheckers_python_pylint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'pylint', \ 'exe': 'pylint',
\ 'args': g:syntastic_python_checker_args. ' -f parseable -r n -i y', \ 'args': ' -f parseable -r n -i y',
\ 'tail': s:MakeprgTail(), \ 'tail': s:MakeprgTail(),
\ 'subchecker': 'pylint' }) \ 'subchecker': 'pylint' })
let errorformat = '%f:%l: [%t] %m,%Z,%-GNo config %m' let errorformat = '%f:%l: [%t] %m,%Z,%-GNo config %m'
@ -25,7 +25,5 @@ function! s:MakeprgTail()
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'loclistFunc': function('SyntaxCheckers_python_pylint_GetLocList'),
\ 'filetype': 'python', \ 'filetype': 'python',
\ 'name': 'pylint', \ 'name': 'pylint' })
\ 'isAvailableFunc': function('SyntaxCheckers_python_pylint_IsAvailable')} )

View File

@ -7,11 +7,11 @@
" http://www.vim.org/scripts/download_script.php?src_id=1392 " http://www.vim.org/scripts/download_script.php?src_id=1392
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_python_pyflakes_IsAvailable() function! SyntaxCheckers_python_python_IsAvailable()
return executable('python') return executable('python')
endfunction endfunction
function! SyntaxCheckers_python_pyflakes_GetLocList() function! SyntaxCheckers_python_python_GetLocList()
let l:path = shellescape(expand('%')) let l:path = shellescape(expand('%'))
let l:cmd = "compile(open(" . l:path . ").read(), " . l:path . ", 'exec')" let l:cmd = "compile(open(" . l:path . ").read(), " . l:path . ", 'exec')"
let l:makeprg = 'python -c "' . l:cmd . '"' let l:makeprg = 'python -c "' . l:cmd . '"'
@ -30,7 +30,5 @@ function! SyntaxCheckers_python_pyflakes_GetLocList()
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'loclistFunc': function('SyntaxCheckers_python_pyflakes_GetLocList'),
\ 'filetype': 'python', \ 'filetype': 'python',
\ 'name': 'python', \ 'name': 'python'})
\ 'isAvailableFunc': function('SyntaxCheckers_python_pyflakes_IsAvailable')} )

View File

@ -13,12 +13,11 @@
" We use rst2pseudoxml.py, as it is ever so marginally faster than the other " We use rst2pseudoxml.py, as it is ever so marginally faster than the other
" rst2${x} tools in docutils. " rst2${x} tools in docutils.
"bail if the user doesn't have rst2pseudoxml.py installed function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable()
if !executable("rst2pseudoxml.py") return executable("rst2pseudoxml.py")
finish endfunction
endif
function! SyntaxCheckers_rst_GetLocList() function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'rst2pseudoxml.py', \ 'exe': 'rst2pseudoxml.py',
\ 'args': '--report=2 --exit-status=1', \ 'args': '--report=2 --exit-status=1',
@ -32,3 +31,7 @@ function! SyntaxCheckers_rst_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'rst',
\ 'name': 'rst2pseudoxml'})

View File

@ -1,21 +0,0 @@
"============================================================================
"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.
"
"Supports MRI and JRuby but loads the MRI syntax checker by default.
"
"Use the g:syntastic_ruby_checker option to specify which checker to load -
"set it to "jruby" to load the jruby checker.
"============================================================================
if !exists("g:syntastic_ruby_checker")
let g:syntastic_ruby_checker = "mri"
endif
exec "runtime! syntax_checkers/ruby/" . g:syntastic_ruby_checker . ".vim"

View File

@ -9,7 +9,11 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_ruby_GetLocList() function! SyntaxCheckers_ruby_jruby_IsAvailable()
return executable('jruby')
endfunction
function! SyntaxCheckers_ruby_jruby_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': s:exe(), \ 'exe': s:exe(),
\ 'args': s:args(), \ 'args': s:args(),
@ -27,3 +31,7 @@ endfunction
function s:exe() function s:exe()
return has('win32') ? 'jruby' : 'RUBYOPT= jruby' return has('win32') ? 'jruby' : 'RUBYOPT= jruby'
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'jruby'})

View File

@ -8,7 +8,11 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details. " See http://sam.zoy.org/wtfpl/COPYING for more details.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_ruby_GetLocList() function! SyntaxCheckers_ruby_macruby_GetLocList()
return executable('macruby')
endfunction
function! SyntaxCheckers_ruby_macruby_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'RUBYOPT= macruby', \ 'exe': 'RUBYOPT= macruby',
\ 'args': '-W1 -c', \ 'args': '-W1 -c',
@ -16,3 +20,7 @@ function! SyntaxCheckers_ruby_GetLocList()
let errorformat = '%-GSyntax OK,%E%f:%l: syntax error\, %m,%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#' 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 }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'macruby'})

View File

@ -21,12 +21,11 @@ if !exists("g:syntastic_ruby_exec")
let g:syntastic_ruby_exec = s:FindRubyExec() let g:syntastic_ruby_exec = s:FindRubyExec()
endif endif
"bail if the user doesnt have ruby installed where they said it is function! SyntaxCheckers_ruby_mri_GetLocList()
if !executable(expand(g:syntastic_ruby_exec)) return executable(expand(g:syntastic_ruby_exec))
finish endfunction
endif
function! SyntaxCheckers_ruby_GetLocList() function! SyntaxCheckers_ruby_mri_GetLocList()
let exe = expand(g:syntastic_ruby_exec) let exe = expand(g:syntastic_ruby_exec)
if !has('win32') if !has('win32')
let exe = 'RUBYOPT= ' . exe let exe = 'RUBYOPT= ' . exe
@ -55,3 +54,7 @@ function! SyntaxCheckers_ruby_GetLocList()
let errorformat .= ',%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#' let errorformat .= ',%Z%p^,%W%f:%l: warning: %m,%Z%p^,%W%f:%l: %m,%-C%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby',
\ 'name': 'mri'})

View File

@ -10,12 +10,11 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have rustc installed function! SyntaxCheckers_rust_rustc_IsAvailable()
if !executable("rustc") return executable("rustc")
finish endfunction
endif
function! SyntaxCheckers_rust_GetLocList() function! SyntaxCheckers_rust_rustc_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'rustc', \ 'exe': 'rustc',
\ 'args': '--parse-only' }) \ 'args': '--parse-only' })
@ -28,4 +27,6 @@ function! SyntaxCheckers_rust_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'rust',
\ 'name': 'rustc'})

View File

@ -10,10 +10,9 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have the sass binary installed function! SyntaxCheckers_sass_sass_IsAvailable()
if !executable("sass") return executable("sass")
finish endfunction
endif
"sass caching for large files drastically speeds up the checking, but store it "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 "in a temp location otherwise sass puts .sass_cache dirs in the users project
@ -30,7 +29,7 @@ if executable("compass")
let s:imports = "--compass" let s:imports = "--compass"
endif endif
function! SyntaxCheckers_sass_GetLocList() function! SyntaxCheckers_sass_sass_GetLocList()
if !g:syntastic_sass_check_partials && expand('%:t')[0] == '_' if !g:syntastic_sass_check_partials && expand('%:t')[0] == '_'
return [] return []
end end
@ -43,3 +42,7 @@ function! SyntaxCheckers_sass_GetLocList()
return loclist return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'sass',
\ 'name': 'sass'})

View File

@ -10,16 +10,16 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have the scala binary installed function! SyntaxCheckers_scala_scalac_IsAvailable()
if !executable("scalac") return executable("scalac")
finish endfunction
endif
if !exists("g:syntastic_scala_options") if !exists("g:syntastic_scala_options")
let g:syntastic_scala_options = " " let g:syntastic_scala_options = " "
endif endif
function! SyntaxCheckers_scala_GetLocList()
function! SyntaxCheckers_scala_scalac_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'scalac', \ 'exe': 'scalac',
\ 'args': '-Ystop-after:parser '. g:syntastic_scala_options }) \ 'args': '-Ystop-after:parser '. g:syntastic_scala_options })
@ -29,3 +29,6 @@ function! SyntaxCheckers_scala_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scala',
\ 'name': 'scalac'})

View File

@ -11,13 +11,16 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have the sass binary installed runtime syntax_checkers/sass/sass.vim
if !executable("sass")
finish
endif
runtime syntax_checkers/sass.vim function! SyntaxCheckers_scss_sass_IsAvailable()
return executable("sass")
function! SyntaxCheckers_scss_GetLocList()
return SyntaxCheckers_sass_GetLocList()
endfunction endfunction
function! SyntaxCheckers_scss_sass_GetLocList()
return SyntaxCheckers_sass_sass_GetLocList()
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scss',
\ 'name': 'sass'})

View File

@ -29,18 +29,24 @@ endfunction
function! s:ForwardToZshChecker() function! s:ForwardToZshChecker()
if SyntasticCheckable('zsh') if SyntasticCheckable('zsh')
return SyntaxCheckers_zsh_GetLocList() return SyntaxCheckers_zsh_zsh_GetLocList()
else else
return [] return []
endif endif
endfunction endfunction
function! s:IsShellValid() function! s:IsShellValid()
return len(s:GetShell()) > 0 && executable(s:GetShell()) return len(s:GetShell()) > 0 && executable(s:GetShell())
endfunction endfunction
function! SyntaxCheckers_sh_GetLocList()
function! SyntaxCheckers_sh_sh_IsAvailable()
return s:IsShellValid()
endfunction
function! SyntaxCheckers_sh_sh_GetLocList()
if s:GetShell() == 'zsh' if s:GetShell() == 'zsh'
return s:ForwardToZshChecker() return s:ForwardToZshChecker()
endif endif
@ -56,3 +62,7 @@ function! SyntaxCheckers_sh_GetLocList()
let errorformat = '%f: line %l: %m' let errorformat = '%f: line %l: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat}) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat})
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'sh',
\ 'name': 'sh'})

View File

@ -10,10 +10,9 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have the slim binary installed function! SyntaxCheckers_slim_slimrb_IsAvailable()
if !executable("slimrb") return executable("slimrb")
finish endfunction
endif
function! s:SlimrbVersion() function! s:SlimrbVersion()
if !exists('s:slimrb_version') if !exists('s:slimrb_version')
@ -25,7 +24,7 @@ function! s:SlimrbVersion()
return s:slimrb_version return s:slimrb_version
endfunction endfunction
function! SyntaxCheckers_slim_GetLocList() function! SyntaxCheckers_slim_slimrb_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'slimrb', \ 'exe': 'slimrb',
\ 'args': '-c' }) \ 'args': '-c' })
@ -36,3 +35,7 @@ function! SyntaxCheckers_slim_GetLocList()
endif endif
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'slim',
\ 'name': 'slimrb'})

View File

@ -1,17 +0,0 @@
"============================================================================
"File: tcl.vim
"Description: Figures out which tcl syntax checker (if any) to load
" from the tcl directory.
"Maintainer: James Pickard <james.pickard 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.
"
" Use g:syntastic_tcl_checker option to specify which tcl checker executable
" should be used (see below for a list of supported checkers).
" If g:syntastic_tcl_checker is not set, just use the first syntax
" checker that we find installed.
"============================================================================
call SyntasticLoadChecker('tcl')

View File

@ -11,7 +11,11 @@
" See nagelfar homepage http://nagelfar.berlios.de/. " See nagelfar homepage http://nagelfar.berlios.de/.
" "
"============================================================================ "============================================================================
function! SyntaxCheckers_tcl_GetLocList() function! SyntaxCheckers_tcl_nagelfar_IsAvailable()
return executable('nagelfar')
endfunction
function! SyntaxCheckers_tcl_nagelfar_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'nagelfar', \ 'exe': 'nagelfar',
\ 'args': '-H ' . g:syntastic_tcl_nagelfar_conf, \ 'args': '-H ' . g:syntastic_tcl_nagelfar_conf,
@ -20,3 +24,7 @@ function! SyntaxCheckers_tcl_GetLocList()
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'tcl',
\ 'name': 'nagelfar'})

View File

@ -10,14 +10,17 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have tclsh installed function! SyntaxCheckers_tcl_tclsh_IsAvailable()
if !executable("tclsh") return executable('tclsh')
finish endfunction
endif
function! SyntaxCheckers_tclsh_GetLocList() function! SyntaxCheckers_tcl_tclsh_GetLocList()
let makeprg = syntastic#makeprg#build({'exe': 'tclsh'}) let makeprg = syntastic#makeprg#build({'exe': 'tclsh'})
let errorformat = '%f:%l:%m' let errorformat = '%f:%l:%m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'tcl',
\ 'name': 'tclsh'})

View File

@ -10,13 +10,16 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have lacheck installed function! SyntaxCheckers_tex_lacheck_IsAvailable()
if !executable("lacheck") return executable("lacheck")
finish endfunction
endif
function! SyntaxCheckers_tex_GetLocList() function! SyntaxCheckers_tex_lacheck_GetLocList()
let makeprg = syntastic#makeprg#build({ 'exe': 'lacheck' }) let makeprg = syntastic#makeprg#build({ 'exe': 'lacheck' })
let errorformat = '%-G** %f:,%E"%f"\, line %l: %m' let errorformat = '%-G** %f:,%E"%f"\, line %l: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'tex',
\ 'name': 'lacheck'})

View File

@ -15,8 +15,16 @@ function! SyntaxCheckers_twig_GetHighlightRegex(item)
return '\V' return '\V'
endfunction endfunction
function! SyntaxCheckers_twig_GetLocList() function! SyntaxCheckers_twig_twiglint_IsAvailable()
return executable('twig-lint')
endfunction
function! SyntaxCheckers_twig_twiglint_GetLocList()
let makeprg = "twig-lint lint --format=csv ".shellescape(expand('%')) let makeprg = "twig-lint lint --format=csv ".shellescape(expand('%'))
let errorformat = '"%f"\,%l\,%m' let errorformat = '"%f"\,%l\,%m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat}) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat})
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'twig',
\ 'name': 'twiglint'})

View File

@ -4,15 +4,19 @@
"Maintainer: Bill Casarin <bill@casarin.ca> "Maintainer: Bill Casarin <bill@casarin.ca>
"============================================================================ "============================================================================
"bail if the user doesnt have tsc installed function! SyntaxCheckers_typescript_tsc_IsAvailable()
if !executable("tsc") return executable("tsc")
finish endfunction
endif
function! SyntaxCheckers_typescript_GetLocList()
function! SyntaxCheckers_typescript_tsc_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'tsc', \ 'exe': 'tsc',
\ 'post_args': '--out ' . syntastic#util#DevNull() }) \ 'post_args': '--out ' . syntastic#util#DevNull() })
let errorformat = '%f %#(%l\,%c): %m' let errorformat = '%f %#(%l\,%c): %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'typescript',
\ 'name': 'tsc'})

View File

@ -22,15 +22,11 @@
" "
"============================================================================ "============================================================================
if !executable('valac') function! SyntaxCheckers_vala_valac_IsAvailable()
finish return executable('valac') || (exists('g:syntastic_vala_check_disabled') && g:syntastic_vala_check_disabled)
endif endfunction
if exists('g:syntastic_vala_check_disabled') && g:syntastic_vala_check_disabled function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos)
finish
endif
function! SyntaxCheckers_vala_GetHighlightRegex(pos)
let strlength = strlen(matchstr(a:pos['text'], '\^\+$')) let strlength = strlen(matchstr(a:pos['text'], '\^\+$'))
return '\%>'.(a:pos.col-1).'c.*\%<'.(a:pos.col+strlength+1).'c' return '\%>'.(a:pos.col-1).'c.*\%<'.(a:pos.col+strlength+1).'c'
endfunction endfunction
@ -51,7 +47,7 @@ function! s:GetValaModules()
return split(strpart(modules_str, 12), '\s\+') return split(strpart(modules_str, 12), '\s\+')
endfunction endfunction
function! SyntaxCheckers_vala_GetLocList() function! SyntaxCheckers_vala_valac_GetLocList()
let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ') let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ')
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'valac', \ 'exe': 'valac',
@ -63,3 +59,6 @@ function! SyntaxCheckers_vala_GetLocList()
\ 'defaults': {'force_highlight_callback': 1} }) \ 'defaults': {'force_highlight_callback': 1} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'vala',
\ 'name': 'valac'})

View File

@ -10,10 +10,9 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have tidy or grep installed function! SyntaxCheckers_xhtml_tidy_IsAvailable()
if !executable("tidy") return executable("tidy")
finish endfunction
endif
" TODO: join this with html.vim DRY's sake? " TODO: join this with html.vim DRY's sake?
function! s:TidyEncOptByFenc() function! s:TidyEncOptByFenc()
@ -33,7 +32,7 @@ function! s:TidyEncOptByFenc()
return get(tidy_opts, &fileencoding, '-utf8') return get(tidy_opts, &fileencoding, '-utf8')
endfunction endfunction
function! SyntaxCheckers_xhtml_GetLocList() function! SyntaxCheckers_xhtml_tidy_GetLocList()
let encopt = s:TidyEncOptByFenc() let encopt = s:TidyEncOptByFenc()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'tidy', \ 'exe': 'tidy',
@ -41,3 +40,7 @@ function! SyntaxCheckers_xhtml_GetLocList()
let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#' let errorformat='%Wline %l column %c - Warning: %m,%Eline %l column %c - Error: %m,%-G%.%#,%-G%.%#'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat, 'defaults': {'bufnr': bufnr("")} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xhtml',
\ 'name': 'tidy'})

View File

@ -14,12 +14,11 @@
" and allow you to validate XML data without network access, see xmlcatalog(1) " and allow you to validate XML data without network access, see xmlcatalog(1)
" and http://www.xmlsoft.org/catalog.html for more information. " and http://www.xmlsoft.org/catalog.html for more information.
"bail if the user doesnt have tidy or grep installed function! SyntaxCheckers_xml_xmllint_IsAvailable()
if !executable("xmllint") return executable("xmllint")
finish endfunction
endif
function! SyntaxCheckers_xml_GetLocList() function! SyntaxCheckers_xml_xmllint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'xmllint', \ 'exe': 'xmllint',
\ 'args': '--xinclude --noout --postvalid' }) \ 'args': '--xinclude --noout --postvalid' })
@ -36,3 +35,7 @@ function! SyntaxCheckers_xml_GetLocList()
return loclist return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xml',
\ 'name': 'xmllint'})

View File

@ -10,13 +10,11 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have tidy or grep installed function! SyntaxCheckers_xslt_xmllint_GetLocList()
if !executable("xmllint") return executable("xmllint")
finish endfunction
endif
function! SyntaxCheckers_xslt_GetLocList()
function! SyntaxCheckers_xslt_xmllint_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'xmllint', \ 'exe': 'xmllint',
\ 'args': '--xinclude --noout --postvalid' }) \ 'args': '--xinclude --noout --postvalid' })
@ -34,3 +32,7 @@ function! SyntaxCheckers_xslt_GetLocList()
return loclist return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xslt',
\ 'name': 'xmllint'})

View File

@ -13,11 +13,11 @@
" "
"============================================================================ "============================================================================
if !executable("js-yaml") function! SyntaxCheckers_yaml_jsyaml_GetLocList()
finish return executable("js-yaml")
endif endfunction
function! SyntaxCheckers_yaml_GetLocList() function! SyntaxCheckers_yaml_jsyaml_GetLocList()
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'js-yaml', \ 'exe': 'js-yaml',
\ 'args': '--compact' }) \ 'args': '--compact' })
@ -26,3 +26,7 @@ function! SyntaxCheckers_yaml_GetLocList()
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr("")} }) \ 'defaults': {'bufnr': bufnr("")} })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'yaml',
\ 'name': 'jsyaml'})

View File

@ -14,14 +14,17 @@
"To obtain this application there are two solutions: "To obtain this application there are two solutions:
" - Install this python package: https://github.com/rgiot/pycpcdemotools " - Install this python package: https://github.com/rgiot/pycpcdemotools
" - Copy/paste this script in your search path: https://raw.github.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py " - Copy/paste this script in your search path: https://raw.github.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py
if !executable("z80_syntax_checker.py") function! SyntaxCheckers_z80_z80syntaxchecker_IsAvailable()
finish return executable("z80_syntax_checker.py")
endif endfunction
function! SyntaxCheckers_z80_GetLocList() function! SyntaxCheckers_z80_z80syntaxchecker_GetLocList()
let makeprg = syntastic#makeprg#build({ 'exe': 'z80_syntax_checker.py' }) let makeprg = syntastic#makeprg#build({ 'exe': 'z80_syntax_checker.py' })
let errorformat = '%f:%l %m' let errorformat = '%f:%l %m'
let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) let loclist = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
return loclist return loclist
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'z80',
\ 'name': 'z80syntaxchecker'})

View File

@ -19,13 +19,16 @@
" Then install the zptlint program, found on pypi: " Then install the zptlint program, found on pypi:
" http://pypi.python.org/pypi/zptlint " http://pypi.python.org/pypi/zptlint
" Bail if the user doesn't have zptlint installed function! SyntaxCheckers_zpt_zptlint_GetLocList()
if !executable("zptlint") return executable("zptlint")
finish endfunction
endif
function! SyntaxCheckers_zpt_GetLocList() function! SyntaxCheckers_zpt_zptlint_GetLocList()
let makeprg = syntastic#makeprg#build({ 'exe': 'zptlint' }) let makeprg = syntastic#makeprg#build({ 'exe': 'zptlint' })
let errorformat='%-P*** Error in: %f,%Z%*\s\, at line %l\, column %c,%E%*\s%m,%-Q' let errorformat='%-P*** Error in: %f,%Z%*\s\, at line %l\, column %c,%E%*\s%m,%-Q'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat }) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'zpt',
\ 'name': 'zptlint'})

View File

@ -10,13 +10,16 @@
" "
"============================================================================ "============================================================================
"bail if the user doesnt have zsh installed function! SyntaxCheckers_zsh_zsh_IsAvailable()
if !executable("zsh") return executable("zsh")
finish endfunction
endif
function! SyntaxCheckers_zsh_GetLocList() function! SyntaxCheckers_zsh_zsh_GetLocList()
let makeprg = syntastic#makeprg#build({ 'exe': 'zsh', 'args': '-n' }) let makeprg = syntastic#makeprg#build({ 'exe': 'zsh', 'args': '-n' })
let errorformat = '%f:%l: %m' let errorformat = '%f:%l: %m'
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat}) return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat})
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'zsh',
\ 'name': 'zsh'})