Registry cleanup, stage 2.

(1) Checkers now have an _exec attribute, and an accessor getExec().
(2) CreateAndRegisterChecker() initializes _exec from an optional argument
'exec'.  If this argument is missing, 'name' is used instead.
(3) Functions SyntaxCheckers_*_IsAvailable() are now dictionary functions.
(4) Functions SyntaxCheckers_*_IsAvailable() are now optional.  When
they are missing, they are assumed to return executable(expand(self.getExec())).
(5) Argument 'exe' of function syntastic#makeprg#build() is now optional.
If this argument is missing, expand(self.getExec()) is used to set checker
executables.
This commit is contained in:
LCD 47 2013-10-28 17:30:25 +02:00
parent 28bce98a68
commit 3694908d05
112 changed files with 159 additions and 525 deletions

View File

@ -67,7 +67,7 @@ function! syntastic#c#GetLocList(filetype, subchecker, options)
return [] return []
endtry endtry
let makeprg = g:syntastic_{a:filetype}_compiler . ' ' . flags . ' ' . syntastic#util#shexpand('%') let makeprg = expand(g:syntastic_{a:filetype}_compiler) . ' ' . flags . ' ' . syntastic#util#shexpand('%')
let errorformat = s:GetCheckerVar('g', a:filetype, a:subchecker, 'errorformat', a:options['errorformat']) let errorformat = s:GetCheckerVar('g', a:filetype, a:subchecker, 'errorformat', a:options['errorformat'])

View File

@ -449,14 +449,13 @@ Checkers that use 'syntastic#makeprg#build()' look like this: >
\ 'args': '-a -b -c', \ 'args': '-a -b -c',
\ 'post_args': '--more --args', \ 'post_args': '--more --args',
\ 'tail': '> /tmp/output', \ 'tail': '> /tmp/output',
\ 'filetype': 'ruby', \ 'checker': self })
\ 'subchecker': 'mri' })
< <
The 'filetype' and 'subchecker' parameters are mandatory. All of the other The 'checker' argument is mandatory. All other arguments above are optional,
parameters above are optional (well, you probably need at least 'exe'), and and can be overriden by setting global variables - even parameters not
can be overriden by setting global variables - even parameters not specified specified in the call to syntastic#makeprg#build(). If 'exe' is the same as
in the call to syntastic#makeprg#build(). the name of the checker, it may be omitted.
E.g. To override the checker exe above, you could do this: > E.g. To override the checker exe above, you could do this: >
let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb" let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb"

View File

@ -12,6 +12,7 @@ function! g:SyntasticChecker.New(args)
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._exec = get(a:args, 'exec', newObj._name)
if has_key(a:args, 'redirect') if has_key(a:args, 'redirect')
let [filetype, name] = split(a:args['redirect'], '/') let [filetype, name] = split(a:args['redirect'], '/')
@ -21,7 +22,12 @@ function! g:SyntasticChecker.New(args)
endif endif
let newObj._locListFunc = function(prefix . 'GetLocList') let newObj._locListFunc = function(prefix . 'GetLocList')
let newObj._isAvailableFunc = function(prefix . 'IsAvailable')
if exists('*' . prefix . 'IsAvailable')
let newObj._isAvailableFunc = function(prefix . 'IsAvailable')
else
let newObj._isAvailableFunc = function('SyntasticCheckerIsAvailableDefault')
endif
if exists('*' . prefix . 'GetHighlightRegex') if exists('*' . prefix . 'GetHighlightRegex')
let newObj._highlightRegexFunc = function(prefix. 'GetHighlightRegex') let newObj._highlightRegexFunc = function(prefix. 'GetHighlightRegex')
@ -40,6 +46,14 @@ function! g:SyntasticChecker.getName()
return self._name return self._name
endfunction endfunction
function! g:SyntasticChecker.getExec()
if exists('g:syntastic_' . self._filetype . '_' . self._name . '_exec')
return expand(g:syntastic_{self._filetype}_{self._name}_exec)
endif
return self._exec
endfunction
function! g:SyntasticChecker.getLocList() function! g:SyntasticChecker.getLocList()
try try
let list = self._locListFunc() let list = self._locListFunc()
@ -85,4 +99,9 @@ function! g:SyntasticChecker._populateHighlightRegexes(list)
return list return list
endfunction endfunction
" Non-method functions
function! SyntasticCheckerIsAvailableDefault() dict
return executable(self.getExec())
endfunction
" vim: set sw=4 sts=4 et fdm=marker: " vim: set sw=4 sts=4 et fdm=marker:

View File

@ -9,7 +9,7 @@ let g:SyntasticMakeprgBuilder = {}
function! g:SyntasticMakeprgBuilder.New(checker, exe, args, fname, post_args, tail) function! g:SyntasticMakeprgBuilder.New(checker, exe, args, fname, post_args, tail)
let newObj = copy(self) let newObj = copy(self)
let newObj._exe = a:exe let newObj._exe = (a:exe == '' && has_key(a:checker, 'getExec')) ? a:checker.getExec() : a:exe
let newObj._args = a:args let newObj._args = a:args
let newObj._fname = a:fname let newObj._fname = a:fname
let newObj._post_args = a:post_args let newObj._post_args = a:post_args

View File

@ -16,8 +16,8 @@ if !exists('g:syntastic_ada_compiler')
let g:syntastic_ada_compiler = 'gcc' let g:syntastic_ada_compiler = 'gcc'
endif endif
function! SyntaxCheckers_ada_gcc_IsAvailable() function! SyntaxCheckers_ada_gcc_IsAvailable() dict
return executable(g:syntastic_ada_compiler) return executable(expand(g:syntastic_ada_compiler))
endfunction endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo

View File

@ -30,13 +30,8 @@ if exists("g:loaded_syntastic_applescript_osacompile_checker")
endif endif
let g:loaded_syntastic_applescript_osacompile_checker=1 let g:loaded_syntastic_applescript_osacompile_checker=1
function! SyntaxCheckers_applescript_osacompile_IsAvailable()
return executable('osacompile')
endfunction
function! SyntaxCheckers_applescript_osacompile_GetLocList() dict function! SyntaxCheckers_applescript_osacompile_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'osacompile',
\ 'args': '-o ' . tempname() . '.scpt ', \ 'args': '-o ' . tempname() . '.scpt ',
\ 'checker': self }) \ 'checker': self })
let errorformat = '%f:%l:%m' let errorformat = '%f:%l:%m'

View File

@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_asciidoc_asciidoc_checker")
endif endif
let g:loaded_syntastic_asciidoc_asciidoc_checker = 1 let g:loaded_syntastic_asciidoc_asciidoc_checker = 1
function! SyntaxCheckers_asciidoc_asciidoc_IsAvailable()
return executable("asciidoc")
endfunction
function! SyntaxCheckers_asciidoc_asciidoc_GetLocList() dict function! SyntaxCheckers_asciidoc_asciidoc_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'asciidoc',
\ 'args': syntastic#c#NullOutput(), \ 'args': syntastic#c#NullOutput(),
\ 'checker': self }) \ 'checker': self })

View File

@ -20,11 +20,10 @@ 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'
endif endif
function! SyntaxCheckers_c_checkpatch_IsAvailable() function! SyntaxCheckers_c_checkpatch_IsAvailable() dict
return exists("g:syntastic_c_checker_checkpatch_location") return exists("g:syntastic_c_checker_checkpatch_location")
endfunction endfunction
function! SyntaxCheckers_c_checkpatch_GetLocList() dict function! SyntaxCheckers_c_checkpatch_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': g:syntastic_c_checker_checkpatch_location, \ 'exe': g:syntastic_c_checker_checkpatch_location,
@ -44,4 +43,5 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'c', \ 'filetype': 'c',
\ 'name': 'checkpatch'}) \ 'name': 'checkpatch',
\ 'exec': 'checkpatch.pl'})

View File

@ -20,8 +20,8 @@ if !exists('g:syntastic_c_compiler')
let g:syntastic_c_compiler = 'gcc' let g:syntastic_c_compiler = 'gcc'
endif endif
function! SyntaxCheckers_c_gcc_IsAvailable() function! SyntaxCheckers_c_gcc_IsAvailable() dict
return executable(g:syntastic_c_compiler) return executable(expand(g:syntastic_c_compiler))
endfunction endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo

View File

@ -15,16 +15,11 @@ if exists('g:loaded_syntastic_c_make_checker')
endif endif
let g:loaded_syntastic_c_make_checker = 1 let g:loaded_syntastic_c_make_checker = 1
function! SyntaxCheckers_c_make_IsAvailable()
return executable('make')
endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
function! SyntaxCheckers_c_make_GetLocList() dict function! SyntaxCheckers_c_make_GetLocList() dict
let makeprg = expand(self.getExec()) . ' -sk'
let makeprg = 'make -sk'
let errorformat = let errorformat =
\ '%-G%f:%s:,' . \ '%-G%f:%s:,' .

View File

@ -21,17 +21,12 @@ if exists("g:loaded_syntastic_c_oclint_checker")
endif endif
let g:loaded_syntastic_c_oclint_checker = 1 let g:loaded_syntastic_c_oclint_checker = 1
function! SyntaxCheckers_c_oclint_IsAvailable()
return executable("oclint")
endfunction
if !exists('g:syntastic_oclint_config_file') if !exists('g:syntastic_oclint_config_file')
let g:syntastic_oclint_config_file = '.syntastic_oclint_config' let g:syntastic_oclint_config_file = '.syntastic_oclint_config'
endif endif
function! SyntaxCheckers_c_oclint_GetLocList() dict function! SyntaxCheckers_c_oclint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'oclint',
\ 'args': '-text', \ 'args': '-text',
\ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file), \ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file),
\ 'checker': self }) \ 'checker': self })

