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:
parent
28bce98a68
commit
3694908d05
@ -67,7 +67,7 @@ function! syntastic#c#GetLocList(filetype, subchecker, options)
|
||||
return []
|
||||
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'])
|
||||
|
||||
|
@ -449,14 +449,13 @@ Checkers that use 'syntastic#makeprg#build()' look like this: >
|
||||
\ 'args': '-a -b -c',
|
||||
\ 'post_args': '--more --args',
|
||||
\ 'tail': '> /tmp/output',
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'subchecker': 'mri' })
|
||||
\ 'checker': self })
|
||||
<
|
||||
|
||||
The 'filetype' and 'subchecker' parameters are mandatory. All of the other
|
||||
parameters above are optional (well, you probably need at least 'exe'), and
|
||||
can be overriden by setting global variables - even parameters not specified
|
||||
in the call to syntastic#makeprg#build().
|
||||
The 'checker' argument is mandatory. All other arguments above are optional,
|
||||
and can be overriden by setting global variables - even parameters not
|
||||
specified in the call to syntastic#makeprg#build(). If 'exe' is the same as
|
||||
the name of the checker, it may be omitted.
|
||||
|
||||
E.g. To override the checker exe above, you could do this: >
|
||||
let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb"
|
||||
|
@ -12,6 +12,7 @@ function! g:SyntasticChecker.New(args)
|
||||
|
||||
let newObj._filetype = a:args['filetype']
|
||||
let newObj._name = a:args['name']
|
||||
let newObj._exec = get(a:args, 'exec', newObj._name)
|
||||
|
||||
if has_key(a:args, 'redirect')
|
||||
let [filetype, name] = split(a:args['redirect'], '/')
|
||||
@ -21,7 +22,12 @@ function! g:SyntasticChecker.New(args)
|
||||
endif
|
||||
|
||||
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')
|
||||
let newObj._highlightRegexFunc = function(prefix. 'GetHighlightRegex')
|
||||
@ -40,6 +46,14 @@ function! g:SyntasticChecker.getName()
|
||||
return self._name
|
||||
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()
|
||||
try
|
||||
let list = self._locListFunc()
|
||||
@ -85,4 +99,9 @@ function! g:SyntasticChecker._populateHighlightRegexes(list)
|
||||
return list
|
||||
endfunction
|
||||
|
||||
" Non-method functions
|
||||
function! SyntasticCheckerIsAvailableDefault() dict
|
||||
return executable(self.getExec())
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
@ -9,7 +9,7 @@ let g:SyntasticMakeprgBuilder = {}
|
||||
|
||||
function! g:SyntasticMakeprgBuilder.New(checker, exe, args, fname, post_args, tail)
|
||||
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._fname = a:fname
|
||||
let newObj._post_args = a:post_args
|
||||
|
@ -16,8 +16,8 @@ if !exists('g:syntastic_ada_compiler')
|
||||
let g:syntastic_ada_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ada_gcc_IsAvailable()
|
||||
return executable(g:syntastic_ada_compiler)
|
||||
function! SyntaxCheckers_ada_gcc_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_ada_compiler))
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -30,13 +30,8 @@ if exists("g:loaded_syntastic_applescript_osacompile_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_applescript_osacompile_checker=1
|
||||
|
||||
function! SyntaxCheckers_applescript_osacompile_IsAvailable()
|
||||
return executable('osacompile')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_applescript_osacompile_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'osacompile',
|
||||
\ 'args': '-o ' . tempname() . '.scpt ',
|
||||
\ 'checker': self })
|
||||
let errorformat = '%f:%l:%m'
|
||||
|
@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_asciidoc_asciidoc_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_asciidoc_asciidoc_checker = 1
|
||||
|
||||
function! SyntaxCheckers_asciidoc_asciidoc_IsAvailable()
|
||||
return executable("asciidoc")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_asciidoc_asciidoc_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'asciidoc',
|
||||
\ 'args': syntastic#c#NullOutput(),
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -20,11 +20,10 @@ elseif executable("./scripts/checkpatch.pl")
|
||||
let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_checkpatch_IsAvailable()
|
||||
function! SyntaxCheckers_c_checkpatch_IsAvailable() dict
|
||||
return exists("g:syntastic_c_checker_checkpatch_location")
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_c_checkpatch_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': g:syntastic_c_checker_checkpatch_location,
|
||||
@ -44,4 +43,5 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'c',
|
||||
\ 'name': 'checkpatch'})
|
||||
\ 'name': 'checkpatch',
|
||||
\ 'exec': 'checkpatch.pl'})
|
||||
|
@ -20,8 +20,8 @@ if !exists('g:syntastic_c_compiler')
|
||||
let g:syntastic_c_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_gcc_IsAvailable()
|
||||
return executable(g:syntastic_c_compiler)
|
||||
function! SyntaxCheckers_c_gcc_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_c_compiler))
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -15,16 +15,11 @@ if exists('g:loaded_syntastic_c_make_checker')
|
||||
endif
|
||||
let g:loaded_syntastic_c_make_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_make_IsAvailable()
|
||||
return executable('make')
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_c_make_GetLocList() dict
|
||||
|
||||
let makeprg = 'make -sk'
|
||||
let makeprg = expand(self.getExec()) . ' -sk'
|
||||
|
||||
let errorformat =
|
||||
\ '%-G%f:%s:,' .
|
||||
|
@ -21,17 +21,12 @@ if exists("g:loaded_syntastic_c_oclint_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_c_oclint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_oclint_IsAvailable()
|
||||
return executable("oclint")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_oclint_config_file')
|
||||
let g:syntastic_oclint_config_file = '.syntastic_oclint_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_oclint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'oclint',
|
||||
\ 'args': '-text',
|
||||
\ 'post_args': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file),
|
||||
\ 'checker': self })
|
||||
|
@ -21,17 +21,12 @@ if exists("g:loaded_syntastic_c_sparse_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_c_sparse_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_sparse_IsAvailable()
|
||||
return executable("sparse")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_sparse_config_file')
|
||||
let g:syntastic_sparse_config_file = '.syntastic_sparse_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_sparse_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'sparse',
|
||||
\ 'args': '-ftabstop=' . &ts . ' ' . syntastic#c#ReadConfig(g:syntastic_sparse_config_file),
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -21,17 +21,12 @@ if exists("g:loaded_syntastic_c_splint_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_c_splint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_splint_IsAvailable()
|
||||
return executable("splint")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_splint_config_file')
|
||||
let g:syntastic_splint_config_file = '.syntastic_splint_config'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_c_splint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'splint',
|
||||
\ 'post_args': '-showfunc -hints +quiet ' . syntastic#c#ReadConfig(g:syntastic_splint_config_file),
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -15,7 +15,7 @@ if exists("g:loaded_syntastic_c_ycm_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_c_ycm_checker = 1
|
||||
|
||||
function! SyntaxCheckers_c_ycm_IsAvailable()
|
||||
function! SyntaxCheckers_c_ycm_IsAvailable() dict
|
||||
return exists('g:loaded_youcompleteme')
|
||||
endfunction
|
||||
|
||||
|
@ -15,14 +15,8 @@ if exists("g:loaded_syntastic_chef_foodcritic_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_chef_foodcritic_checker=1
|
||||
|
||||
function! SyntaxCheckers_chef_foodcritic_IsAvailable()
|
||||
return executable('foodcritic')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_chef_foodcritic_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'foodcritic',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
" FC023: Prefer conditional attributes: ./recipes/config.rb:49
|
||||
let errorformat = 'FC%n: %m: %f:%l'
|
||||
|
@ -19,13 +19,8 @@ if !executable("coco")
|
||||
finish
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_co_coco_IsAvailable()
|
||||
return executable('coco')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_co_coco_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coco',
|
||||
\ 'args': '-c -o /tmp',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -20,8 +20,8 @@ if !exists('g:syntastic_cobol_compiler')
|
||||
let g:syntastic_cobol_compiler = 'cobc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cobol_cobc_IsAvailable()
|
||||
return executable(g:syntastic_cobol_compiler)
|
||||
function! SyntaxCheckers_cobol_cobc_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_cobol_compiler))
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -17,14 +17,14 @@ if exists("g:loaded_syntastic_coffee_coffee_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_coffee_coffee_checker=1
|
||||
|
||||
function! SyntaxCheckers_coffee_coffee_IsAvailable()
|
||||
return executable("coffee") &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion('coffee --version 2>' . syntastic#util#DevNull()), [1,6,2])
|
||||
function! SyntaxCheckers_coffee_coffee_IsAvailable() dict
|
||||
let exe = self.getExec()
|
||||
return executable(exe) &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version 2>' . syntastic#util#DevNull()), [1,6,2])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coffee_coffee_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coffee',
|
||||
\ 'args': '-cp',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_coffee_coffeelint_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_coffee_coffeelint_checker=1
|
||||
|
||||
function! SyntaxCheckers_coffee_coffeelint_IsAvailable()
|
||||
return executable('coffeelint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coffeelint',
|
||||
\ 'args': '--csv',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_coq_coqtop_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_coq_coqtop_checker=1
|
||||
|
||||
function! SyntaxCheckers_coq_coqtop_IsAvailable()
|
||||
return executable('coqtop')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_coq_coqtop_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'coqtop',
|
||||
\ 'args': '-noglob -batch -load-vernac-source',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -35,14 +35,8 @@ if ! exists('g:syntastic_cpp_cpplint_args')
|
||||
let g:syntastic_cpp_cpplint_args = '--verbose=3'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_cpplint_IsAvailable()
|
||||
return executable('cpplint.py')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cpp_cpplint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'cpplint.py',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
let errorformat = '%A%f:%l: %m [%t],%-G%.%#'
|
||||
|
||||
@ -61,4 +55,5 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'cpp',
|
||||
\ 'name': 'cpplint'})
|
||||
\ 'name': 'cpplint',
|
||||
\ 'exec': 'cpplint.py'})
|
||||
|
@ -19,8 +19,8 @@ if !exists('g:syntastic_cpp_compiler')
|
||||
let g:syntastic_cpp_compiler = 'g++'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_cpp_gcc_IsAvailable()
|
||||
return executable(g:syntastic_cpp_compiler)
|
||||
function! SyntaxCheckers_cpp_gcc_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_cpp_compiler))
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_cs_mcs_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_cs_mcs_checker=1
|
||||
|
||||
function! SyntaxCheckers_cs_mcs_IsAvailable()
|
||||
return executable('mcs')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cs_mcs_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'mcs',
|
||||
\ 'args': '--parse',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -19,21 +19,12 @@ if exists('g:loaded_syntastic_css_csslint_checker')
|
||||
endif
|
||||
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')
|
||||
let g:syntastic_csslint_options = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_css_csslint_IsAvailable()
|
||||
return executable(expand(g:syntastic_csslint_exec))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_css_csslint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': expand(g:syntastic_csslint_exec),
|
||||
\ 'args': '--format=compact ' . g:syntastic_csslint_options,
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -20,10 +20,6 @@ if exists("g:loaded_syntastic_css_prettycss_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_css_prettycss_checker=1
|
||||
|
||||
function! SyntaxCheckers_css_prettycss_IsAvailable()
|
||||
return executable('prettycss')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item["text"], '\m (\zs[^)]\+\ze)$')
|
||||
if term != ''
|
||||
@ -33,9 +29,7 @@ function! SyntaxCheckers_css_prettycss_GetHighlightRegex(item)
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_css_prettycss_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'prettycss',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
" Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
|
||||
let errorformat =
|
||||
|
@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_cucumber_cucumber_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_cucumber_cucumber_checker=1
|
||||
|
||||
function! SyntaxCheckers_cucumber_cucumber_IsAvailable()
|
||||
return executable('cucumber')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cucumber_cucumber_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'cucumber',
|
||||
\ 'args': '--dry-run --quiet --strict --format pretty',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -24,10 +24,6 @@ if exists("g:loaded_syntastic_cuda_nvcc_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_cuda_nvcc_checker=1
|
||||
|
||||
function! SyntaxCheckers_cuda_nvcc_IsAvailable()
|
||||
return executable('nvcc')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_cuda_nvcc_GetLocList() dict
|
||||
if exists('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 = ''
|
||||
endif
|
||||
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()
|
||||
|
||||
let errorformat =
|
||||
\ '%*[^"]"%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')
|
||||
let makeprg =
|
||||
\ '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()
|
||||
else
|
||||
return []
|
||||
|
@ -24,8 +24,8 @@ if !exists('g:syntastic_d_compiler')
|
||||
let g:syntastic_d_compiler = 'dmd'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_d_dmd_IsAvailable()
|
||||
return executable(g:syntastic_d_compiler)
|
||||
function! SyntaxCheckers_d_dmd_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_d_compiler))
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -17,10 +17,6 @@ if !exists("g:syntastic_dart_analyzer_conf")
|
||||
let g:syntastic_dart_analyzer_conf = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_dart_dart_analyzer_IsAvailable()
|
||||
return executable("dart_analyzer")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_dart_dart_analyzer_GetHighlightRegex(error)
|
||||
let lcol = a:error['col'] - 1
|
||||
let rcol = a:error['nr'] + lcol + 1
|
||||
@ -29,11 +25,9 @@ function! SyntaxCheckers_dart_dart_analyzer_GetHighlightRegex(error)
|
||||
endfunction
|
||||
|
||||
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({
|
||||
\ 'exe': 'dart_analyzer',
|
||||
\ 'args': '--error_format machine',
|
||||
\ 'post_args': args,
|
||||
\ 'post_args': g:syntastic_dart_analyzer_conf,
|
||||
\ 'checker': self })
|
||||
|
||||
" Machine readable format looks like:
|
||||
|
@ -15,14 +15,12 @@ endif
|
||||
|
||||
let g:loaded_syntastic_dustjs_swiffer_checker = 1
|
||||
|
||||
function! SyntaxCheckers_dustjs_swiffer_IsAvailable()
|
||||
function! SyntaxCheckers_dustjs_swiffer_IsAvailable() dict
|
||||
return executable('swiffer')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_dustjs_swiffer_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'swiffer',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
let errorformat = '%E%f - Line %l\, Column %c: %m'
|
||||
|
||||
|
@ -15,7 +15,7 @@ endif
|
||||
let g:loaded_syntastic_elixir_elixir_checker=1
|
||||
|
||||
" 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')
|
||||
endfunction
|
||||
|
||||
|
@ -21,10 +21,6 @@ endif
|
||||
|
||||
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
|
||||
if expand('%:e') ==# 'hrl'
|
||||
return []
|
||||
@ -39,7 +35,6 @@ function! SyntaxCheckers_erlang_escript_GetLocList() dict
|
||||
let post_args = g:syntastic_erlc_include_path
|
||||
endif
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'escript',
|
||||
\ 'args': args,
|
||||
\ 'fname': syntastic#util#shexpand('%:p'),
|
||||
\ 'post_args': post_args,
|
||||
|
@ -19,7 +19,7 @@ if !exists("g:syntastic_ruby_exec")
|
||||
let g:syntastic_ruby_exec = "ruby"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_eruby_ruby_IsAvailable()
|
||||
function! SyntaxCheckers_eruby_ruby_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_ruby_exec))
|
||||
endfunction
|
||||
|
||||
|
@ -19,8 +19,8 @@ if !exists('g:syntastic_fortran_compiler')
|
||||
let g:syntastic_fortran_compiler = 'gfortran'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_fortran_gfortran_IsAvailable()
|
||||
return executable(g:syntastic_fortran_compiler)
|
||||
function! SyntaxCheckers_fortran_gfortran_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_fortran_compiler))
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -17,8 +17,8 @@ if exists("g:loaded_syntastic_go_go_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_go_go_checker=1
|
||||
|
||||
function! SyntaxCheckers_go_go_IsAvailable()
|
||||
return executable('go')
|
||||
function! SyntaxCheckers_go_go_IsAvailable() dict
|
||||
return executable('go') && executable('gofmt')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_go_GetLocList() dict
|
||||
|
@ -17,13 +17,8 @@ if exists("g:loaded_syntastic_go_gofmt_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_go_gofmt_checker=1
|
||||
|
||||
function! SyntaxCheckers_go_gofmt_IsAvailable()
|
||||
return executable('gofmt')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_gofmt_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'gofmt',
|
||||
\ 'args': '-l',
|
||||
\ 'tail': '1>' . syntastic#util#DevNull(),
|
||||
\ 'checker': self })
|
||||
|
@ -14,14 +14,8 @@ if exists("g:loaded_syntastic_go_golint_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_go_golint_checker=1
|
||||
|
||||
function! SyntaxCheckers_go_golint_IsAvailable()
|
||||
return executable('golint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_go_golint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'golint',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
let errorformat = '%f:%l:%c: %m,%-G%.%#'
|
||||
|
||||
|
@ -14,7 +14,7 @@ if exists("g:loaded_syntastic_go_govet_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_go_govet_checker=1
|
||||
|
||||
function! SyntaxCheckers_go_govet_IsAvailable()
|
||||
function! SyntaxCheckers_go_govet_IsAvailable() dict
|
||||
return executable('go')
|
||||
endfunction
|
||||
|
||||
|
@ -19,7 +19,7 @@ if !exists('g:syntastic_haml_interpreter')
|
||||
let g:syntastic_haml_interpreter = 'haml'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_haml_haml_IsAvailable()
|
||||
function! SyntaxCheckers_haml_haml_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_haml_interpreter))
|
||||
endfunction
|
||||
|
||||
|
@ -13,13 +13,8 @@ if exists("g:loaded_syntastic_handlebars_handlebars_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_handlebars_handlebars_checker=1
|
||||
|
||||
function! SyntaxCheckers_handlebars_handlebars_IsAvailable()
|
||||
return executable('handlebars')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_handlebars_handlebars_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'handlebars',
|
||||
\ 'args': '-f ' . syntastic#util#DevNull(),
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -15,13 +15,9 @@ if exists('g:loaded_syntastic_haskell_ghc_mod_checker')
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_ghc_mod_checker = 1
|
||||
|
||||
function! SyntaxCheckers_haskell_ghc_mod_IsAvailable()
|
||||
return executable('ghc-mod')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'ghc-mod check',
|
||||
\ 'exe': self.getExec() . ' check',
|
||||
\ 'checker': self })
|
||||
|
||||
let errorformat =
|
||||
@ -42,4 +38,5 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'haskell',
|
||||
\ 'name': 'ghc_mod'})
|
||||
\ 'name': 'ghc_mod',
|
||||
\ 'exec': 'ghc-mod'})
|
||||
|
@ -15,13 +15,9 @@ if exists("g:loaded_syntastic_haskell_hdevtools_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_hdevtools_checker=1
|
||||
|
||||
function! SyntaxCheckers_haskell_hdevtools_IsAvailable()
|
||||
return executable('hdevtools')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'hdevtools check',
|
||||
\ 'exe': self.getExec() . ' check',
|
||||
\ 'args': get(g:, 'hdevtools_options', ''),
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -10,14 +10,8 @@ if exists('g:loaded_syntastic_haskell_hlint_checker')
|
||||
endif
|
||||
let g:loaded_syntastic_haskell_hlint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_haskell_hlint_IsAvailable()
|
||||
return executable('hlint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haskell_hlint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'hlint',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:%l:%c: Error: %m,' .
|
||||
|
@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_haxe_haxe_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_haxe_haxe_checker=1
|
||||
|
||||
function! SyntaxCheckers_haxe_haxe_IsAvailable()
|
||||
return executable('haxe')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_haxe_haxe_GetLocList() dict
|
||||
if exists('b:vaxe_hxml')
|
||||
let hxml = b:vaxe_hxml
|
||||
@ -31,7 +27,6 @@ function! SyntaxCheckers_haxe_haxe_GetLocList() dict
|
||||
|
||||
if !empty(hxml)
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'haxe',
|
||||
\ 'fname': syntastic#util#shescape(fnameescape(fnamemodify(hxml, ':t'))),
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_hss_hss_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_hss_hss_checker=1
|
||||
|
||||
function! SyntaxCheckers_hss_hss_IsAvailable()
|
||||
return executable('hss')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_hss_hss_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'hss',
|
||||
\ 'args' : '-output ' . syntastic#util#DevNull(),
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -42,10 +42,6 @@ if !exists('g:syntastic_html_tidy_empty_tags')
|
||||
let g:syntastic_html_tidy_empty_tags = []
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_html_tidy_IsAvailable()
|
||||
return executable('tidy')
|
||||
endfunction
|
||||
|
||||
" TODO: join this with xhtml.vim for DRY's sake?
|
||||
function! s:TidyEncOptByFenc()
|
||||
let tidy_opts = {
|
||||
@ -141,7 +137,6 @@ endfunction
|
||||
|
||||
function! SyntaxCheckers_html_tidy_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'tidy',
|
||||
\ 'args': s:Args(),
|
||||
\ 'tail': '2>&1',
|
||||
\ 'checker': self })
|
||||
|
@ -45,7 +45,7 @@ if !exists('g:syntastic_html_validator_nsfilter')
|
||||
let g:syntastic_html_validator_nsfilter = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_html_validator_IsAvailable()
|
||||
function! SyntaxCheckers_html_validator_IsAvailable() dict
|
||||
return executable('curl')
|
||||
endfunction
|
||||
|
||||
|
@ -26,7 +26,7 @@ if !exists('g:syntastic_html_w3_api')
|
||||
let g:syntastic_html_w3_api = 'http://validator.w3.org/check'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_html_w3_IsAvailable()
|
||||
function! SyntaxCheckers_html_w3_IsAvailable() dict
|
||||
return executable('curl')
|
||||
endfunction
|
||||
|
||||
|
@ -23,10 +23,6 @@ if !exists("g:syntastic_java_checkstyle_conf_file")
|
||||
let g:syntastic_java_checkstyle_conf_file = 'sun_checks.xml'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_java_checkstyle_IsAvailable()
|
||||
return executable('java')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_java_checkstyle_Preprocess(errors)
|
||||
let out = copy(a:errors)
|
||||
for n in range(len(out))
|
||||
@ -48,7 +44,6 @@ function! SyntaxCheckers_java_checkstyle_GetLocList() dict
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'java',
|
||||
\ 'args': '-cp ' . g:syntastic_java_checkstyle_classpath .
|
||||
\ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file .
|
||||
\ ' -f xml',
|
||||
@ -75,4 +70,5 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'java',
|
||||
\ 'name': 'checkstyle'})
|
||||
\ 'name': 'checkstyle',
|
||||
\ 'exec': 'java'})
|
||||
|
@ -161,7 +161,7 @@ function! s:GetMavenProperties()
|
||||
let pom = findfile("pom.xml", ".;")
|
||||
if s:has_maven && filereadable(pom)
|
||||
if !has_key(g:syntastic_java_javac_maven_pom_properties, pom)
|
||||
let mvn_cmd = g:syntastic_java_maven_executable . ' -f ' . pom
|
||||
let mvn_cmd = expand(g:syntastic_java_maven_executable) . ' -f ' . pom
|
||||
let mvn_is_managed_tag = 1
|
||||
let mvn_settings_output = split(system(mvn_cmd . ' help:effective-pom'), "\n")
|
||||
let current_path = 'project'
|
||||
@ -196,7 +196,7 @@ function! s:GetMavenClasspath()
|
||||
let pom = findfile("pom.xml", ".;")
|
||||
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)
|
||||
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 = ''
|
||||
let class_path_next = 0
|
||||
@ -233,9 +233,9 @@ function! s:GetMavenClasspath()
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_java_javac_IsAvailable()
|
||||
let s:has_maven = executable(g:syntastic_java_maven_executable)
|
||||
return executable(g:syntastic_java_javac_executable)
|
||||
function! SyntaxCheckers_java_javac_IsAvailable() dict
|
||||
let s:has_maven = executable(expand(g:syntastic_java_maven_executable))
|
||||
return executable(expand(g:syntastic_java_javac_executable))
|
||||
endfunction
|
||||
|
||||
function! s:MavenOutputDirectory()
|
||||
@ -331,7 +331,6 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': g:syntastic_java_javac_executable,
|
||||
\ 'args': javac_opts,
|
||||
\ 'fname': fname,
|
||||
\ 'tail': '2>&1',
|
||||
|
@ -30,8 +30,8 @@ if !exists("g:syntastic_javascript_closure_compiler_options")
|
||||
let g:syntastic_javascript_closure_compiler_options = ""
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_closurecompiler_IsAvailable()
|
||||
return exists("g:syntastic_javascript_closure_compiler_path")
|
||||
function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() dict
|
||||
return executable("java") && exists("g:syntastic_javascript_closure_compiler_path")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_closurecompiler_GetLocList() dict
|
||||
@ -61,5 +61,6 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'javascript',
|
||||
\ 'name': 'closurecompiler'})
|
||||
\ 'name': 'closurecompiler',
|
||||
\ 'exec': 'java'})
|
||||
|
||||
|
@ -17,13 +17,8 @@ if !exists("g:syntastic_javascript_gjslint_conf")
|
||||
let g:syntastic_javascript_gjslint_conf = ""
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_gjslint_IsAvailable()
|
||||
return executable('gjslint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_gjslint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'gjslint',
|
||||
\ 'args': g:syntastic_javascript_gjslint_conf . " --nosummary --unix_mode --nodebug_indentation --nobeep",
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -22,7 +22,7 @@ if !exists('g:syntastic_javascript_jshint_conf')
|
||||
let g:syntastic_javascript_jshint_conf = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_jshint_IsAvailable()
|
||||
function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_jshint_exec))
|
||||
endfunction
|
||||
|
||||
|
@ -17,22 +17,10 @@ if !exists("g:syntastic_javascript_jsl_conf")
|
||||
let g:syntastic_javascript_jsl_conf = ""
|
||||
endif
|
||||
|
||||
function! s:ConfFlag()
|
||||
if !empty(g:syntastic_javascript_jsl_conf)
|
||||
return "-conf " . g:syntastic_javascript_jsl_conf
|
||||
endif
|
||||
|
||||
return ""
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jsl_IsAvailable()
|
||||
return executable('jsl')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jsl_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jsl',
|
||||
\ 'args': s:ConfFlag() . " -nologo -nofilelisting -nosummary -nocontext -process",
|
||||
\ 'args': (!empty(g:syntastic_javascript_jsl_conf) ? "-conf " . g:syntastic_javascript_jsl_conf : "") .
|
||||
\ " -nologo -nofilelisting -nosummary -nocontext -process",
|
||||
\ 'checker': self })
|
||||
|
||||
let errorformat =
|
||||
|
@ -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"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_javascript_jslint_IsAvailable()
|
||||
return executable('jslint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jslint_HighlightTerm(error)
|
||||
let unexpected = matchstr(a:error['text'], '\mExpected.*and instead saw \'\zs.*\ze\'')
|
||||
if len(unexpected) < 1i
|
||||
@ -33,7 +29,6 @@ endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jslint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jslint',
|
||||
\ 'args': g:syntastic_javascript_jslint_conf,
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_json_jsonlint_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_json_jsonlint_checker=1
|
||||
|
||||
function! SyntaxCheckers_json_jsonlint_IsAvailable()
|
||||
return executable('jsonlint')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_json_jsonlint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jsonlint',
|
||||
\ 'post_args': '--compact',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -14,15 +14,9 @@ if exists("g:loaded_syntastic_json_jsonval_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_json_jsonval_checker=1
|
||||
|
||||
function! SyntaxCheckers_json_jsonval_IsAvailable()
|
||||
return executable('jsonval')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_json_jsonval_GetLocList() dict
|
||||
" based on https://gist.github.com/1196345
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'jsonval',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
let errorformat =
|
||||
\ '%E%f:\ %m\ at\ line\ %l,' .
|
||||
|
@ -36,8 +36,8 @@ else
|
||||
let s:check_file = 'lessc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_less_lessc_IsAvailable()
|
||||
return executable('lessc')
|
||||
function! SyntaxCheckers_less_lessc_IsAvailable() dict
|
||||
return g:syntastic_less_use_less_lint ? executable('node') : executable('lessc')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_less_lessc_GetLocList() dict
|
||||
|
@ -14,15 +14,10 @@ if exists("g:loaded_syntastic_lisp_clisp_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_lisp_clisp_checker=1
|
||||
|
||||
function! SyntaxCheckers_lisp_clisp_IsAvailable()
|
||||
return executable("clisp")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_lisp_clisp_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'clisp',
|
||||
\ 'args': '-q -c',
|
||||
\ 'tail': '-o /tmp/clisp-vim-compiled-file',
|
||||
\ 'tail': syntastic#c#NullOutput(),
|
||||
\ 'checker': self })
|
||||
|
||||
let errorformat =
|
||||
|
@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_llvm_llvm_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_llvm_llvm_checker=1
|
||||
|
||||
function! SyntaxCheckers_llvm_llvm_IsAvailable()
|
||||
return executable("llc")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_llvm_llvm_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'llc',
|
||||
\ 'args': syntastic#c#NullOutput(),
|
||||
\ 'checker': self })
|
||||
|
||||
@ -33,5 +28,6 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'llvm',
|
||||
\ 'name': 'llvm'})
|
||||
\ 'name': 'llvm',
|
||||
\ 'exec': 'llc'})
|
||||
|
||||
|
@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_lua_luac_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_lua_luac_checker=1
|
||||
|
||||
function! SyntaxCheckers_lua_luac_IsAvailable()
|
||||
return executable('luac')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
|
||||
let near = matchstr(a:pos['text'], "\\mnear '[^']\\+'")
|
||||
let result = ''
|
||||
@ -42,10 +38,8 @@ function! SyntaxCheckers_lua_luac_GetHighlightRegex(pos)
|
||||
return result
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_lua_luac_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'luac',
|
||||
\ 'args': '-p',
|
||||
\ 'checker': self })
|
||||
|
||||
@ -55,7 +49,6 @@ function! SyntaxCheckers_lua_luac_GetLocList() dict
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat,
|
||||
\ 'defaults': { 'bufnr': bufnr(''), 'type': 'E' } })
|
||||
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_matlab_mlint_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_matlab_mlint_checker=1
|
||||
|
||||
function! SyntaxCheckers_matlab_mlint_IsAvailable()
|
||||
return executable("mlint")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_matlab_mlint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'mlint',
|
||||
\ 'args': '-id $*',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -14,15 +14,12 @@ if exists("g:loaded_syntastic_nasm_nasm_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_nasm_nasm_checker=1
|
||||
|
||||
function! SyntaxCheckers_nasm_nasm_IsAvailable()
|
||||
return executable("nasm")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_nasm_nasm_GetLocList() dict
|
||||
let wd = syntastic#util#shescape(expand("%:p:h") . "/")
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'nasm',
|
||||
\ 'args': '-X gnu -f elf -I ' . wd . ' ' . syntastic#c#NullOutput(),
|
||||
\ 'args': '-X gnu -f elf' .
|
||||
\ ' -I ' . syntastic#util#shescape(expand("%:p:h") . "/") .
|
||||
\ ' ' . syntastic#c#NullOutput(),
|
||||
\ 'checker': self })
|
||||
|
||||
let errorformat = '%f:%l: %t%*[^:]: %m'
|
||||
|
@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_nroff_mandoc_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_nroff_mandoc_checker=1
|
||||
|
||||
function! SyntaxCheckers_nroff_mandoc_IsAvailable()
|
||||
return executable("mandoc")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_nroff_mandoc_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'mandoc',
|
||||
\ 'args': '-Tlint',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -19,8 +19,8 @@ if !exists('g:syntastic_objc_compiler')
|
||||
let g:syntastic_objc_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_objc_gcc_IsAvailable()
|
||||
return executable(g:syntastic_objc_compiler)
|
||||
function! SyntaxCheckers_objc_gcc_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_objc_compiler))
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -19,8 +19,8 @@ if !exists('g:syntastic_objcpp_compiler')
|
||||
let g:syntastic_objcpp_compiler = 'gcc'
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_objcpp_gcc_IsAvailable()
|
||||
return executable(g:syntastic_objcpp_compiler)
|
||||
function! SyntaxCheckers_objcpp_gcc_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_objcpp_compiler))
|
||||
endfunction
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
|
@ -53,14 +53,13 @@ if exists("g:loaded_syntastic_ocaml_camlp4o_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_ocaml_camlp4o_checker=1
|
||||
|
||||
if exists('g:syntastic_ocaml_camlp4r') &&
|
||||
\ g:syntastic_ocaml_camlp4r != 0
|
||||
if exists('g:syntastic_ocaml_camlp4r') && g:syntastic_ocaml_camlp4r != 0
|
||||
let s:ocamlpp="camlp4r"
|
||||
else
|
||||
let s:ocamlpp="camlp4o"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ocaml_camlp4o_IsAvailable()
|
||||
function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() dict
|
||||
return executable(s:ocamlpp)
|
||||
endfunction
|
||||
|
||||
|
@ -34,8 +34,8 @@ if !exists('g:syntastic_perl_lib_path')
|
||||
let g:syntastic_perl_lib_path = []
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_perl_perl_IsAvailable()
|
||||
return executable(g:syntastic_perl_interpreter)
|
||||
function! SyntaxCheckers_perl_perl_IsAvailable() dict
|
||||
return executable(expand(g:syntastic_perl_interpreter))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_perl_perl_Preprocess(errors)
|
||||
@ -52,6 +52,7 @@ function! SyntaxCheckers_perl_perl_Preprocess(errors)
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_perl_perl_GetLocList() dict
|
||||
let exe = expand(g:syntastic_perl_interpreter)
|
||||
if type(g:syntastic_perl_lib_path) == type('')
|
||||
call syntastic#util#deprecationWarn('variable g:syntastic_perl_lib_path should be a list')
|
||||
let includes = split(g:syntastic_perl_lib_path, ',')
|
||||
@ -65,7 +66,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict
|
||||
let errorformat = '%f:%l:%m'
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': g:syntastic_perl_interpreter,
|
||||
\ 'exe': exe,
|
||||
\ 'args': '-c -X ' . extra,
|
||||
\ 'checker': self })
|
||||
|
||||
@ -79,7 +80,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': g:syntastic_perl_interpreter,
|
||||
\ 'exe': exe,
|
||||
\ 'args': '-c -Mwarnings ' . extra,
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -33,13 +33,8 @@ if !exists('g:syntastic_perl_perlcritic_thres')
|
||||
let g:syntastic_perl_perlcritic_thres = 5
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_perl_perlcritic_IsAvailable()
|
||||
return executable('perlcritic')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_perl_perlcritic_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'perlcritic',
|
||||
\ 'post_args': '--quiet --nocolor --verbose "\%s:\%f:\%l:\%c:(\%s) \%m (\%e)\n"',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_php_php_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_php_php_checker=1
|
||||
|
||||
function! SyntaxCheckers_php_php_IsAvailable()
|
||||
return executable("php")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_php_GetHighlightRegex(item)
|
||||
let unexpected = matchstr(a:item['text'], "\\munexpected '[^']\\+'")
|
||||
if len(unexpected) < 1
|
||||
@ -29,7 +25,6 @@ endfunction
|
||||
|
||||
function! SyntaxCheckers_php_php_GetLocList() dict
|
||||
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',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -18,13 +18,8 @@ if exists("g:loaded_syntastic_php_phpcs_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_php_phpcs_checker=1
|
||||
|
||||
function! SyntaxCheckers_php_phpcs_IsAvailable()
|
||||
return executable('phpcs')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phpcs_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'phpcs',
|
||||
\ 'args': '--report=csv',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -18,10 +18,6 @@ if exists("g:loaded_syntastic_php_phpmd_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_php_phpmd_checker=1
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_IsAvailable()
|
||||
return executable('phpmd')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_GetHighlightRegex(item)
|
||||
let term = matchstr(a:item['text'], '\m\C^The \S\+ \w\+\(()\)\= \(has\|is not\|utilizes\)')
|
||||
if term != ''
|
||||
@ -60,7 +56,6 @@ endfunction
|
||||
|
||||
function! SyntaxCheckers_php_phpmd_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'phpmd',
|
||||
\ 'post_args': 'text codesize,design,unusedcode,naming',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -14,14 +14,8 @@ if exists("g:loaded_syntastic_pod_podchecker_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_pod_podchecker_checker=1
|
||||
|
||||
function! SyntaxCheckers_pod_podchecker_IsAvailable()
|
||||
return executable("podchecker")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_pod_podchecker_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'podchecker',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
let errorformat =
|
||||
\ '%W%[%#]%[%#]%[%#] WARNING: %m at line %l in file %f,' .
|
||||
|
@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_puppet_puppet_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_puppet_puppet_checker=1
|
||||
|
||||
function! SyntaxCheckers_puppet_puppet_IsAvailable()
|
||||
return executable("puppet")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_puppet_puppet_GetLocList() dict
|
||||
|
||||
let ver = syntastic#util#getVersion('puppet --version 2>' . syntastic#util#DevNull())
|
||||
let ver = syntastic#util#getVersion(self.getExec() . ' --version 2>' . syntastic#util#DevNull())
|
||||
|
||||
if syntastic#util#versionIsAtLeast(ver, [2,7,0])
|
||||
let args = 'parser validate --color=false'
|
||||
@ -30,7 +25,6 @@ function! SyntaxCheckers_puppet_puppet_GetLocList() dict
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'puppet',
|
||||
\ 'args': args,
|
||||
\ 'checker': self })
|
||||
|
||||
@ -43,7 +37,6 @@ function! SyntaxCheckers_puppet_puppet_GetLocList() dict
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
|
@ -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")
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_puppet_puppetlint_IsAvailable()
|
||||
function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
|
||||
return
|
||||
\ executable("puppet") &&
|
||||
\ executable("puppet-lint") &&
|
||||
@ -43,4 +43,5 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'puppet',
|
||||
\ 'name': 'puppetlint'})
|
||||
\ 'name': 'puppetlint',
|
||||
\ 'exec': 'puppet-lint'})
|
||||
|
@ -10,10 +10,6 @@ if exists("g:loaded_syntastic_python_flake8_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_python_flake8_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_flake8_IsAvailable()
|
||||
return executable('flake8')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_flake8_GetHighlightRegex(i)
|
||||
return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i)
|
||||
endfunction
|
||||
@ -36,8 +32,8 @@ function! SyntaxCheckers_python_flake8_GetLocList() dict
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
runtime! syntax_checkers/python/pyflakes.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'python',
|
||||
\ 'name': 'flake8'})
|
||||
|
||||
runtime! syntax_checkers/python/pyflakes.vim
|
||||
|
@ -10,10 +10,6 @@ if exists("g:loaded_syntastic_python_pep257_checker")
|
||||
endif
|
||||
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
|
||||
function! SyntaxCheckers_python_pep257_Preprocess(errors)
|
||||
return filter(copy(a:errors), 'v:val != ""')
|
||||
|
@ -17,10 +17,6 @@ if exists("g:loaded_syntastic_python_pep8_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_python_pep8_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_pep8_IsAvailable()
|
||||
return executable('pep8')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pep8_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'pep8',
|
||||
|
@ -9,10 +9,6 @@ if exists("g:loaded_syntastic_python_py3kwarn_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_python_py3kwarn_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_py3kwarn_IsAvailable()
|
||||
return executable('py3kwarn')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_py3kwarn_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'py3kwarn',
|
||||
|
@ -11,10 +11,6 @@ if exists("g:loaded_syntastic_python_pyflakes_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_python_pyflakes_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_pyflakes_IsAvailable()
|
||||
return executable('pyflakes')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i)
|
||||
if match(a:i['text'], 'is assigned to but never used') > -1
|
||||
\ || match(a:i['text'], 'imported but unused') > -1
|
||||
|
@ -14,10 +14,6 @@ if exists('g:loaded_syntastic_python_pylama_checker')
|
||||
endif
|
||||
let g:loaded_syntastic_python_pylama_checker = 1
|
||||
|
||||
function! SyntaxCheckers_python_pylama_IsAvailable()
|
||||
return executable('pylama')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_pylama_GetHighlightRegex(i)
|
||||
return SyntaxCheckers_python_pyflakes_GetHighlightRegex(a:i)
|
||||
endfunction
|
||||
@ -59,8 +55,8 @@ function! SyntaxCheckers_python_pylama_GetLocList() dict
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
runtime! syntax_checkers/python/pyflakes.vim
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'python',
|
||||
\ 'name': 'pylama' })
|
||||
|
||||
runtime! syntax_checkers/python/pyflakes.vim
|
||||
|
@ -11,8 +11,9 @@ let g:loaded_syntastic_python_pylint_checker = 1
|
||||
|
||||
let s:pylint_new = -1
|
||||
|
||||
function! SyntaxCheckers_python_pylint_IsAvailable()
|
||||
let s:pylint_new = executable('pylint') ? s:PylintNew() : -1
|
||||
function! SyntaxCheckers_python_pylint_IsAvailable() dict
|
||||
let exe = self.getExec()
|
||||
let s:pylint_new = executable(exe) ? s:PylintNew(exe) : -1
|
||||
return s:pylint_new >= 0
|
||||
endfunction
|
||||
|
||||
@ -48,11 +49,11 @@ function! SyntaxCheckers_python_pylint_GetLocList() dict
|
||||
return loclist
|
||||
endfunction
|
||||
|
||||
function! s:PylintNew()
|
||||
function! s:PylintNew(exe)
|
||||
try
|
||||
" 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. :)
|
||||
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 ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1])
|
||||
catch /^Vim\%((\a\+)\)\=:E684/
|
||||
|
@ -12,10 +12,6 @@ if exists("g:loaded_syntastic_python_python_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_python_python_checker=1
|
||||
|
||||
function! SyntaxCheckers_python_python_IsAvailable()
|
||||
return executable('python')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_python_GetLocList() dict
|
||||
let fname = "'" . escape(expand('%'), "\\'") . "'"
|
||||
|
||||
|
@ -18,8 +18,8 @@ if exists("g:loaded_syntastic_rst_rst2pseudoxml_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_rst_rst2pseudoxml_checker=1
|
||||
|
||||
function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable()
|
||||
return executable("rst2pseudoxml.py") || executable("rst2pseudoxml")
|
||||
function! SyntaxCheckers_rst_rst2pseudoxml_IsAvailable() dict
|
||||
return executable(s:exe())
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_rst_rst2pseudoxml_GetLocList() dict
|
||||
|
@ -14,10 +14,6 @@ if exists("g:loaded_syntastic_ruby_jruby_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_ruby_jruby_checker=1
|
||||
|
||||
function! SyntaxCheckers_ruby_jruby_IsAvailable()
|
||||
return executable('jruby')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_jruby_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': s:exe(),
|
||||
|
@ -13,10 +13,6 @@ if exists("g:loaded_syntastic_ruby_macruby_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_ruby_macruby_checker=1
|
||||
|
||||
function! SyntaxCheckers_ruby_macruby_IsAvailable()
|
||||
return executable('macruby')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_macruby_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'RUBYOPT= macruby',
|
||||
|
@ -19,10 +19,6 @@ if !exists("g:syntastic_ruby_exec")
|
||||
let g:syntastic_ruby_exec = "ruby"
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_ruby_mri_IsAvailable()
|
||||
return executable(expand(g:syntastic_ruby_exec))
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
|
||||
if match(a:i['text'], 'assigned but unused variable') > -1
|
||||
let term = split(a:i['text'], ' - ')[1]
|
||||
@ -73,4 +69,5 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'name': 'mri'})
|
||||
\ 'name': 'mri',
|
||||
\ 'exec': 'ruby'})
|
||||
|
@ -18,15 +18,15 @@ if exists("g:loaded_syntastic_ruby_rubocop_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_ruby_rubocop_checker=1
|
||||
|
||||
function! SyntaxCheckers_ruby_rubocop_IsAvailable()
|
||||
function! SyntaxCheckers_ruby_rubocop_IsAvailable() dict
|
||||
let exe = self.getExec()
|
||||
return
|
||||
\ executable('rubocop') &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion('rubocop --version'), [0,9,0])
|
||||
\ executable(exe) &&
|
||||
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [0,9,0])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_rubocop_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'rubocop',
|
||||
\ 'args': '--format emacs --silent',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -16,13 +16,8 @@ endif
|
||||
|
||||
let g:loaded_syntastic_ruby_rubylint_checker = 1
|
||||
|
||||
function! SyntaxCheckers_ruby_rubylint_IsAvailable()
|
||||
return executable("ruby-lint")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_rubylint_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'ruby-lint',
|
||||
\ 'args': 'analyze --presenter=syntastic',
|
||||
\ 'checker': self })
|
||||
|
||||
@ -35,6 +30,7 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'ruby',
|
||||
\ 'name': 'rubylint' })
|
||||
\ 'name': 'rubylint',
|
||||
\ 'exec': 'ruby-lint'})
|
||||
|
||||
" vim: set ts=4 sts=4 sw=4:
|
||||
|
@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_rust_rustc_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_rust_rustc_checker=1
|
||||
|
||||
function! SyntaxCheckers_rust_rustc_IsAvailable()
|
||||
return executable("rustc")
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_rust_rustc_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'rustc',
|
||||
\ 'args': '--parse-only',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_sass_sass_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_sass_sass_checker=1
|
||||
|
||||
function! SyntaxCheckers_sass_sass_IsAvailable()
|
||||
return executable("sass")
|
||||
endfunction
|
||||
|
||||
"sass caching for large files drastically speeds up the checking, but store it
|
||||
"in a temp location otherwise sass puts .sass_cache dirs in the users project
|
||||
let s:sass_cache_location = tempname()
|
||||
@ -40,7 +36,6 @@ function! SyntaxCheckers_sass_sass_GetLocList() dict
|
||||
endif
|
||||
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'sass',
|
||||
\ 'args': '--cache-location ' . s:sass_cache_location . ' ' . s:imports . ' --check',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -15,10 +15,6 @@ if exists('g:loaded_syntastic_scala_fsc_checker')
|
||||
endif
|
||||
let g:loaded_syntastic_scala_fsc_checker = 1
|
||||
|
||||
function! SyntaxCheckers_scala_fsc_IsAvailable()
|
||||
return executable('fsc')
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_scala_options')
|
||||
let g:syntastic_scala_options = ''
|
||||
endif
|
||||
@ -28,7 +24,6 @@ function! SyntaxCheckers_scala_fsc_GetLocList() dict
|
||||
" working directory changing after being started
|
||||
" that's why we better pass an absolute path
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'fsc',
|
||||
\ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options,
|
||||
\ 'fname': syntastic#util#shexpand('%:p'),
|
||||
\ 'checker': self })
|
||||
|
@ -15,18 +15,12 @@ if exists("g:loaded_syntastic_scala_scalac_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_scala_scalac_checker=1
|
||||
|
||||
function! SyntaxCheckers_scala_scalac_IsAvailable()
|
||||
return executable("scalac")
|
||||
endfunction
|
||||
|
||||
if !exists('g:syntastic_scala_options')
|
||||
let g:syntastic_scala_options = ''
|
||||
endif
|
||||
|
||||
|
||||
function! SyntaxCheckers_scala_scalac_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'scalac',
|
||||
\ 'args': '-Ystop-after:parser ' . g:syntastic_scala_options,
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -11,15 +11,8 @@ if exists("g:loaded_syntastic_sh_checkbashisms_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_sh_checkbashisms_checker=1
|
||||
|
||||
|
||||
function! SyntaxCheckers_sh_checkbashisms_IsAvailable()
|
||||
return executable('checkbashisms')
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_sh_checkbashisms_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'checkbashisms',
|
||||
\ 'args': '-fx',
|
||||
\ 'checker': self})
|
||||
|
||||
|
@ -51,7 +51,7 @@ function! s:IsShellValid()
|
||||
endfunction
|
||||
|
||||
|
||||
function! SyntaxCheckers_sh_sh_IsAvailable()
|
||||
function! SyntaxCheckers_sh_sh_IsAvailable() dict
|
||||
return s:IsShellValid()
|
||||
endfunction
|
||||
|
||||
|
@ -8,10 +8,6 @@ if exists("g:loaded_syntastic_sh_shellcheck_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_sh_shellcheck_checker = 1
|
||||
|
||||
function! SyntaxCheckers_sh_shellcheck_IsAvailable()
|
||||
return executable('jsoncheck')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_sh_shellcheck_Preprocess(json)
|
||||
" A hat tip to Mark Weber for this trick
|
||||
" http://stackoverflow.com/a/19105763
|
||||
@ -22,7 +18,7 @@ function! SyntaxCheckers_sh_shellcheck_Preprocess(json)
|
||||
endfunction
|
||||
|
||||
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'
|
||||
|
||||
@ -45,4 +41,5 @@ endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'sh',
|
||||
\ 'name': 'shellcheck' })
|
||||
\ 'name': 'shellcheck',
|
||||
\ 'exec': 'jsoncheck' })
|
||||
|
@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_slim_slimrb_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_slim_slimrb_checker=1
|
||||
|
||||
function! SyntaxCheckers_slim_slimrb_IsAvailable()
|
||||
return executable("slimrb")
|
||||
endfunction
|
||||
|
||||
function! s:SlimrbVersion()
|
||||
if !exists('s:slimrb_version')
|
||||
let s:slimrb_version = syntastic#util#getVersion('slimrb --version 2>' . syntastic#util#DevNull())
|
||||
@ -28,7 +24,6 @@ endfunction
|
||||
|
||||
function! SyntaxCheckers_slim_slimrb_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'slimrb',
|
||||
\ 'args': '-c',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -16,13 +16,8 @@ if exists("g:loaded_syntastic_tcl_nagelfar_checker")
|
||||
endif
|
||||
let g:loaded_syntastic_tcl_nagelfar_checker=1
|
||||
|
||||
function! SyntaxCheckers_tcl_nagelfar_IsAvailable()
|
||||
return executable('nagelfar')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_tcl_nagelfar_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'nagelfar',
|
||||
\ 'args': '-H',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -32,13 +32,8 @@ if !exists('g:syntastic_tex_chktex_showmsgs')
|
||||
let g:syntastic_tex_chktex_showmsgs = 1
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_tex_chktex_IsAvailable()
|
||||
return executable('chktex')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_tex_chktex_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'chktex',
|
||||
\ 'post_args': '-q -v1',
|
||||
\ 'checker': self })
|
||||
|
||||
|
@ -15,14 +15,8 @@ if exists('g:loaded_syntastic_tex_lacheck_checker')
|
||||
endif
|
||||
let g:loaded_syntastic_tex_lacheck_checker=1
|
||||
|
||||
function! SyntaxCheckers_tex_lacheck_IsAvailable()
|
||||
return executable('lacheck')
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_tex_lacheck_GetLocList() dict
|
||||
let makeprg = syntastic#makeprg#build({
|
||||
\ 'exe': 'lacheck',
|
||||
\ 'checker': self })
|
||||
let makeprg = syntastic#makeprg#build({ 'checker': self })
|
||||
|
||||
let errorformat =
|
||||
\ '%-G** %f:,' .
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user