View File

@ -21,17 +21,12 @@ if exists("g:loaded_syntastic_c_sparse_checker")
endif endif
let g:loaded_syntastic_c_sparse_checker = 1 let g:loaded_syntastic_c_sparse_checker = 1
function! SyntaxCheckers_c_sparse_IsAvailable()
return executable("sparse")
endfunction
if !exists('g:syntastic_sparse_config_file') if !exists('g:syntastic_sparse_config_file')
let g:syntastic_sparse_config_file = '.syntastic_sparse_config' let g:syntastic_sparse_config_file = '.syntastic_sparse_config'
endif endif
function! SyntaxCheckers_c_sparse_GetLocList() dict function! SyntaxCheckers_c_sparse_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'sparse',
\ 'args': '-ftabstop=' . &ts . ' ' . syntastic#c#ReadConfig(g:syntastic_sparse_config_file), \ 'args': '-ftabstop=' . &ts . ' ' . syntastic#c#ReadConfig(g:syntastic_sparse_config_file),
\ 'checker': self }) \ 'checker': self })

View File

@ -21,17 +21,12 @@ if exists("g:loaded_syntastic_c_splint_checker")
endif endif
let g:loaded_syntastic_c_splint_checker = 1 let g:loaded_syntastic_c_splint_checker = 1
function! SyntaxCheckers_c_splint_IsAvailable()
return executable("splint")
endfunction
if !exists('g:syntastic_splint_config_file') if !exists('g:syntastic_splint_config_file')
let g:syntastic_splint_config_file = '.syntastic_splint_config' let g:syntastic_splint_config_file = '.syntastic_splint_config'
endif endif
function! SyntaxCheckers_c_splint_GetLocList() dict function! SyntaxCheckers_c_splint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'splint',
\ 'post_args': '-showfunc -hints +quiet ' . syntastic#c#ReadConfig(g:syntastic_splint_config_file), \ 'post_args': '-showfunc -hints +quiet ' . syntastic#c#ReadConfig(g:syntastic_splint_config_file),
\ 'checker': self }) \ 'checker': self })

View File

@ -15,7 +15,7 @@ if exists("g:loaded_syntastic_c_ycm_checker")
endif endif
let g:loaded_syntastic_c_ycm_checker = 1 let g:loaded_syntastic_c_ycm_checker = 1
function! SyntaxCheckers_c_ycm_IsAvailable() function! SyntaxCheckers_c_ycm_IsAvailable() dict
return exists('g:loaded_youcompleteme') return exists('g:loaded_youcompleteme')
endfunction endfunction

View File

@ -15,14 +15,8 @@ if exists("g:loaded_syntastic_chef_foodcritic_checker")
endif endif
let g:loaded_syntastic_chef_foodcritic_checker=1 let g:loaded_syntastic_chef_foodcritic_checker=1
function! SyntaxCheckers_chef_foodcritic_IsAvailable()
return executable('foodcritic')
endfunction
function! SyntaxCheckers_chef_foodcritic_GetLocList() dict function! SyntaxCheckers_chef_foodcritic_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'foodcritic',
\ 'checker': self })
" FC023: Prefer conditional attributes: ./recipes/config.rb:49 " FC023: Prefer conditional attributes: ./recipes/config.rb:49
let errorformat = 'FC%n: %m: %f:%l' let errorformat = 'FC%n: %m: %f:%l'

View File

@ -19,13 +19,8 @@ if !executable("coco")
finish finish
endif endif
function! SyntaxCheckers_co_coco_IsAvailable()
return executable('coco')
endfunction
function! SyntaxCheckers_co_coco_GetLocList() dict function! SyntaxCheckers_co_coco_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'coco',
\ 'args': '-c -o /tmp', \ 'args': '-c -o /tmp',
\ 'checker': self }) \ 'checker': self })

View File

@ -20,8 +20,8 @@ if !exists('g:syntastic_cobol_compiler')
let g:syntastic_cobol_compiler = 'cobc' let g:syntastic_cobol_compiler = 'cobc'
endif endif
function! SyntaxCheckers_cobol_cobc_IsAvailable() function! SyntaxCheckers_cobol_cobc_IsAvailable() dict
return executable(g:syntastic_cobol_compiler) return executable(expand(g:syntastic_cobol_compiler))
endfunction endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo

View File

@ -17,14 +17,14 @@ if exists("g:loaded_syntastic_coffee_coffee_checker")
endif endif
let g:loaded_syntastic_coffee_coffee_checker=1 let g:loaded_syntastic_coffee_coffee_checker=1
function! SyntaxCheckers_coffee_coffee_IsAvailable() function! SyntaxCheckers_coffee_coffee_IsAvailable() dict
return executable("coffee") && let exe = self.getExec()
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion('coffee --version 2>' . syntastic#util#DevNull()), [1,6,2]) return executable(exe) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version 2>' . syntastic#util#DevNull()), [1,6,2])
endfunction endfunction
function! SyntaxCheckers_coffee_coffee_GetLocList() dict function! SyntaxCheckers_coffee_coffee_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'coffee',
\ 'args': '-cp', \ 'args': '-cp',
\ 'checker': self }) \ 'checker': self })

View File

@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_coffee_coffeelint_checker")
endif endif
let g:loaded_syntastic_coffee_coffeelint_checker=1 let g:loaded_syntastic_coffee_coffeelint_checker=1
function! SyntaxCheckers_coffee_coffeelint_IsAvailable()
return executable('coffeelint')
endfunction
function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'coffeelint',
\ 'args': '--csv', \ 'args': '--csv',
\ 'checker': self }) \ 'checker': self })

View File

@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_coq_coqtop_checker")
endif endif
let g:loaded_syntastic_coq_coqtop_checker=1 let g:loaded_syntastic_coq_coqtop_checker=1
function! SyntaxCheckers_coq_coqtop_IsAvailable()
return executable('coqtop')
endfunction
function! SyntaxCheckers_coq_coqtop_GetLocList() dict function! SyntaxCheckers_coq_coqtop_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'coqtop',
\ 'args': '-noglob -batch -load-vernac-source', \ 'args': '-noglob -batch -load-vernac-source',
\ 'checker': self }) \ 'checker': self })

View File

@ -35,14 +35,8 @@ if ! exists('g:syntastic_cpp_cpplint_args')
let g:syntastic_cpp_cpplint_args = '--verbose=3' let g:syntastic_cpp_cpplint_args = '--verbose=3'
endif endif
function! SyntaxCheckers_cpp_cpplint_IsAvailable()
return executable('cpplint.py')
endfunction
function! SyntaxCheckers_cpp_cpplint_GetLocList() dict function! SyntaxCheckers_cpp_cpplint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'cpplint.py',
\ 'checker': self })
let errorformat = '%A%f:%l: %m [%t],%-G%.%#' let errorformat = '%A%f:%l: %m [%t],%-G%.%#'
@ -61,4 +55,5 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cpp', \ 'filetype': 'cpp',
\ 'name': 'cpplint'}) \ 'name': 'cpplint',
\ 'exec': 'cpplint.py'})

View File

@ -19,8 +19,8 @@ if !exists('g:syntastic_cpp_compiler')
let g:syntastic_cpp_compiler = 'g++' let g:syntastic_cpp_compiler = 'g++'
endif endif
function! SyntaxCheckers_cpp_gcc_IsAvailable() function! SyntaxCheckers_cpp_gcc_IsAvailable() dict
return executable(g:syntastic_cpp_compiler) return executable(expand(g:syntastic_cpp_compiler))
endfunction endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo

View File

@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_cs_mcs_checker")
endif endif
let g:loaded_syntastic_cs_mcs_checker=1 let g:loaded_syntastic_cs_mcs_checker=1
function! SyntaxCheckers_cs_mcs_IsAvailable()
return executable('mcs')
endfunction
function! SyntaxCheckers_cs_mcs_GetLocList() dict function! SyntaxCheckers_cs_mcs_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'mcs',
\ 'args': '--parse', \ 'args': '--parse',
\ 'checker': self }) \ 'checker': self })

View File

@ -19,21 +19,12 @@ if exists('g:loaded_syntastic_css_csslint_checker')
endif endif
let g:loaded_syntastic_css_csslint_checker=1 let g:loaded_syntastic_css_csslint_checker=1
if !exists('g:syntastic_csslint_exec')
let g:syntastic_csslint_exec = 'csslint'
endif
if !exists('g:syntastic_csslint_options') if !exists('g:syntastic_csslint_options')
let g:syntastic_csslint_options = '' let g:syntastic_csslint_options = ''
endif endif
function! SyntaxCheckers_css_csslint_IsAvailable()
return executable(expand(g:syntastic_csslint_exec))
endfunction
function! SyntaxCheckers_css_csslint_GetLocList() dict function! SyntaxCheckers_css_csslint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': expand(g:syntastic_csslint_exec),
\ 'args': '--format=compact ' . g:syntastic_csslint_options, \ 'args': '--format=compact ' . g:syntastic_csslint_options,
\ 'checker': self }) \ 'checker': self })

View File

@ -20,10 +20,6 @@ if exists("g:loaded_syntastic_css_prettycss_checker")
endif endif
let g:loaded_syntastic_css_prettycss_checker=1 let g:loaded_syntastic_css_prettycss_checker=1
function! SyntaxCheckers_css_prettycss_IsAvailable()
return executable('prettycss')
endfunction
function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item) function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item)
let term = matchstr(a:item["text"], '\m (\zs[^)]\+\ze)$') let term = matchstr(a:item["text"], '\m (\zs[^)]\+\ze)$')
if term != '' if term != ''
@ -33,9 +29,7 @@ function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item)
endfunction endfunction
function! SyntaxCheckers_css_prettycss_GetLocList() dict function! SyntaxCheckers_css_prettycss_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'prettycss',
\ 'checker': self })
" Print CSS Lint's error/warning messages from compact format. Ignores blank lines. " Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
let errorformat = let errorformat =

View File

@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_cucumber_cucumber_checker")
endif endif
let g:loaded_syntastic_cucumber_cucumber_checker=1 let g:loaded_syntastic_cucumber_cucumber_checker=1
function! SyntaxCheckers_cucumber_cucumber_IsAvailable()
return executable('cucumber')
endfunction
function! SyntaxCheckers_cucumber_cucumber_GetLocList() dict function! SyntaxCheckers_cucumber_cucumber_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'cucumber',
\ 'args': '--dry-run --quiet --strict --format pretty', \ 'args': '--dry-run --quiet --strict --format pretty',
\ 'checker': self }) \ 'checker': self })

View File

@ -24,10 +24,6 @@ if exists("g:loaded_syntastic_cuda_nvcc_checker")
endif endif
let g:loaded_syntastic_cuda_nvcc_checker=1 let g:loaded_syntastic_cuda_nvcc_checker=1
function! SyntaxCheckers_cuda_nvcc_IsAvailable()
return executable('nvcc')
endfunction
function! SyntaxCheckers_cuda_nvcc_GetLocList() dict function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
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
@ -35,8 +31,9 @@ function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
let arch_flag = '' let arch_flag = ''
endif endif
let makeprg = let makeprg =
\ 'nvcc ' . arch_flag . ' --cuda -O0 -I . -Xcompiler -fsyntax-only ' . \ self.getExec() . ' ' . arch_flag . ' --cuda -O0 -I . -Xcompiler -fsyntax-only ' .
\ syntastic#util#shexpand('%') . ' ' . syntastic#c#NullOutput() \ syntastic#util#shexpand('%') . ' ' . syntastic#c#NullOutput()
let errorformat = let errorformat =
\ '%*[^"]"%f"%*\D%l: %m,'. \ '%*[^"]"%f"%*\D%l: %m,'.
\ '"%f"%*\D%l: %m,'. \ '"%f"%*\D%l: %m,'.
@ -57,7 +54,8 @@ function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
if exists('g:syntastic_cuda_check_header') if exists('g:syntastic_cuda_check_header')
let makeprg = let makeprg =
\ 'echo > .syntastic_dummy.cu ; ' . \ 'echo > .syntastic_dummy.cu ; ' .
\ 'nvcc ' . arch_flag . ' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include ' . \ self.getExec() . ' ' . arch_flag .
\ ' --cuda -O0 -I . .syntastic_dummy.cu -Xcompiler -fsyntax-only -include ' .
\ syntastic#util#shexpand('%') . ' ' . syntastic#c#NullOutput() \ syntastic#util#shexpand('%') . ' ' . syntastic#c#NullOutput()
else else
return [] return []

View File

@ -24,8 +24,8 @@ if !exists('g:syntastic_d_compiler')
let g:syntastic_d_compiler = 'dmd' let g:syntastic_d_compiler = 'dmd'
endif endif
function! SyntaxCheckers_d_dmd_IsAvailable() function! SyntaxCheckers_d_dmd_IsAvailable() dict
return executable(g:syntastic_d_compiler) return executable(expand(g:syntastic_d_compiler))
endfunction endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo

View File

@ -17,10 +17,6 @@ if !exists("g:syntastic_dart_analyzer_conf")
let g:syntastic_dart_analyzer_conf = '' let g:syntastic_dart_analyzer_conf = ''
endif endif
function! SyntaxCheckers_dart_dart_analyzer_IsAvailable()
return executable("dart_analyzer")
endfunction
function! SyntaxCheckers_dart_dart_analyzer_GetHighlightRegex(error) function! SyntaxCheckers_dart_dart_analyzer_GetHighlightRegex(error)
let lcol = a:error['col'] - 1 let lcol = a:error['col'] - 1
let rcol = a:error['nr'] + lcol + 1 let rcol = a:error['nr'] + lcol + 1
@ -29,11 +25,9 @@ function! SyntaxCheckers_dart_dart_analyzer_GetHighlightRegex(error)
endfunction endfunction
function! SyntaxCheckers_dart_dart_analyzer_GetLocList() dict function! SyntaxCheckers_dart_dart_analyzer_GetLocList() dict
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',
\ 'args': '--error_format machine', \ 'args': '--error_format machine',
\ 'post_args': args, \ 'post_args': g:syntastic_dart_analyzer_conf,
\ 'checker': self }) \ 'checker': self })
" Machine readable format looks like: " Machine readable format looks like:

View File

@ -15,14 +15,12 @@ endif
let g:loaded_syntastic_dustjs_swiffer_checker = 1 let g:loaded_syntastic_dustjs_swiffer_checker = 1
function! SyntaxCheckers_dustjs_swiffer_IsAvailable() function! SyntaxCheckers_dustjs_swiffer_IsAvailable() dict
return executable('swiffer') return executable('swiffer')
endfunction endfunction
function! SyntaxCheckers_dustjs_swiffer_GetLocList() dict function! SyntaxCheckers_dustjs_swiffer_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'swiffer',
\ 'checker': self })
let errorformat = '%E%f - Line %l\, Column %c: %m' let errorformat = '%E%f - Line %l\, Column %c: %m'

View File

@ -15,7 +15,7 @@ endif
let g:loaded_syntastic_elixir_elixir_checker=1 let g:loaded_syntastic_elixir_elixir_checker=1
" TODO: we should probably split this into separate checkers " TODO: we should probably split this into separate checkers
function! SyntaxCheckers_elixir_elixir_IsAvailable() function! SyntaxCheckers_elixir_elixir_IsAvailable() dict
return executable('elixir') && executable('mix') return executable('elixir') && executable('mix')
endfunction endfunction

View File

@ -21,10 +21,6 @@ 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'
function! SyntaxCheckers_erlang_escript_IsAvailable()
return executable('escript')
endfunction
function! SyntaxCheckers_erlang_escript_GetLocList() dict function! SyntaxCheckers_erlang_escript_GetLocList() dict
if expand('%:e') ==# 'hrl' if expand('%:e') ==# 'hrl'
return [] return []
@ -39,7 +35,6 @@ function! SyntaxCheckers_erlang_escript_GetLocList() dict
let post_args = g:syntastic_erlc_include_path let post_args = g:syntastic_erlc_include_path
endif endif
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'escript',
\ 'args': args, \ 'args': args,
\ 'fname': syntastic#util#shexpand('%:p'), \ 'fname': syntastic#util#shexpand('%:p'),
\ 'post_args': post_args, \ 'post_args': post_args,

View File

@ -19,7 +19,7 @@ if !exists("g:syntastic_ruby_exec")
let g:syntastic_ruby_exec = "ruby" let g:syntastic_ruby_exec = "ruby"
endif endif
function! SyntaxCheckers_eruby_ruby_IsAvailable() function! SyntaxCheckers_eruby_ruby_IsAvailable() dict
return executable(expand(g:syntastic_ruby_exec)) return executable(expand(g:syntastic_ruby_exec))
endfunction endfunction

View File

@ -19,8 +19,8 @@ if !exists('g:syntastic_fortran_compiler')
let g:syntastic_fortran_compiler = 'gfortran' let g:syntastic_fortran_compiler = 'gfortran'
endif endif
function! SyntaxCheckers_fortran_gfortran_IsAvailable() function! SyntaxCheckers_fortran_gfortran_IsAvailable() dict
return executable(g:syntastic_fortran_compiler) return executable(expand(g:syntastic_fortran_compiler))
endfunction endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo

View File

@ -17,8 +17,8 @@ if exists("g:loaded_syntastic_go_go_checker")
endif endif
let g:loaded_syntastic_go_go_checker=1 let g:loaded_syntastic_go_go_checker=1
function! SyntaxCheckers_go_go_IsAvailable() function! SyntaxCheckers_go_go_IsAvailable() dict
return executable('go') return executable('go') && executable('gofmt')
endfunction endfunction
function! SyntaxCheckers_go_go_GetLocList() dict function! SyntaxCheckers_go_go_GetLocList() dict

View File

@ -17,13 +17,8 @@ if exists("g:loaded_syntastic_go_gofmt_checker")
endif endif
let g:loaded_syntastic_go_gofmt_checker=1 let g:loaded_syntastic_go_gofmt_checker=1
function! SyntaxCheckers_go_gofmt_IsAvailable()
return executable('gofmt')
endfunction
function! SyntaxCheckers_go_gofmt_GetLocList() dict function! SyntaxCheckers_go_gofmt_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'gofmt',
\ 'args': '-l', \ 'args': '-l',
\ 'tail': '1>' . syntastic#util#DevNull(), \ 'tail': '1>' . syntastic#util#DevNull(),
\ 'checker': self }) \ 'checker': self })

View File

@ -14,14 +14,8 @@ if exists("g:loaded_syntastic_go_golint_checker")
endif endif
let g:loaded_syntastic_go_golint_checker=1 let g:loaded_syntastic_go_golint_checker=1
function! SyntaxCheckers_go_golint_IsAvailable()
return executable('golint')
endfunction
function! SyntaxCheckers_go_golint_GetLocList() dict function! SyntaxCheckers_go_golint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'golint',
\ 'checker': self })
let errorformat = '%f:%l:%c: %m,%-G%.%#' let errorformat = '%f:%l:%c: %m,%-G%.%#'

View File

@ -14,7 +14,7 @@ if exists("g:loaded_syntastic_go_govet_checker")
endif endif
let g:loaded_syntastic_go_govet_checker=1 let g:loaded_syntastic_go_govet_checker=1
function! SyntaxCheckers_go_govet_IsAvailable() function! SyntaxCheckers_go_govet_IsAvailable() dict
return executable('go') return executable('go')
endfunction endfunction

View File

@ -19,7 +19,7 @@ if !exists('g:syntastic_haml_interpreter')
let g:syntastic_haml_interpreter = 'haml' let g:syntastic_haml_interpreter = 'haml'
endif endif
function! SyntaxCheckers_haml_haml_IsAvailable() function! SyntaxCheckers_haml_haml_IsAvailable() dict
return executable(expand(g:syntastic_haml_interpreter)) return executable(expand(g:syntastic_haml_interpreter))
endfunction endfunction

View File

@ -13,13 +13,8 @@ if exists("g:loaded_syntastic_handlebars_handlebars_checker")
endif endif
let g:loaded_syntastic_handlebars_handlebars_checker=1 let g:loaded_syntastic_handlebars_handlebars_checker=1
function! SyntaxCheckers_handlebars_handlebars_IsAvailable()
return executable('handlebars')
endfunction
function! SyntaxCheckers_handlebars_handlebars_GetLocList() dict function! SyntaxCheckers_handlebars_handlebars_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'handlebars',
\ 'args': '-f ' . syntastic#util#DevNull(), \ 'args': '-f ' . syntastic#util#DevNull(),
\ 'checker': self }) \ 'checker': self })

View File

@ -15,13 +15,9 @@ if exists('g:loaded_syntastic_haskell_ghc_mod_checker')
endif endif
let g:loaded_syntastic_haskell_ghc_mod_checker = 1 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() dict function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'ghc-mod check', \ 'exe': self.getExec() . ' check',
\ 'checker': self }) \ 'checker': self })
let errorformat = let errorformat =
@ -42,4 +38,5 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'haskell', \ 'filetype': 'haskell',
\ 'name': 'ghc_mod'}) \ 'name': 'ghc_mod',
\ 'exec': 'ghc-mod'})

View File

@ -15,13 +15,9 @@ if exists("g:loaded_syntastic_haskell_hdevtools_checker")
endif endif
let g:loaded_syntastic_haskell_hdevtools_checker=1 let g:loaded_syntastic_haskell_hdevtools_checker=1
function! SyntaxCheckers_haskell_hdevtools_IsAvailable()
return executable('hdevtools')
endfunction
function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'hdevtools check', \ 'exe': self.getExec() . ' check',
\ 'args': get(g:, 'hdevtools_options', ''), \ 'args': get(g:, 'hdevtools_options', ''),
\ 'checker': self }) \ 'checker': self })

View File

@ -10,14 +10,8 @@ if exists('g:loaded_syntastic_haskell_hlint_checker')
endif endif
let g:loaded_syntastic_haskell_hlint_checker = 1 let g:loaded_syntastic_haskell_hlint_checker = 1
function! SyntaxCheckers_haskell_hlint_IsAvailable()
return executable('hlint')
endfunction
function! SyntaxCheckers_haskell_hlint_GetLocList() dict function! SyntaxCheckers_haskell_hlint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'hlint',
\ 'checker': self })
let errorformat = let errorformat =
\ '%E%f:%l:%c: Error: %m,' . \ '%E%f:%l:%c: Error: %m,' .

View File

@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_haxe_haxe_checker")
endif endif
let g:loaded_syntastic_haxe_haxe_checker=1 let g:loaded_syntastic_haxe_haxe_checker=1
function! SyntaxCheckers_haxe_haxe_IsAvailable()
return executable('haxe')
endfunction
function! SyntaxCheckers_haxe_haxe_GetLocList() dict function! SyntaxCheckers_haxe_haxe_GetLocList() dict
if exists('b:vaxe_hxml') if exists('b:vaxe_hxml')
let hxml = b:vaxe_hxml let hxml = b:vaxe_hxml
@ -31,7 +27,6 @@ function! SyntaxCheckers_haxe_haxe_GetLocList() dict
if !empty(hxml) if !empty(hxml)
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'haxe',
\ 'fname': syntastic#util#shescape(fnameescape(fnamemodify(hxml, ':t'))), \ 'fname': syntastic#util#shescape(fnameescape(fnamemodify(hxml, ':t'))),
\ 'checker': self }) \ 'checker': self })

View File

@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_hss_hss_checker")
endif endif
let g:loaded_syntastic_hss_hss_checker=1 let g:loaded_syntastic_hss_hss_checker=1
function! SyntaxCheckers_hss_hss_IsAvailable()
return executable('hss')
endfunction
function! SyntaxCheckers_hss_hss_GetLocList() dict function! SyntaxCheckers_hss_hss_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'hss',
\ 'args' : '-output ' . syntastic#util#DevNull(), \ 'args' : '-output ' . syntastic#util#DevNull(),
\ 'checker': self }) \ 'checker': self })

View File

@ -42,10 +42,6 @@ if !exists('g:syntastic_html_tidy_empty_tags')
let g:syntastic_html_tidy_empty_tags = [] let g:syntastic_html_tidy_empty_tags = []
endif endif
function! SyntaxCheckers_html_tidy_IsAvailable()
return executable('tidy')
endfunction
" TODO: join this with xhtml.vim for DRY's sake? " TODO: join this with xhtml.vim for DRY's sake?
function! s:TidyEncOptByFenc() function! s:TidyEncOptByFenc()
let tidy_opts = { let tidy_opts = {
@ -141,7 +137,6 @@ endfunction
function! SyntaxCheckers_html_tidy_GetLocList() dict function! SyntaxCheckers_html_tidy_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'tidy',
\ 'args': s:Args(), \ 'args': s:Args(),
\ 'tail': '2>&1', \ 'tail': '2>&1',
\ 'checker': self }) \ 'checker': self })

View File

@ -45,7 +45,7 @@ if !exists('g:syntastic_html_validator_nsfilter')
let g:syntastic_html_validator_nsfilter = '' let g:syntastic_html_validator_nsfilter = ''
endif endif
function! SyntaxCheckers_html_validator_IsAvailable() function! SyntaxCheckers_html_validator_IsAvailable() dict
return executable('curl') return executable('curl')
endfunction endfunction

View File

@ -26,7 +26,7 @@ if !exists('g:syntastic_html_w3_api')
let g:syntastic_html_w3_api = 'http://validator.w3.org/check' let g:syntastic_html_w3_api = 'http://validator.w3.org/check'
endif endif
function! SyntaxCheckers_html_w3_IsAvailable() function! SyntaxCheckers_html_w3_IsAvailable() dict
return executable('curl') return executable('curl')
endfunction endfunction

View File

@ -23,10 +23,6 @@ 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_checkstyle_IsAvailable()
return executable('java')
endfunction
function! SyntaxCheckers_java_checkstyle_Preprocess(errors) function! SyntaxCheckers_java_checkstyle_Preprocess(errors)
let out = copy(a:errors) let out = copy(a:errors)
for n in range(len(out)) for n in range(len(out))
@ -48,7 +44,6 @@ function! SyntaxCheckers_java_checkstyle_GetLocList() dict
endif endif
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'java',
\ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath . \ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath .
\ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file . \ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file .
\ ' -f xml', \ ' -f xml',
@ -75,4 +70,5 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'java', \ 'filetype': 'java',
\ 'name': 'checkstyle'}) \ 'name': 'checkstyle',
\ 'exec': 'java'})

View File

@ -161,7 +161,7 @@ function! s:GetMavenProperties()
let pom = findfile("pom.xml", ".;") let pom = findfile("pom.xml", ".;")
if s:has_maven && filereadable(pom) if s:has_maven && filereadable(pom)
if !has_key(g:syntastic_java_javac_maven_pom_properties, pom) if !has_key(g:syntastic_java_javac_maven_pom_properties, pom)
let mvn_cmd = g:syntastic_java_maven_executable . ' -f ' . pom let mvn_cmd = expand(g:syntastic_java_maven_executable) . ' -f ' . pom
let mvn_is_managed_tag = 1 let mvn_is_managed_tag = 1
let mvn_settings_output = split(system(mvn_cmd . ' help:effective-pom'), "\n") let mvn_settings_output = split(system(mvn_cmd . ' help:effective-pom'), "\n")
let current_path = 'project' let current_path = 'project'
@ -196,7 +196,7 @@ function! s:GetMavenClasspath()
let pom = findfile("pom.xml", ".;") let pom = findfile("pom.xml", ".;")
if s:has_maven && filereadable(pom) if s:has_maven && filereadable(pom)
if !has_key(g:syntastic_java_javac_maven_pom_ftime, pom) || g:syntastic_java_javac_maven_pom_ftime[pom] != getftime(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_cmd = expand(g:syntastic_java_maven_executable) . ' -f ' . pom
let mvn_classpath_output = split(system(mvn_cmd . ' dependency:build-classpath'), "\n") let mvn_classpath_output = split(system(mvn_cmd . ' dependency:build-classpath'), "\n")
let mvn_classpath = '' let mvn_classpath = ''
let class_path_next = 0 let class_path_next = 0
@ -233,9 +233,9 @@ function! s:GetMavenClasspath()
return '' return ''
endfunction endfunction
function! SyntaxCheckers_java_javac_IsAvailable() function! SyntaxCheckers_java_javac_IsAvailable() dict
let s:has_maven = executable(g:syntastic_java_maven_executable) let s:has_maven = executable(expand(g:syntastic_java_maven_executable))
return executable(g:syntastic_java_javac_executable) return executable(expand(g:syntastic_java_javac_executable))
endfunction endfunction
function! s:MavenOutputDirectory() function! s:MavenOutputDirectory()
@ -331,7 +331,6 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
endif endif
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': g:syntastic_java_javac_executable,
\ 'args': javac_opts, \ 'args': javac_opts,
\ 'fname': fname, \ 'fname': fname,
\ 'tail': '2>&1', \ 'tail': '2>&1',

View File

@ -30,8 +30,8 @@ if !exists("g:syntastic_javascript_closure_compiler_options")
let g:syntastic_javascript_closure_compiler_options = "" let g:syntastic_javascript_closure_compiler_options = ""
endif endif
function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() dict
return exists("g:syntastic_javascript_closure_compiler_path") return executable("java") && exists("g:syntastic_javascript_closure_compiler_path")
endfunction endfunction
function! SyntaxCheckers_javascript_closurecompiler_GetLocList() dict function! SyntaxCheckers_javascript_closurecompiler_GetLocList() dict
@ -61,5 +61,6 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'javascript', \ 'filetype': 'javascript',
\ 'name': 'closurecompiler'}) \ 'name': 'closurecompiler',
\ 'exec': 'java'})

View File

@ -17,13 +17,8 @@ if !exists("g:syntastic_javascript_gjslint_conf")
let g:syntastic_javascript_gjslint_conf = "" let g:syntastic_javascript_gjslint_conf = ""
endif endif
function! SyntaxCheckers_javascript_gjslint_IsAvailable()
return executable('gjslint')
endfunction
function! SyntaxCheckers_javascript_gjslint_GetLocList() dict function! SyntaxCheckers_javascript_gjslint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ '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",
\ 'checker': self }) \ 'checker': self })

View File

@ -22,7 +22,7 @@ if !exists('g:syntastic_javascript_jshint_conf')
let g:syntastic_javascript_jshint_conf = '' let g:syntastic_javascript_jshint_conf = ''
endif endif
function! SyntaxCheckers_javascript_jshint_IsAvailable() function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
return executable(expand(g:syntastic_jshint_exec)) return executable(expand(g:syntastic_jshint_exec))
endfunction endfunction

View File

@ -17,22 +17,10 @@ if !exists("g:syntastic_javascript_jsl_conf")
let g:syntastic_javascript_jsl_conf = "" let g:syntastic_javascript_jsl_conf = ""
endif 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() dict function! SyntaxCheckers_javascript_jsl_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'jsl', \ 'args': (!empty(g:syntastic_javascript_jsl_conf) ? "-conf " . g:syntastic_javascript_jsl_conf : "") .
\ 'args': s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process", \ " -nologo -nofilelisting -nosummary -nocontext -process",
\ 'checker': self }) \ 'checker': self })
let errorformat = let errorformat =

View File

@ -19,10 +19,6 @@ 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_jslint_IsAvailable()
return executable('jslint')
endfunction
function! SyntaxCheckers_javascript_jslint_HighlightTerm(error) function! SyntaxCheckers_javascript_jslint_HighlightTerm(error)
let unexpected = matchstr(a:error['text'], '\mExpected.*and instead saw \'\zs.*\ze\'') let unexpected = matchstr(a:error['text'], '\mExpected.*and instead saw \'\zs.*\ze\'')
if len(unexpected) < 1i if len(unexpected) < 1i
@ -33,7 +29,6 @@ endfunction
function! SyntaxCheckers_javascript_jslint_GetLocList() dict function! SyntaxCheckers_javascript_jslint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'jslint',
\ 'args': g:syntastic_javascript_jslint_conf, \ 'args': g:syntastic_javascript_jslint_conf,
\ 'checker': self }) \ 'checker': self })

View File

@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_json_jsonlint_checker")
endif endif
let g:loaded_syntastic_json_jsonlint_checker=1 let g:loaded_syntastic_json_jsonlint_checker=1
function! SyntaxCheckers_json_jsonlint_IsAvailable()
return executable('jsonlint')
endfunction
function! SyntaxCheckers_json_jsonlint_GetLocList() dict function! SyntaxCheckers_json_jsonlint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'jsonlint',
\ 'post_args': '--compact', \ 'post_args': '--compact',
\ 'checker': self }) \ 'checker': self })

View File

@ -14,15 +14,9 @@ if exists("g:loaded_syntastic_json_jsonval_checker")
endif endif
let g:loaded_syntastic_json_jsonval_checker=1 let g:loaded_syntastic_json_jsonval_checker=1
function! SyntaxCheckers_json_jsonval_IsAvailable()
return executable('jsonval')
endfunction
function! SyntaxCheckers_json_jsonval_GetLocList() dict function! SyntaxCheckers_json_jsonval_GetLocList() dict
" based on https://gist.github.com/1196345 " based on https://gist.github.com/1196345
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'jsonval',
\ 'checker': self })
let errorformat = let errorformat =
\ '%E%f:\ %m\ at\ line\ %l,' . \ '%E%f:\ %m\ at\ line\ %l,' .

View File

@ -36,8 +36,8 @@ else
let s:check_file = 'lessc' let s:check_file = 'lessc'
endif endif
function! SyntaxCheckers_less_lessc_IsAvailable() function! SyntaxCheckers_less_lessc_IsAvailable() dict
return executable('lessc') return g:syntastic_less_use_less_lint ? executable('node') : executable('lessc')
endfunction endfunction
function! SyntaxCheckers_less_lessc_GetLocList() dict function! SyntaxCheckers_less_lessc_GetLocList() dict

View File

@ -14,15 +14,10 @@ if exists("g:loaded_syntastic_lisp_clisp_checker")
endif endif
let g:loaded_syntastic_lisp_clisp_checker=1 let g:loaded_syntastic_lisp_clisp_checker=1
function! SyntaxCheckers_lisp_clisp_IsAvailable()
return executable("clisp")
endfunction
function! SyntaxCheckers_lisp_clisp_GetLocList() dict function! SyntaxCheckers_lisp_clisp_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'clisp',
\ 'args': '-q -c', \ 'args': '-q -c',
\ 'tail': '-o /tmp/clisp-vim-compiled-file', \ 'tail': syntastic#c#NullOutput(),
\ 'checker': self }) \ 'checker': self })
let errorformat = let errorformat =

View File

@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_llvm_llvm_checker")
endif endif
let g:loaded_syntastic_llvm_llvm_checker=1 let g:loaded_syntastic_llvm_llvm_checker=1
function! SyntaxCheckers_llvm_llvm_IsAvailable()
return executable("llc")
endfunction
function! SyntaxCheckers_llvm_llvm_GetLocList() dict function! SyntaxCheckers_llvm_llvm_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'llc',
\ 'args': syntastic#c#NullOutput(), \ 'args': syntastic#c#NullOutput(),
\ 'checker': self }) \ 'checker': self })
@ -33,5 +28,6 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'llvm', \ 'filetype': 'llvm',
\ 'name': 'llvm'}) \ 'name': 'llvm',
\ 'exec': 'llc'})

View File

@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_lua_luac_checker")
endif endif
let g:loaded_syntastic_lua_luac_checker=1 let g:loaded_syntastic_lua_luac_checker=1
function! SyntaxCheckers_lua_luac_IsAvailable()
return executable('luac')
endfunction
function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos) function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
let near = matchstr(a:pos['text'], "\\mnear '[^']\\+'") let near = matchstr(a:pos['text'], "\\mnear '[^']\\+'")
let result = '' let result = ''
@ -42,10 +38,8 @@ function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
return result return result
endfunction endfunction
function! SyntaxCheckers_lua_luac_GetLocList() dict function! SyntaxCheckers_lua_luac_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'luac',
\ 'args': '-p', \ 'args': '-p',
\ 'checker': self }) \ 'checker': self })
@ -55,7 +49,6 @@ function! SyntaxCheckers_lua_luac_GetLocList() dict
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat, \ 'errorformat': errorformat,
\ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } }) \ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({

View File

@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_matlab_mlint_checker")
endif endif
let g:loaded_syntastic_matlab_mlint_checker=1 let g:loaded_syntastic_matlab_mlint_checker=1
function! SyntaxCheckers_matlab_mlint_IsAvailable()
return executable("mlint")
endfunction
function! SyntaxCheckers_matlab_mlint_GetLocList() dict function! SyntaxCheckers_matlab_mlint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'mlint',
\ 'args': '-id $*', \ 'args': '-id $*',
\ 'checker': self }) \ 'checker': self })

View File

@ -14,15 +14,12 @@ if exists("g:loaded_syntastic_nasm_nasm_checker")
endif endif
let g:loaded_syntastic_nasm_nasm_checker=1 let g:loaded_syntastic_nasm_nasm_checker=1
function! SyntaxCheckers_nasm_nasm_IsAvailable()
return executable("nasm")
endfunction
function! SyntaxCheckers_nasm_nasm_GetLocList() dict function! SyntaxCheckers_nasm_nasm_GetLocList() dict
let wd = syntastic#util#shescape(expand("%:p:h") . "/") let wd = syntastic#util#shescape(expand("%:p:h") . "/")
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'nasm', \ 'args': '-X gnu -f elf' .
\ 'args': '-X gnu -f elf -I ' . wd . ' ' . syntastic#c#NullOutput(), \ ' -I ' . syntastic#util#shescape(expand("%:p:h") . "/") .
\ ' ' . syntastic#c#NullOutput(),
\ 'checker': self }) \ 'checker': self })
let errorformat = '%f:%l: %t%*[^:]: %m' let errorformat = '%f:%l: %t%*[^:]: %m'

View File

@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_nroff_mandoc_checker")
endif endif
let g:loaded_syntastic_nroff_mandoc_checker=1 let g:loaded_syntastic_nroff_mandoc_checker=1
function! SyntaxCheckers_nroff_mandoc_IsAvailable()
return executable("mandoc")
endfunction
function! SyntaxCheckers_nroff_mandoc_GetLocList() dict function! SyntaxCheckers_nroff_mandoc_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'mandoc',
\ 'args': '-Tlint', \ 'args': '-Tlint',
\ 'checker': self }) \ 'checker': self })

View File

@ -19,8 +19,8 @@ if !exists('g:syntastic_objc_compiler')
let g:syntastic_objc_compiler = 'gcc' let g:syntastic_objc_compiler = 'gcc'
endif endif
function! SyntaxCheckers_objc_gcc_IsAvailable() function! SyntaxCheckers_objc_gcc_IsAvailable() dict
return executable(g:syntastic_objc_compiler) return executable(expand(g:syntastic_objc_compiler))
endfunction endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo

View File

@ -19,8 +19,8 @@ if !exists('g:syntastic_objcpp_compiler')
let g:syntastic_objcpp_compiler = 'gcc' let g:syntastic_objcpp_compiler = 'gcc'
endif endif
function! SyntaxCheckers_objcpp_gcc_IsAvailable() function! SyntaxCheckers_objcpp_gcc_IsAvailable() dict
return executable(g:syntastic_objcpp_compiler) return executable(expand(g:syntastic_objcpp_compiler))
endfunction endfunction
let s:save_cpo = &cpo let s:save_cpo = &cpo

View File

@ -53,14 +53,13 @@ if exists("g:loaded_syntastic_ocaml_camlp4o_checker")
endif endif
let g:loaded_syntastic_ocaml_camlp4o_checker=1 let g:loaded_syntastic_ocaml_camlp4o_checker=1
if exists('g:syntastic_ocaml_camlp4r') && if exists('g:syntastic_ocaml_camlp4r') && g:syntastic_ocaml_camlp4r != 0
\ g:syntastic_ocaml_camlp4r != 0
let s:ocamlpp="camlp4r" let s:ocamlpp="camlp4r"
else else
let s:ocamlpp="camlp4o" let s:ocamlpp="camlp4o"
endif endif
function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() dict
return executable(s:ocamlpp) return executable(s:ocamlpp)
endfunction endfunction

View File

@ -34,8 +34,8 @@ if !exists('g:syntastic_perl_lib_path')
let g:syntastic_perl_lib_path = [] let g:syntastic_perl_lib_path = []
endif endif
function! SyntaxCheckers_perl_perl_IsAvailable() function! SyntaxCheckers_perl_perl_IsAvailable() dict
return executable(g:syntastic_perl_interpreter) return executable(expand(g:syntastic_perl_interpreter))
endfunction endfunction
function! SyntaxCheckers_perl_perl_Preprocess(errors) function! SyntaxCheckers_perl_perl_Preprocess(errors)
@ -52,6 +52,7 @@ function! SyntaxCheckers_perl_perl_Preprocess(errors)
endfunction endfunction
function! SyntaxCheckers_perl_perl_GetLocList() dict function! SyntaxCheckers_perl_perl_GetLocList() dict
let exe = expand(g:syntastic_perl_interpreter)
if type(g:syntastic_perl_lib_path) == type('') if type(g:syntastic_perl_lib_path) == type('')
call syntastic#util#deprecationWarn('variable g:syntastic_perl_lib_path should be a list') call syntastic#util#deprecationWarn('variable g:syntastic_perl_lib_path should be a list')
let includes = split(g:syntastic_perl_lib_path, ',') let includes = split(g:syntastic_perl_lib_path, ',')
@ -65,7 +66,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict
let errorformat = '%f:%l:%m' let errorformat = '%f:%l:%m'
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': g:syntastic_perl_interpreter, \ 'exe': exe,
\ 'args': '-c -X ' . extra, \ 'args': '-c -X ' . extra,
\ 'checker': self }) \ 'checker': self })
@ -79,7 +80,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict
endif endif
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': g:syntastic_perl_interpreter, \ 'exe': exe,
\ 'args': '-c -Mwarnings ' . extra, \ 'args': '-c -Mwarnings ' . extra,
\ 'checker': self }) \ 'checker': self })

View File

@ -33,13 +33,8 @@ if !exists('g:syntastic_perl_perlcritic_thres')
let g:syntastic_perl_perlcritic_thres = 5 let g:syntastic_perl_perlcritic_thres = 5
endif endif
function! SyntaxCheckers_perl_perlcritic_IsAvailable()
return executable('perlcritic')
endfunction
function! SyntaxCheckers_perl_perlcritic_GetLocList() dict function! SyntaxCheckers_perl_perlcritic_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'perlcritic',
\ 'post_args': '--quiet --nocolor --verbose "\%s:\%f:\%l:\%c:(\%s) \%m (\%e)\n"', \ 'post_args': '--quiet --nocolor --verbose "\%s:\%f:\%l:\%c:(\%s) \%m (\%e)\n"',
\ 'checker': self }) \ 'checker': self })

View File

@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_php_php_checker")
endif endif
let g:loaded_syntastic_php_php_checker=1 let g:loaded_syntastic_php_php_checker=1
function! SyntaxCheckers_php_php_IsAvailable()
return executable("php")
endfunction
function! SyntaxCheckers_php_php_GetHighlightRegex(item) function! SyntaxCheckers_php_php_GetHighlightRegex(item)
let unexpected = matchstr(a:item['text'], "\\munexpected '[^']\\+'") let unexpected = matchstr(a:item['text'], "\\munexpected '[^']\\+'")
if len(unexpected) < 1 if len(unexpected) < 1
@ -29,7 +25,6 @@ endfunction
function! SyntaxCheckers_php_php_GetLocList() dict function! SyntaxCheckers_php_php_GetLocList() dict
let makeprg = syntastic#makeprg#build({ 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', \ 'args': '-l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 -d xdebug.cli_color=0',
\ 'checker': self }) \ 'checker': self })

View File

@ -18,13 +18,8 @@ if exists("g:loaded_syntastic_php_phpcs_checker")
endif endif
let g:loaded_syntastic_php_phpcs_checker=1 let g:loaded_syntastic_php_phpcs_checker=1
function! SyntaxCheckers_php_phpcs_IsAvailable()
return executable('phpcs')
endfunction
function! SyntaxCheckers_php_phpcs_GetLocList() dict function! SyntaxCheckers_php_phpcs_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'phpcs',
\ 'args': '--report=csv', \ 'args': '--report=csv',
\ 'checker': self }) \ 'checker': self })

View File

@ -18,10 +18,6 @@ if exists("g:loaded_syntastic_php_phpmd_checker")
endif endif
let g:loaded_syntastic_php_phpmd_checker=1 let g:loaded_syntastic_php_phpmd_checker=1
function! SyntaxCheckers_php_phpmd_IsAvailable()
return executable('phpmd')
endfunction
function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item) function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item)
let term = matchstr(a:item['text'], '\m\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)') let term = matchstr(a:item['text'], '\m\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)')
if term != '' if term != ''
@ -60,7 +56,6 @@ endfunction
function! SyntaxCheckers_php_phpmd_GetLocList() dict function! SyntaxCheckers_php_phpmd_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'phpmd',
\ 'post_args': 'text codesize,design,unusedcode,naming', \ 'post_args': 'text codesize,design,unusedcode,naming',
\ 'checker': self }) \ 'checker': self })

View File

@ -14,14 +14,8 @@ if exists("g:loaded_syntastic_pod_podchecker_checker")
endif endif
let g:loaded_syntastic_pod_podchecker_checker=1 let g:loaded_syntastic_pod_podchecker_checker=1
function! SyntaxCheckers_pod_podchecker_IsAvailable()
return executable("podchecker")
endfunction
function! SyntaxCheckers_pod_podchecker_GetLocList() dict function! SyntaxCheckers_pod_podchecker_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'podchecker',
\ 'checker': self })
let errorformat = let errorformat =
\ '%W%[%#]%[%#]%[%#] WARNING: %m at line %l in file %f,' . \ '%W%[%#]%[%#]%[%#] WARNING: %m at line %l in file %f,' .

View File

@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_puppet_puppet_checker")
endif endif
let g:loaded_syntastic_puppet_puppet_checker=1 let g:loaded_syntastic_puppet_puppet_checker=1
function! SyntaxCheckers_puppet_puppet_IsAvailable()
return executable("puppet")
endfunction
function! SyntaxCheckers_puppet_puppet_GetLocList() dict function! SyntaxCheckers_puppet_puppet_GetLocList() dict
let ver = syntastic#util#getVersion(self.getExec() . ' --version 2>' . syntastic#util#DevNull())
let ver = syntastic#util#getVersion('puppet --version 2>' . syntastic#util#DevNull())
if syntastic#util#versionIsAtLeast(ver, [2,7,0]) if syntastic#util#versionIsAtLeast(ver, [2,7,0])
let args = 'parser validate --color=false' let args = 'parser validate --color=false'
@ -30,7 +25,6 @@ function! SyntaxCheckers_puppet_puppet_GetLocList() dict
endif endif
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'puppet',
\ 'args': args, \ 'args': args,
\ 'checker': self }) \ 'checker': self })
@ -43,7 +37,6 @@ function! SyntaxCheckers_puppet_puppet_GetLocList() dict
return SyntasticMake({ return SyntasticMake({
\ 'makeprg': makeprg, \ 'makeprg': makeprg,
\ 'errorformat': errorformat }) \ 'errorformat': errorformat })
endfunction endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({

View File

@ -20,7 +20,7 @@ if exists("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") call syntastic#util#deprecationWarn("variable g:syntastic_puppet_lint_arguments is deprecated, please use g:syntastic_puppet_puppetlint_args instead")
endif endif
function! SyntaxCheckers_puppet_puppetlint_IsAvailable() function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
return return
\ executable("puppet") && \ executable("puppet") &&
\ executable("puppet-lint") && \ executable("puppet-lint") &&
@ -43,4 +43,5 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'puppet', \ 'filetype': 'puppet',
\ 'name': 'puppetlint'}) \ 'name': 'puppetlint',
\ 'exec': 'puppet-lint'})

View File

@ -10,10 +10,6 @@ if exists("g:loaded_syntastic_python_flake8_checker")
endif endif
let g:loaded_syntastic_python_flake8_checker=1 let g:loaded_syntastic_python_flake8_checker=1
function! SyntaxCheckers_python_flake8_IsAvailable()
return executable('flake8')
endfunction
function! SyntaxCheckers_python_flake8_GetHighlightRegex(i) function! SyntaxCheckers_python_flake8_GetHighlightRegex(i)
return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i) return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i)
endfunction endfunction
@ -36,8 +32,8 @@ function! SyntaxCheckers_python_flake8_GetLocList() dict
\ 'errorformat': errorformat }) \ 'errorformat': errorformat })
endfunction endfunction
runtime! syntax_checkers/python/pyflakes.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'python', \ 'filetype': 'python',
\ 'name': 'flake8'}) \ 'name': 'flake8'})
runtime! syntax_checkers/python/pyflakes.vim

View File

@ -10,10 +10,6 @@ if exists("g:loaded_syntastic_python_pep257_checker")
endif endif
let g:loaded_syntastic_python_pep257_checker = 1 let g:loaded_syntastic_python_pep257_checker = 1
function! SyntaxCheckers_python_pep257_IsAvailable()
return executable('pep257')
endfunction
" sanity: kill empty lines here rather than munging errorformat " sanity: kill empty lines here rather than munging errorformat
function! SyntaxCheckers_python_pep257_Preprocess(errors) function! SyntaxCheckers_python_pep257_Preprocess(errors)
return filter(copy(a:errors), 'v:val != ""') return filter(copy(a:errors), 'v:val != ""')

View File

@ -17,10 +17,6 @@ if exists("g:loaded_syntastic_python_pep8_checker")
endif endif
let g:loaded_syntastic_python_pep8_checker=1 let g:loaded_syntastic_python_pep8_checker=1
function! SyntaxCheckers_python_pep8_IsAvailable()
return executable('pep8')
endfunction
function! SyntaxCheckers_python_pep8_GetLocList() dict function! SyntaxCheckers_python_pep8_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'pep8', \ 'exe': 'pep8',

View File

@ -9,10 +9,6 @@ if exists("g:loaded_syntastic_python_py3kwarn_checker")
endif endif
let g:loaded_syntastic_python_py3kwarn_checker=1 let g:loaded_syntastic_python_py3kwarn_checker=1
function! SyntaxCheckers_python_py3kwarn_IsAvailable()
return executable('py3kwarn')
endfunction
function! SyntaxCheckers_python_py3kwarn_GetLocList() dict function! SyntaxCheckers_python_py3kwarn_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'py3kwarn', \ 'exe': 'py3kwarn',

View File

@ -11,10 +11,6 @@ if exists("g:loaded_syntastic_python_pyflakes_checker")
endif endif
let g:loaded_syntastic_python_pyflakes_checker=1 let g:loaded_syntastic_python_pyflakes_checker=1
function! SyntaxCheckers_python_pyflakes_IsAvailable()
return executable('pyflakes')
endfunction
function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i) function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i)
if match(a:i['text'], 'is assigned to but never used') > -1 if match(a:i['text'], 'is assigned to but never used') > -1
\ || match(a:i['text'], 'imported but unused') > -1 \ || match(a:i['text'], 'imported but unused') > -1

View File

@ -14,10 +14,6 @@ if exists('g:loaded_syntastic_python_pylama_checker')
endif endif
let g:loaded_syntastic_python_pylama_checker = 1 let g:loaded_syntastic_python_pylama_checker = 1
function! SyntaxCheckers_python_pylama_IsAvailable()
return executable('pylama')
endfunction
function! SyntaxCheckers_python_pylama_GetHighlightRegex(i) function! SyntaxCheckers_python_pylama_GetHighlightRegex(i)
return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i) return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i)
endfunction endfunction
@ -59,8 +55,8 @@ function! SyntaxCheckers_python_pylama_GetLocList() dict
return loclist return loclist
endfunction endfunction
runtime! syntax_checkers/python/pyflakes.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'python', \ 'filetype': 'python',
\ 'name': 'pylama' }) \ 'name': 'pylama' })
runtime! syntax_checkers/python/pyflakes.vim

View File

@ -11,8 +11,9 @@ let g:loaded_syntastic_python_pylint_checker = 1
let s:pylint_new = -1 let s:pylint_new = -1
function! SyntaxCheckers_python_pylint_IsAvailable() function! SyntaxCheckers_python_pylint_IsAvailable() dict
let s:pylint_new = executable('pylint') ? s:PylintNew() : -1 let exe = self.getExec()
let s:pylint_new = executable(exe) ? s:PylintNew(exe) : -1
return s:pylint_new >= 0 return s:pylint_new >= 0
endfunction endfunction
@ -48,11 +49,11 @@ function! SyntaxCheckers_python_pylint_GetLocList() dict
return loclist return loclist
endfunction endfunction
function! s:PylintNew() function! s:PylintNew(exe)
try try
" On Windows the version is shown as "pylint-script.py 1.0.0". " On Windows the version is shown as "pylint-script.py 1.0.0".
" On Gentoo Linux it's "pylint-python2.7 0.28.0". Oh, joy. :) " On Gentoo Linux it's "pylint-python2.7 0.28.0". Oh, joy. :)
let pylint_version = filter(split(system('pylint --version'), '\m, \=\|\n'), 'v:val =~# ''\m^pylint\>''')[0] let pylint_version = filter(split(system(a:exe . ' --version'), '\m, \=\|\n'), 'v:val =~# ''\m^pylint\>''')[0]
let pylint_version = substitute(pylint_version, '\v^\S+\s+', '', '') let pylint_version = substitute(pylint_version, '\v^\S+\s+', '', '')
let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1]) let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1])
catch /^Vim\%((\a\+)\)\=:E684/ catch /^Vim\%((\a\+)\)\=:E684/

View File

@ -12,10 +12,6 @@ if exists("g:loaded_syntastic_python_python_checker")
endif endif
let g:loaded_syntastic_python_python_checker=1 let g:loaded_syntastic_python_python_checker=1
function! SyntaxCheckers_python_python_IsAvailable()
return executable('python')
endfunction
function! SyntaxCheckers_python_python_GetLocList() dict function! SyntaxCheckers_python_python_GetLocList() dict
let fname = "'" . escape(expand('%'), "\\'") . "'" let fname = "'" . escape(expand('%'), "\\'") . "'"

View File

@ -18,8 +18,8 @@ if exists("g:loaded_syntastic_rst_rst2pseudoxml_checker")
endif endif
let g:loaded_syntastic_rst_rst2pseudoxml_checker=1 let g:loaded_syntastic_rst_rst2pseudoxml_checker=1
function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable() function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable() dict
return executable("rst2pseudoxml.py") || executable("rst2pseudoxml") return executable(s:exe())
endfunction endfunction
function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() dict function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() dict

View File

@ -14,10 +14,6 @@ if exists("g:loaded_syntastic_ruby_jruby_checker")
endif endif
let g:loaded_syntastic_ruby_jruby_checker=1 let g:loaded_syntastic_ruby_jruby_checker=1
function! SyntaxCheckers_ruby_jruby_IsAvailable()
return executable('jruby')
endfunction
function! SyntaxCheckers_ruby_jruby_GetLocList() dict function! SyntaxCheckers_ruby_jruby_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': s:exe(), \ 'exe': s:exe(),

View File

@ -13,10 +13,6 @@ if exists("g:loaded_syntastic_ruby_macruby_checker")
endif endif
let g:loaded_syntastic_ruby_macruby_checker=1 let g:loaded_syntastic_ruby_macruby_checker=1
function! SyntaxCheckers_ruby_macruby_IsAvailable()
return executable('macruby')
endfunction
function! SyntaxCheckers_ruby_macruby_GetLocList() dict function! SyntaxCheckers_ruby_macruby_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'RUBYOPT= macruby', \ 'exe': 'RUBYOPT= macruby',

View File

@ -19,10 +19,6 @@ if !exists("g:syntastic_ruby_exec")
let g:syntastic_ruby_exec = "ruby" let g:syntastic_ruby_exec = "ruby"
endif endif
function! SyntaxCheckers_ruby_mri_IsAvailable()
return executable(expand(g:syntastic_ruby_exec))
endfunction
function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i) function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
if match(a:i['text'], 'assigned but unused variable') > -1 if match(a:i['text'], 'assigned but unused variable') > -1
let term = split(a:i['text'], ' - ')[1] let term = split(a:i['text'], ' - ')[1]
@ -73,4 +69,5 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby', \ 'filetype': 'ruby',
\ 'name': 'mri'}) \ 'name': 'mri',
\ 'exec': 'ruby'})

View File

@ -18,15 +18,15 @@ if exists("g:loaded_syntastic_ruby_rubocop_checker")
endif endif
let g:loaded_syntastic_ruby_rubocop_checker=1 let g:loaded_syntastic_ruby_rubocop_checker=1
function! SyntaxCheckers_ruby_rubocop_IsAvailable() function! SyntaxCheckers_ruby_rubocop_IsAvailable() dict
let exe = self.getExec()
return return
\ executable('rubocop') && \ executable(exe) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion('rubocop --version'), [0,9,0]) \ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [0,9,0])
endfunction endfunction
function! SyntaxCheckers_ruby_rubocop_GetLocList() dict function! SyntaxCheckers_ruby_rubocop_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'rubocop',
\ 'args': '--format emacs --silent', \ 'args': '--format emacs --silent',
\ 'checker': self }) \ 'checker': self })

View File

@ -16,13 +16,8 @@ endif
let g:loaded_syntastic_ruby_rubylint_checker = 1 let g:loaded_syntastic_ruby_rubylint_checker = 1
function! SyntaxCheckers_ruby_rubylint_IsAvailable()
return executable("ruby-lint")
endfunction
function! SyntaxCheckers_ruby_rubylint_GetLocList() dict function! SyntaxCheckers_ruby_rubylint_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'ruby-lint',
\ 'args': 'analyze --presenter=syntastic', \ 'args': 'analyze --presenter=syntastic',
\ 'checker': self }) \ 'checker': self })
@ -35,6 +30,7 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'ruby', \ 'filetype': 'ruby',
\ 'name': 'rubylint' }) \ 'name': 'rubylint',
\ 'exec': 'ruby-lint'})
" vim: set ts=4 sts=4 sw=4: " vim: set ts=4 sts=4 sw=4:

View File

@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_rust_rustc_checker")
endif endif
let g:loaded_syntastic_rust_rustc_checker=1 let g:loaded_syntastic_rust_rustc_checker=1
function! SyntaxCheckers_rust_rustc_IsAvailable()
return executable("rustc")
endfunction
function! SyntaxCheckers_rust_rustc_GetLocList() dict function! SyntaxCheckers_rust_rustc_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'rustc',
\ 'args': '--parse-only', \ 'args': '--parse-only',
\ 'checker': self }) \ 'checker': self })

View File

@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_sass_sass_checker")
endif endif
let g:loaded_syntastic_sass_sass_checker=1 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 "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
let s:sass_cache_location = tempname() let s:sass_cache_location = tempname()
@ -40,7 +36,6 @@ function! SyntaxCheckers_sass_sass_GetLocList() dict
endif endif
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'sass',
\ 'args': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check', \ 'args': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check',
\ 'checker': self }) \ 'checker': self })

View File

@ -15,10 +15,6 @@ if exists('g:loaded_syntastic_scala_fsc_checker')
endif endif
let g:loaded_syntastic_scala_fsc_checker = 1 let g:loaded_syntastic_scala_fsc_checker = 1
function! SyntaxCheckers_scala_fsc_IsAvailable()
return executable('fsc')
endfunction
if !exists('g:syntastic_scala_options') if !exists('g:syntastic_scala_options')
let g:syntastic_scala_options = '' let g:syntastic_scala_options = ''
endif endif
@ -28,7 +24,6 @@ function! SyntaxCheckers_scala_fsc_GetLocList() dict
" working directory changing after being started " working directory changing after being started
" that's why we better pass an absolute path " that's why we better pass an absolute path
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'fsc',
\ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options, \ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options,
\ 'fname': syntastic#util#shexpand('%:p'), \ 'fname': syntastic#util#shexpand('%:p'),
\ 'checker': self }) \ 'checker': self })

View File

@ -15,18 +15,12 @@ if exists("g:loaded_syntastic_scala_scalac_checker")
endif endif
let g:loaded_syntastic_scala_scalac_checker=1 let g:loaded_syntastic_scala_scalac_checker=1
function! SyntaxCheckers_scala_scalac_IsAvailable()
return executable("scalac")
endfunction
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_scalac_GetLocList() dict function! SyntaxCheckers_scala_scalac_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'scalac',
\ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options, \ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options,
\ 'checker': self }) \ 'checker': self })

View File

@ -11,15 +11,8 @@ if exists("g:loaded_syntastic_sh_checkbashisms_checker")
endif endif
let g:loaded_syntastic_sh_checkbashisms_checker=1 let g:loaded_syntastic_sh_checkbashisms_checker=1
function! SyntaxCheckers_sh_checkbashisms_IsAvailable()
return executable('checkbashisms')
endfunction
function! SyntaxCheckers_sh_checkbashisms_GetLocList() dict function! SyntaxCheckers_sh_checkbashisms_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'checkbashisms',
\ 'args': '-fx', \ 'args': '-fx',
\ 'checker': self}) \ 'checker': self})

View File

@ -51,7 +51,7 @@ function! s:IsShellValid()
endfunction endfunction
function! SyntaxCheckers_sh_sh_IsAvailable() function! SyntaxCheckers_sh_sh_IsAvailable() dict
return s:IsShellValid() return s:IsShellValid()
endfunction endfunction

View File

@ -8,10 +8,6 @@ if exists("g:loaded_syntastic_sh_shellcheck_checker")
endif endif
let g:loaded_syntastic_sh_shellcheck_checker = 1 let g:loaded_syntastic_sh_shellcheck_checker = 1
function! SyntaxCheckers_sh_shellcheck_IsAvailable()
return executable('jsoncheck')
endfunction
function! SyntaxCheckers_sh_shellcheck_Preprocess(json) function! SyntaxCheckers_sh_shellcheck_Preprocess(json)
" A hat tip to Mark Weber for this trick " A hat tip to Mark Weber for this trick
" http://stackoverflow.com/a/19105763 " http://stackoverflow.com/a/19105763
@ -22,7 +18,7 @@ function! SyntaxCheckers_sh_shellcheck_Preprocess(json)
endfunction endfunction
function! SyntaxCheckers_sh_shellcheck_GetLocList() function! SyntaxCheckers_sh_shellcheck_GetLocList()
let makeprg = 'jsoncheck <' . syntastic#util#shexpand('%') let makeprg = expand(self.getExec()) . ' < ' . syntastic#util#shexpand('%')
let errorformat = '%t:%l:%v:%m' let errorformat = '%t:%l:%v:%m'
@ -45,4 +41,5 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'sh', \ 'filetype': 'sh',
\ 'name': 'shellcheck' }) \ 'name': 'shellcheck',
\ 'exec': 'jsoncheck' })

View File

@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_slim_slimrb_checker")
endif endif
let g:loaded_syntastic_slim_slimrb_checker=1 let g:loaded_syntastic_slim_slimrb_checker=1
function! SyntaxCheckers_slim_slimrb_IsAvailable()
return executable("slimrb")
endfunction
function! s:SlimrbVersion() function! s:SlimrbVersion()
if !exists('s:slimrb_version') if !exists('s:slimrb_version')
let s:slimrb_version = syntastic#util#getVersion('slimrb --version 2>' . syntastic#util#DevNull()) let s:slimrb_version = syntastic#util#getVersion('slimrb --version 2>' . syntastic#util#DevNull())
@ -28,7 +24,6 @@ endfunction
function! SyntaxCheckers_slim_slimrb_GetLocList() dict function! SyntaxCheckers_slim_slimrb_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'slimrb',
\ 'args': '-c', \ 'args': '-c',
\ 'checker': self }) \ 'checker': self })

View File

@ -16,13 +16,8 @@ if exists("g:loaded_syntastic_tcl_nagelfar_checker")
endif endif
let g:loaded_syntastic_tcl_nagelfar_checker=1 let g:loaded_syntastic_tcl_nagelfar_checker=1
function! SyntaxCheckers_tcl_nagelfar_IsAvailable()
return executable('nagelfar')
endfunction
function! SyntaxCheckers_tcl_nagelfar_GetLocList() dict function! SyntaxCheckers_tcl_nagelfar_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'nagelfar',
\ 'args': '-H', \ 'args': '-H',
\ 'checker': self }) \ 'checker': self })

View File

@ -32,13 +32,8 @@ if !exists('g:syntastic_tex_chktex_showmsgs')
let g:syntastic_tex_chktex_showmsgs = 1 let g:syntastic_tex_chktex_showmsgs = 1
endif endif
function! SyntaxCheckers_tex_chktex_IsAvailable()
return executable('chktex')
endfunction
function! SyntaxCheckers_tex_chktex_GetLocList() dict function! SyntaxCheckers_tex_chktex_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({
\ 'exe': 'chktex',
\ 'post_args': '-q -v1', \ 'post_args': '-q -v1',
\ 'checker': self }) \ 'checker': self })

View File

@ -15,14 +15,8 @@ if exists('g:loaded_syntastic_tex_lacheck_checker')
endif endif
let g:loaded_syntastic_tex_lacheck_checker=1 let g:loaded_syntastic_tex_lacheck_checker=1
function! SyntaxCheckers_tex_lacheck_IsAvailable()
return executable('lacheck')
endfunction
function! SyntaxCheckers_tex_lacheck_GetLocList() dict function! SyntaxCheckers_tex_lacheck_GetLocList() dict
let makeprg = syntastic#makeprg#build({ let makeprg = syntastic#makeprg#build({ 'checker': self })
\ 'exe': 'lacheck',
\ 'checker': self })
let errorformat = let errorformat =
\ '%-G** %f:,' . \ '%-G** %f:,' .

Some files were not shown because too many files have changed in this diff Show More