From 3694908d057be068f0956539bf7d54332a31c418 Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Mon, 28 Oct 2013 17:30:25 +0200 Subject: [PATCH] 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. --- autoload/syntastic/c.vim | 2 +- doc/syntastic.txt | 11 +++++----- plugin/syntastic/checker.vim | 21 ++++++++++++++++++- plugin/syntastic/makeprg_builder.vim | 2 +- syntax_checkers/ada/gcc.vim | 4 ++-- syntax_checkers/applescript/osacompile.vim | 5 ----- syntax_checkers/asciidoc/asciidoc.vim | 5 ----- syntax_checkers/c/checkpatch.vim | 6 +++--- syntax_checkers/c/gcc.vim | 4 ++-- syntax_checkers/c/make.vim | 7 +------ syntax_checkers/c/oclint.vim | 5 ----- syntax_checkers/c/sparse.vim | 5 ----- syntax_checkers/c/splint.vim | 5 ----- syntax_checkers/c/ycm.vim | 2 +- syntax_checkers/chef/foodcritic.vim | 8 +------ syntax_checkers/co/coco.vim | 5 ----- syntax_checkers/cobol/cobc.vim | 4 ++-- syntax_checkers/coffee/coffee.vim | 8 +++---- syntax_checkers/coffee/coffeelint.vim | 5 ----- syntax_checkers/coq/coqtop.vim | 5 ----- syntax_checkers/cpp/cpplint.vim | 11 +++------- syntax_checkers/cpp/gcc.vim | 4 ++-- syntax_checkers/cs/mcs.vim | 5 ----- syntax_checkers/css/csslint.vim | 9 -------- syntax_checkers/css/prettycss.vim | 8 +------ syntax_checkers/cucumber/cucumber.vim | 5 ----- syntax_checkers/cuda/nvcc.vim | 10 ++++----- syntax_checkers/d/dmd.vim | 4 ++-- syntax_checkers/dart/dart_analyzer.vim | 8 +------ syntax_checkers/dustjs/swiffer.vim | 6 ++---- syntax_checkers/elixir/elixir.vim | 2 +- syntax_checkers/erlang/escript.vim | 5 ----- syntax_checkers/eruby/ruby.vim | 2 +- syntax_checkers/fortran/gfortran.vim | 4 ++-- syntax_checkers/go/go.vim | 4 ++-- syntax_checkers/go/gofmt.vim | 5 ----- syntax_checkers/go/golint.vim | 8 +------ syntax_checkers/go/govet.vim | 2 +- syntax_checkers/haml/haml.vim | 2 +- syntax_checkers/handlebars/handlebars.vim | 5 ----- syntax_checkers/haskell/ghc-mod.vim | 9 +++----- syntax_checkers/haskell/hdevtools.vim | 6 +----- syntax_checkers/haskell/hlint.vim | 8 +------ syntax_checkers/haxe/haxe.vim | 5 ----- syntax_checkers/hss/hss.vim | 5 ----- syntax_checkers/html/tidy.vim | 5 ----- syntax_checkers/html/validator.vim | 2 +- syntax_checkers/html/w3.vim | 2 +- syntax_checkers/java/checkstyle.vim | 8 ++----- syntax_checkers/java/javac.vim | 11 +++++----- .../javascript/closurecompiler.vim | 7 ++++--- syntax_checkers/javascript/gjslint.vim | 5 ----- syntax_checkers/javascript/jshint.vim | 2 +- syntax_checkers/javascript/jsl.vim | 16 ++------------ syntax_checkers/javascript/jslint.vim | 5 ----- syntax_checkers/json/jsonlint.vim | 5 ----- syntax_checkers/json/jsonval.vim | 8 +------ syntax_checkers/less/lessc.vim | 4 ++-- syntax_checkers/lisp/clisp.vim | 7 +------ syntax_checkers/llvm/llvm.vim | 8 ++----- syntax_checkers/lua/luac.vim | 7 ------- syntax_checkers/matlab/mlint.vim | 5 ----- syntax_checkers/nasm/nasm.vim | 9 +++----- syntax_checkers/nroff/mandoc.vim | 5 ----- syntax_checkers/objc/gcc.vim | 4 ++-- syntax_checkers/objcpp/gcc.vim | 4 ++-- syntax_checkers/ocaml/camlp4o.vim | 5 ++--- syntax_checkers/perl/perl.vim | 9 ++++---- syntax_checkers/perl/perlcritic.vim | 5 ----- syntax_checkers/php/php.vim | 5 ----- syntax_checkers/php/phpcs.vim | 5 ----- syntax_checkers/php/phpmd.vim | 5 ----- syntax_checkers/pod/podchecker.vim | 8 +------ syntax_checkers/puppet/puppet.vim | 9 +------- syntax_checkers/puppet/puppetlint.vim | 5 +++-- syntax_checkers/python/flake8.vim | 8 ++----- syntax_checkers/python/pep257.vim | 4 ---- syntax_checkers/python/pep8.vim | 4 ---- syntax_checkers/python/py3kwarn.vim | 4 ---- syntax_checkers/python/pyflakes.vim | 4 ---- syntax_checkers/python/pylama.vim | 8 ++----- syntax_checkers/python/pylint.vim | 9 ++++---- syntax_checkers/python/python.vim | 4 ---- syntax_checkers/rst/rst2pseudoxml.vim | 4 ++-- syntax_checkers/ruby/jruby.vim | 4 ---- syntax_checkers/ruby/macruby.vim | 4 ---- syntax_checkers/ruby/mri.vim | 7 ++----- syntax_checkers/ruby/rubocop.vim | 8 +++---- syntax_checkers/ruby/rubylint.vim | 8 ++----- syntax_checkers/rust/rustc.vim | 5 ----- syntax_checkers/sass/sass.vim | 5 ----- syntax_checkers/scala/fsc.vim | 5 ----- syntax_checkers/scala/scalac.vim | 6 ------ syntax_checkers/sh/checkbashisms.vim | 7 ------- syntax_checkers/sh/sh.vim | 2 +- syntax_checkers/sh/shellcheck.vim | 9 +++----- syntax_checkers/slim/slimrb.vim | 5 ----- syntax_checkers/tcl/nagelfar.vim | 5 ----- syntax_checkers/tex/chktex.vim | 5 ----- syntax_checkers/tex/lacheck.vim | 8 +------ syntax_checkers/text/atdtool.vim | 5 ----- syntax_checkers/twig/twiglint.vim | 8 ++----- syntax_checkers/typescript/tsc.vim | 6 ------ syntax_checkers/vala/valac.vim | 6 +----- syntax_checkers/verilog/verilator.vim | 4 ++-- syntax_checkers/vhdl/ghdl.vim | 5 ----- syntax_checkers/xhtml/tidy.vim | 5 ----- syntax_checkers/xml/xmllint.vim | 5 ----- syntax_checkers/yaml/jsyaml.vim | 8 ++----- syntax_checkers/z80/z80syntaxchecker.vim | 21 ++++++++----------- syntax_checkers/zpt/zptlint.vim | 18 ++++++---------- syntax_checkers/zsh/zsh.vim | 5 ----- 112 files changed, 159 insertions(+), 525 deletions(-) diff --git a/autoload/syntastic/c.vim b/autoload/syntastic/c.vim index a1c5c7ef..bab36862 100644 --- a/autoload/syntastic/c.vim +++ b/autoload/syntastic/c.vim @@ -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']) diff --git a/doc/syntastic.txt b/doc/syntastic.txt index 4067228a..e97dc70c 100644 --- a/doc/syntastic.txt +++ b/doc/syntastic.txt @@ -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" diff --git a/plugin/syntastic/checker.vim b/plugin/syntastic/checker.vim index e867af47..88d1d53f 100644 --- a/plugin/syntastic/checker.vim +++ b/plugin/syntastic/checker.vim @@ -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: diff --git a/plugin/syntastic/makeprg_builder.vim b/plugin/syntastic/makeprg_builder.vim index 295fe198..2b11037b 100644 --- a/plugin/syntastic/makeprg_builder.vim +++ b/plugin/syntastic/makeprg_builder.vim @@ -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 diff --git a/syntax_checkers/ada/gcc.vim b/syntax_checkers/ada/gcc.vim index 8eabc04c..faefa90a 100644 --- a/syntax_checkers/ada/gcc.vim +++ b/syntax_checkers/ada/gcc.vim @@ -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 diff --git a/syntax_checkers/applescript/osacompile.vim b/syntax_checkers/applescript/osacompile.vim index 4273e4e7..0119133a 100644 --- a/syntax_checkers/applescript/osacompile.vim +++ b/syntax_checkers/applescript/osacompile.vim @@ -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' diff --git a/syntax_checkers/asciidoc/asciidoc.vim b/syntax_checkers/asciidoc/asciidoc.vim index d9e40d32..adc7b127 100644 --- a/syntax_checkers/asciidoc/asciidoc.vim +++ b/syntax_checkers/asciidoc/asciidoc.vim @@ -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 }) diff --git a/syntax_checkers/c/checkpatch.vim b/syntax_checkers/c/checkpatch.vim index cea54d67..6434b39e 100644 --- a/syntax_checkers/c/checkpatch.vim +++ b/syntax_checkers/c/checkpatch.vim @@ -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'}) diff --git a/syntax_checkers/c/gcc.vim b/syntax_checkers/c/gcc.vim index 0a73ab0c..0c15142b 100644 --- a/syntax_checkers/c/gcc.vim +++ b/syntax_checkers/c/gcc.vim @@ -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 diff --git a/syntax_checkers/c/make.vim b/syntax_checkers/c/make.vim index e0da876c..bc3a8d55 100644 --- a/syntax_checkers/c/make.vim +++ b/syntax_checkers/c/make.vim @@ -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:,' . diff --git a/syntax_checkers/c/oclint.vim b/syntax_checkers/c/oclint.vim index b498b2c9..9c1d708e 100644 --- a/syntax_checkers/c/oclint.vim +++ b/syntax_checkers/c/oclint.vim @@ -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 }) diff --git a/syntax_checkers/c/sparse.vim b/syntax_checkers/c/sparse.vim index 21938f47..9c9491e5 100644 --- a/syntax_checkers/c/sparse.vim +++ b/syntax_checkers/c/sparse.vim @@ -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 }) diff --git a/syntax_checkers/c/splint.vim b/syntax_checkers/c/splint.vim index 960e1370..590555b0 100644 --- a/syntax_checkers/c/splint.vim +++ b/syntax_checkers/c/splint.vim @@ -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 }) diff --git a/syntax_checkers/c/ycm.vim b/syntax_checkers/c/ycm.vim index 002ede56..d410aba6 100644 --- a/syntax_checkers/c/ycm.vim +++ b/syntax_checkers/c/ycm.vim @@ -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 diff --git a/syntax_checkers/chef/foodcritic.vim b/syntax_checkers/chef/foodcritic.vim index a016ef89..42d1cda7 100644 --- a/syntax_checkers/chef/foodcritic.vim +++ b/syntax_checkers/chef/foodcritic.vim @@ -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' diff --git a/syntax_checkers/co/coco.vim b/syntax_checkers/co/coco.vim index 7ed07c68..f22e4e56 100644 --- a/syntax_checkers/co/coco.vim +++ b/syntax_checkers/co/coco.vim @@ -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 }) diff --git a/syntax_checkers/cobol/cobc.vim b/syntax_checkers/cobol/cobc.vim index edaa4ec8..41fa1aa4 100644 --- a/syntax_checkers/cobol/cobc.vim +++ b/syntax_checkers/cobol/cobc.vim @@ -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 diff --git a/syntax_checkers/coffee/coffee.vim b/syntax_checkers/coffee/coffee.vim index c72d62ed..44435e23 100644 --- a/syntax_checkers/coffee/coffee.vim +++ b/syntax_checkers/coffee/coffee.vim @@ -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 }) diff --git a/syntax_checkers/coffee/coffeelint.vim b/syntax_checkers/coffee/coffeelint.vim index a7bdeae5..1fbf5943 100644 --- a/syntax_checkers/coffee/coffeelint.vim +++ b/syntax_checkers/coffee/coffeelint.vim @@ -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 }) diff --git a/syntax_checkers/coq/coqtop.vim b/syntax_checkers/coq/coqtop.vim index b58a7ac9..5a1f2bd3 100644 --- a/syntax_checkers/coq/coqtop.vim +++ b/syntax_checkers/coq/coqtop.vim @@ -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 }) diff --git a/syntax_checkers/cpp/cpplint.vim b/syntax_checkers/cpp/cpplint.vim index 7bcb2f9a..a3c01d93 100644 --- a/syntax_checkers/cpp/cpplint.vim +++ b/syntax_checkers/cpp/cpplint.vim @@ -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'}) diff --git a/syntax_checkers/cpp/gcc.vim b/syntax_checkers/cpp/gcc.vim index c5cc59ff..7b6e085b 100644 --- a/syntax_checkers/cpp/gcc.vim +++ b/syntax_checkers/cpp/gcc.vim @@ -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 diff --git a/syntax_checkers/cs/mcs.vim b/syntax_checkers/cs/mcs.vim index 818a460e..79129e1c 100644 --- a/syntax_checkers/cs/mcs.vim +++ b/syntax_checkers/cs/mcs.vim @@ -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 }) diff --git a/syntax_checkers/css/csslint.vim b/syntax_checkers/css/csslint.vim index f047d172..8ef97682 100644 --- a/syntax_checkers/css/csslint.vim +++ b/syntax_checkers/css/csslint.vim @@ -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 }) diff --git a/syntax_checkers/css/prettycss.vim b/syntax_checkers/css/prettycss.vim index 30b9392c..c1e41017 100644 --- a/syntax_checkers/css/prettycss.vim +++ b/syntax_checkers/css/prettycss.vim @@ -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 = diff --git a/syntax_checkers/cucumber/cucumber.vim b/syntax_checkers/cucumber/cucumber.vim index 187f6126..c499b315 100644 --- a/syntax_checkers/cucumber/cucumber.vim +++ b/syntax_checkers/cucumber/cucumber.vim @@ -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 }) diff --git a/syntax_checkers/cuda/nvcc.vim b/syntax_checkers/cuda/nvcc.vim index ad92fc7b..08658e2f 100644 --- a/syntax_checkers/cuda/nvcc.vim +++ b/syntax_checkers/cuda/nvcc.vim @@ -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 [] diff --git a/syntax_checkers/d/dmd.vim b/syntax_checkers/d/dmd.vim index 267f8a29..0c1df604 100644 --- a/syntax_checkers/d/dmd.vim +++ b/syntax_checkers/d/dmd.vim @@ -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 diff --git a/syntax_checkers/dart/dart_analyzer.vim b/syntax_checkers/dart/dart_analyzer.vim index 00420e9e..8b689764 100644 --- a/syntax_checkers/dart/dart_analyzer.vim +++ b/syntax_checkers/dart/dart_analyzer.vim @@ -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: diff --git a/syntax_checkers/dustjs/swiffer.vim b/syntax_checkers/dustjs/swiffer.vim index eebd0beb..b53f9f5f 100644 --- a/syntax_checkers/dustjs/swiffer.vim +++ b/syntax_checkers/dustjs/swiffer.vim @@ -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' diff --git a/syntax_checkers/elixir/elixir.vim b/syntax_checkers/elixir/elixir.vim index be7e1241..e2660351 100644 --- a/syntax_checkers/elixir/elixir.vim +++ b/syntax_checkers/elixir/elixir.vim @@ -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 diff --git a/syntax_checkers/erlang/escript.vim b/syntax_checkers/erlang/escript.vim index 20f6f71a..bd9014a6 100644 --- a/syntax_checkers/erlang/escript.vim +++ b/syntax_checkers/erlang/escript.vim @@ -21,10 +21,6 @@ endif let s:check_file = expand(':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, diff --git a/syntax_checkers/eruby/ruby.vim b/syntax_checkers/eruby/ruby.vim index 8df5db8e..b7a7baed 100644 --- a/syntax_checkers/eruby/ruby.vim +++ b/syntax_checkers/eruby/ruby.vim @@ -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 diff --git a/syntax_checkers/fortran/gfortran.vim b/syntax_checkers/fortran/gfortran.vim index f7527779..1d3f0a9f 100644 --- a/syntax_checkers/fortran/gfortran.vim +++ b/syntax_checkers/fortran/gfortran.vim @@ -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 diff --git a/syntax_checkers/go/go.vim b/syntax_checkers/go/go.vim index e4f8f3f7..752c5369 100644 --- a/syntax_checkers/go/go.vim +++ b/syntax_checkers/go/go.vim @@ -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 diff --git a/syntax_checkers/go/gofmt.vim b/syntax_checkers/go/gofmt.vim index 4ad6e94a..a9db2259 100644 --- a/syntax_checkers/go/gofmt.vim +++ b/syntax_checkers/go/gofmt.vim @@ -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 }) diff --git a/syntax_checkers/go/golint.vim b/syntax_checkers/go/golint.vim index 98ec7bc2..72c7c6a6 100644 --- a/syntax_checkers/go/golint.vim +++ b/syntax_checkers/go/golint.vim @@ -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%.%#' diff --git a/syntax_checkers/go/govet.vim b/syntax_checkers/go/govet.vim index 901dcf58..3ba0aa58 100644 --- a/syntax_checkers/go/govet.vim +++ b/syntax_checkers/go/govet.vim @@ -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 diff --git a/syntax_checkers/haml/haml.vim b/syntax_checkers/haml/haml.vim index 93adc502..d2dcf166 100644 --- a/syntax_checkers/haml/haml.vim +++ b/syntax_checkers/haml/haml.vim @@ -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 diff --git a/syntax_checkers/handlebars/handlebars.vim b/syntax_checkers/handlebars/handlebars.vim index 1e8a40ba..07fd6dfa 100644 --- a/syntax_checkers/handlebars/handlebars.vim +++ b/syntax_checkers/handlebars/handlebars.vim @@ -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 }) diff --git a/syntax_checkers/haskell/ghc-mod.vim b/syntax_checkers/haskell/ghc-mod.vim index 4a8689a4..0c3d0140 100644 --- a/syntax_checkers/haskell/ghc-mod.vim +++ b/syntax_checkers/haskell/ghc-mod.vim @@ -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'}) diff --git a/syntax_checkers/haskell/hdevtools.vim b/syntax_checkers/haskell/hdevtools.vim index c7fb45cb..f7be9138 100644 --- a/syntax_checkers/haskell/hdevtools.vim +++ b/syntax_checkers/haskell/hdevtools.vim @@ -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 }) diff --git a/syntax_checkers/haskell/hlint.vim b/syntax_checkers/haskell/hlint.vim index da94b1ef..fb8f0a47 100644 --- a/syntax_checkers/haskell/hlint.vim +++ b/syntax_checkers/haskell/hlint.vim @@ -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,' . diff --git a/syntax_checkers/haxe/haxe.vim b/syntax_checkers/haxe/haxe.vim index 532bc10b..f3d0a813 100644 --- a/syntax_checkers/haxe/haxe.vim +++ b/syntax_checkers/haxe/haxe.vim @@ -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 }) diff --git a/syntax_checkers/hss/hss.vim b/syntax_checkers/hss/hss.vim index 62c53e12..bb9f2297 100644 --- a/syntax_checkers/hss/hss.vim +++ b/syntax_checkers/hss/hss.vim @@ -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 }) diff --git a/syntax_checkers/html/tidy.vim b/syntax_checkers/html/tidy.vim index eb978694..670252a7 100644 --- a/syntax_checkers/html/tidy.vim +++ b/syntax_checkers/html/tidy.vim @@ -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 }) diff --git a/syntax_checkers/html/validator.vim b/syntax_checkers/html/validator.vim index 9883e0d4..8b0c28b7 100644 --- a/syntax_checkers/html/validator.vim +++ b/syntax_checkers/html/validator.vim @@ -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 diff --git a/syntax_checkers/html/w3.vim b/syntax_checkers/html/w3.vim index e1ebcfe1..cde70768 100644 --- a/syntax_checkers/html/w3.vim +++ b/syntax_checkers/html/w3.vim @@ -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 diff --git a/syntax_checkers/java/checkstyle.vim b/syntax_checkers/java/checkstyle.vim index b70db1fd..c7a4c026 100644 --- a/syntax_checkers/java/checkstyle.vim +++ b/syntax_checkers/java/checkstyle.vim @@ -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'}) diff --git a/syntax_checkers/java/javac.vim b/syntax_checkers/java/javac.vim index 784a17ce..abf282fb 100644 --- a/syntax_checkers/java/javac.vim +++ b/syntax_checkers/java/javac.vim @@ -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', diff --git a/syntax_checkers/javascript/closurecompiler.vim b/syntax_checkers/javascript/closurecompiler.vim index 36c758f4..b39bf63b 100644 --- a/syntax_checkers/javascript/closurecompiler.vim +++ b/syntax_checkers/javascript/closurecompiler.vim @@ -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'}) diff --git a/syntax_checkers/javascript/gjslint.vim b/syntax_checkers/javascript/gjslint.vim index 72e9ac51..0bfd2bf1 100644 --- a/syntax_checkers/javascript/gjslint.vim +++ b/syntax_checkers/javascript/gjslint.vim @@ -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 }) diff --git a/syntax_checkers/javascript/jshint.vim b/syntax_checkers/javascript/jshint.vim index 528c2729..fd778c58 100644 --- a/syntax_checkers/javascript/jshint.vim +++ b/syntax_checkers/javascript/jshint.vim @@ -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 diff --git a/syntax_checkers/javascript/jsl.vim b/syntax_checkers/javascript/jsl.vim index 2da8e70b..65931c0b 100644 --- a/syntax_checkers/javascript/jsl.vim +++ b/syntax_checkers/javascript/jsl.vim @@ -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 = diff --git a/syntax_checkers/javascript/jslint.vim b/syntax_checkers/javascript/jslint.vim index a3ef9a50..774291bd 100644 --- a/syntax_checkers/javascript/jslint.vim +++ b/syntax_checkers/javascript/jslint.vim @@ -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 }) diff --git a/syntax_checkers/json/jsonlint.vim b/syntax_checkers/json/jsonlint.vim index 1b65c9e8..f6b4f672 100644 --- a/syntax_checkers/json/jsonlint.vim +++ b/syntax_checkers/json/jsonlint.vim @@ -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 }) diff --git a/syntax_checkers/json/jsonval.vim b/syntax_checkers/json/jsonval.vim index 283649ca..afa5029a 100644 --- a/syntax_checkers/json/jsonval.vim +++ b/syntax_checkers/json/jsonval.vim @@ -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,' . diff --git a/syntax_checkers/less/lessc.vim b/syntax_checkers/less/lessc.vim index 73c85d6d..8358d078 100644 --- a/syntax_checkers/less/lessc.vim +++ b/syntax_checkers/less/lessc.vim @@ -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 diff --git a/syntax_checkers/lisp/clisp.vim b/syntax_checkers/lisp/clisp.vim index ec9c2ce0..63855685 100644 --- a/syntax_checkers/lisp/clisp.vim +++ b/syntax_checkers/lisp/clisp.vim @@ -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 = diff --git a/syntax_checkers/llvm/llvm.vim b/syntax_checkers/llvm/llvm.vim index fe52df14..d84bf437 100644 --- a/syntax_checkers/llvm/llvm.vim +++ b/syntax_checkers/llvm/llvm.vim @@ -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'}) diff --git a/syntax_checkers/lua/luac.vim b/syntax_checkers/lua/luac.vim index 7ef19eed..28741a6f 100644 --- a/syntax_checkers/lua/luac.vim +++ b/syntax_checkers/lua/luac.vim @@ -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({ diff --git a/syntax_checkers/matlab/mlint.vim b/syntax_checkers/matlab/mlint.vim index 82cb681e..74aca166 100644 --- a/syntax_checkers/matlab/mlint.vim +++ b/syntax_checkers/matlab/mlint.vim @@ -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 }) diff --git a/syntax_checkers/nasm/nasm.vim b/syntax_checkers/nasm/nasm.vim index b986f534..4ff24423 100644 --- a/syntax_checkers/nasm/nasm.vim +++ b/syntax_checkers/nasm/nasm.vim @@ -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' diff --git a/syntax_checkers/nroff/mandoc.vim b/syntax_checkers/nroff/mandoc.vim index d09c3626..eeafe8fb 100644 --- a/syntax_checkers/nroff/mandoc.vim +++ b/syntax_checkers/nroff/mandoc.vim @@ -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 }) diff --git a/syntax_checkers/objc/gcc.vim b/syntax_checkers/objc/gcc.vim index 48b3d564..d9f9e805 100644 --- a/syntax_checkers/objc/gcc.vim +++ b/syntax_checkers/objc/gcc.vim @@ -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 diff --git a/syntax_checkers/objcpp/gcc.vim b/syntax_checkers/objcpp/gcc.vim index 480dbebb..968db156 100644 --- a/syntax_checkers/objcpp/gcc.vim +++ b/syntax_checkers/objcpp/gcc.vim @@ -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 diff --git a/syntax_checkers/ocaml/camlp4o.vim b/syntax_checkers/ocaml/camlp4o.vim index a2731cba..d437b3b3 100644 --- a/syntax_checkers/ocaml/camlp4o.vim +++ b/syntax_checkers/ocaml/camlp4o.vim @@ -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 diff --git a/syntax_checkers/perl/perl.vim b/syntax_checkers/perl/perl.vim index 855ef34e..61d9e076 100644 --- a/syntax_checkers/perl/perl.vim +++ b/syntax_checkers/perl/perl.vim @@ -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 }) diff --git a/syntax_checkers/perl/perlcritic.vim b/syntax_checkers/perl/perlcritic.vim index f64d44be..5bdc2f31 100644 --- a/syntax_checkers/perl/perlcritic.vim +++ b/syntax_checkers/perl/perlcritic.vim @@ -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 }) diff --git a/syntax_checkers/php/php.vim b/syntax_checkers/php/php.vim index a0fb65d9..8110cc1d 100644 --- a/syntax_checkers/php/php.vim +++ b/syntax_checkers/php/php.vim @@ -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 }) diff --git a/syntax_checkers/php/phpcs.vim b/syntax_checkers/php/phpcs.vim index 2abdbf25..eb6560a6 100644 --- a/syntax_checkers/php/phpcs.vim +++ b/syntax_checkers/php/phpcs.vim @@ -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 }) diff --git a/syntax_checkers/php/phpmd.vim b/syntax_checkers/php/phpmd.vim index 2dbcb563..7a9c7a08 100644 --- a/syntax_checkers/php/phpmd.vim +++ b/syntax_checkers/php/phpmd.vim @@ -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 }) diff --git a/syntax_checkers/pod/podchecker.vim b/syntax_checkers/pod/podchecker.vim index 66e6ddf8..d7e30c71 100644 --- a/syntax_checkers/pod/podchecker.vim +++ b/syntax_checkers/pod/podchecker.vim @@ -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,' . diff --git a/syntax_checkers/puppet/puppet.vim b/syntax_checkers/puppet/puppet.vim index f9019c09..cbb342ff 100644 --- a/syntax_checkers/puppet/puppet.vim +++ b/syntax_checkers/puppet/puppet.vim @@ -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({ diff --git a/syntax_checkers/puppet/puppetlint.vim b/syntax_checkers/puppet/puppetlint.vim index b1db347a..8cb6b597 100644 --- a/syntax_checkers/puppet/puppetlint.vim +++ b/syntax_checkers/puppet/puppetlint.vim @@ -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'}) diff --git a/syntax_checkers/python/flake8.vim b/syntax_checkers/python/flake8.vim index 484e8fc4..a993b566 100644 --- a/syntax_checkers/python/flake8.vim +++ b/syntax_checkers/python/flake8.vim @@ -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 diff --git a/syntax_checkers/python/pep257.vim b/syntax_checkers/python/pep257.vim index 9b4b4912..27a2dbca 100644 --- a/syntax_checkers/python/pep257.vim +++ b/syntax_checkers/python/pep257.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 != ""') diff --git a/syntax_checkers/python/pep8.vim b/syntax_checkers/python/pep8.vim index b2b0f986..b022ff64 100644 --- a/syntax_checkers/python/pep8.vim +++ b/syntax_checkers/python/pep8.vim @@ -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', diff --git a/syntax_checkers/python/py3kwarn.vim b/syntax_checkers/python/py3kwarn.vim index a97eac0b..ece238aa 100644 --- a/syntax_checkers/python/py3kwarn.vim +++ b/syntax_checkers/python/py3kwarn.vim @@ -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', diff --git a/syntax_checkers/python/pyflakes.vim b/syntax_checkers/python/pyflakes.vim index f572c1bd..1773d185 100644 --- a/syntax_checkers/python/pyflakes.vim +++ b/syntax_checkers/python/pyflakes.vim @@ -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 diff --git a/syntax_checkers/python/pylama.vim b/syntax_checkers/python/pylama.vim index cb290e27..b49a4f2c 100644 --- a/syntax_checkers/python/pylama.vim +++ b/syntax_checkers/python/pylama.vim @@ -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 diff --git a/syntax_checkers/python/pylint.vim b/syntax_checkers/python/pylint.vim index cdbdcccc..a60c88d4 100644 --- a/syntax_checkers/python/pylint.vim +++ b/syntax_checkers/python/pylint.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/ diff --git a/syntax_checkers/python/python.vim b/syntax_checkers/python/python.vim index 94bce00e..a891879c 100644 --- a/syntax_checkers/python/python.vim +++ b/syntax_checkers/python/python.vim @@ -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('%'), "\\'") . "'" diff --git a/syntax_checkers/rst/rst2pseudoxml.vim b/syntax_checkers/rst/rst2pseudoxml.vim index a11cd602..183778ba 100644 --- a/syntax_checkers/rst/rst2pseudoxml.vim +++ b/syntax_checkers/rst/rst2pseudoxml.vim @@ -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 diff --git a/syntax_checkers/ruby/jruby.vim b/syntax_checkers/ruby/jruby.vim index 624d7d9c..ba8059c3 100644 --- a/syntax_checkers/ruby/jruby.vim +++ b/syntax_checkers/ruby/jruby.vim @@ -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(), diff --git a/syntax_checkers/ruby/macruby.vim b/syntax_checkers/ruby/macruby.vim index ebbd6e2c..0d3a422a 100644 --- a/syntax_checkers/ruby/macruby.vim +++ b/syntax_checkers/ruby/macruby.vim @@ -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', diff --git a/syntax_checkers/ruby/mri.vim b/syntax_checkers/ruby/mri.vim index 5a2f6d2f..0a04d678 100644 --- a/syntax_checkers/ruby/mri.vim +++ b/syntax_checkers/ruby/mri.vim @@ -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'}) diff --git a/syntax_checkers/ruby/rubocop.vim b/syntax_checkers/ruby/rubocop.vim index 13c16225..029b1358 100644 --- a/syntax_checkers/ruby/rubocop.vim +++ b/syntax_checkers/ruby/rubocop.vim @@ -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 }) diff --git a/syntax_checkers/ruby/rubylint.vim b/syntax_checkers/ruby/rubylint.vim index 62ceb305..60bf7477 100644 --- a/syntax_checkers/ruby/rubylint.vim +++ b/syntax_checkers/ruby/rubylint.vim @@ -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: diff --git a/syntax_checkers/rust/rustc.vim b/syntax_checkers/rust/rustc.vim index 526e9415..ed0d559e 100644 --- a/syntax_checkers/rust/rustc.vim +++ b/syntax_checkers/rust/rustc.vim @@ -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 }) diff --git a/syntax_checkers/sass/sass.vim b/syntax_checkers/sass/sass.vim index 7c844124..c685f2ae 100644 --- a/syntax_checkers/sass/sass.vim +++ b/syntax_checkers/sass/sass.vim @@ -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 }) diff --git a/syntax_checkers/scala/fsc.vim b/syntax_checkers/scala/fsc.vim index 30600739..d13b205f 100644 --- a/syntax_checkers/scala/fsc.vim +++ b/syntax_checkers/scala/fsc.vim @@ -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 }) diff --git a/syntax_checkers/scala/scalac.vim b/syntax_checkers/scala/scalac.vim index 6be0e55b..753abd76 100644 --- a/syntax_checkers/scala/scalac.vim +++ b/syntax_checkers/scala/scalac.vim @@ -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 }) diff --git a/syntax_checkers/sh/checkbashisms.vim b/syntax_checkers/sh/checkbashisms.vim index 2e300011..ead049b8 100644 --- a/syntax_checkers/sh/checkbashisms.vim +++ b/syntax_checkers/sh/checkbashisms.vim @@ -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}) diff --git a/syntax_checkers/sh/sh.vim b/syntax_checkers/sh/sh.vim index 0d109a70..34953453 100644 --- a/syntax_checkers/sh/sh.vim +++ b/syntax_checkers/sh/sh.vim @@ -51,7 +51,7 @@ function! s:IsShellValid() endfunction -function! SyntaxCheckers_sh_sh_IsAvailable() +function! SyntaxCheckers_sh_sh_IsAvailable() dict return s:IsShellValid() endfunction diff --git a/syntax_checkers/sh/shellcheck.vim b/syntax_checkers/sh/shellcheck.vim index 6e73bb92..4c65029f 100644 --- a/syntax_checkers/sh/shellcheck.vim +++ b/syntax_checkers/sh/shellcheck.vim @@ -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' }) diff --git a/syntax_checkers/slim/slimrb.vim b/syntax_checkers/slim/slimrb.vim index 8205e80c..26291f62 100644 --- a/syntax_checkers/slim/slimrb.vim +++ b/syntax_checkers/slim/slimrb.vim @@ -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 }) diff --git a/syntax_checkers/tcl/nagelfar.vim b/syntax_checkers/tcl/nagelfar.vim index da48e25f..4bbd164c 100644 --- a/syntax_checkers/tcl/nagelfar.vim +++ b/syntax_checkers/tcl/nagelfar.vim @@ -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 }) diff --git a/syntax_checkers/tex/chktex.vim b/syntax_checkers/tex/chktex.vim index 046edc90..ff61cad7 100644 --- a/syntax_checkers/tex/chktex.vim +++ b/syntax_checkers/tex/chktex.vim @@ -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 }) diff --git a/syntax_checkers/tex/lacheck.vim b/syntax_checkers/tex/lacheck.vim index c4bcf8e6..38b395c2 100644 --- a/syntax_checkers/tex/lacheck.vim +++ b/syntax_checkers/tex/lacheck.vim @@ -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:,' . diff --git a/syntax_checkers/text/atdtool.vim b/syntax_checkers/text/atdtool.vim index cfce9c57..b2b025a5 100644 --- a/syntax_checkers/text/atdtool.vim +++ b/syntax_checkers/text/atdtool.vim @@ -15,10 +15,6 @@ if exists("g:loaded_syntastic_text_atdtool_checker") endif let g:loaded_syntastic_text_atdtool_checker = 1 -function! SyntaxCheckers_text_atdtool_IsAvailable() - return executable('atdtool') -endfunction - function! SyntaxCheckers_text_atdtool_GetHighlightRegex(item) let term = matchstr(a:item['text'], '\m "\zs[^"]\+\ze"\($\| | suggestions:\)') if term != '' @@ -30,7 +26,6 @@ endfunction function! SyntaxCheckers_text_atdtool_GetLocList() dict let makeprg = syntastic#makeprg#build({ - \ 'exe': 'atdtool', \ 'tail': '2>' . syntastic#util#DevNull(), \ 'checker': self }) diff --git a/syntax_checkers/twig/twiglint.vim b/syntax_checkers/twig/twiglint.vim index 5be896f2..5574f17f 100644 --- a/syntax_checkers/twig/twiglint.vim +++ b/syntax_checkers/twig/twiglint.vim @@ -20,13 +20,8 @@ function! SyntaxCheckers_twig_twiglint_GetHighlightRegex(item) return '\V' endfunction -function! SyntaxCheckers_twig_twiglint_IsAvailable() - return executable('twig-lint') -endfunction - function! SyntaxCheckers_twig_twiglint_GetLocList() dict let makeprg = syntastic#makeprg#build({ - \ 'exe': 'twig-lint', \ 'args': 'lint --format=csv', \ 'checker': self }) @@ -39,4 +34,5 @@ endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'twig', - \ 'name': 'twiglint'}) + \ 'name': 'twiglint', + \ 'exec': 'twig-lint'}) diff --git a/syntax_checkers/typescript/tsc.vim b/syntax_checkers/typescript/tsc.vim index 9abf44b0..10b81201 100644 --- a/syntax_checkers/typescript/tsc.vim +++ b/syntax_checkers/typescript/tsc.vim @@ -9,14 +9,8 @@ if exists("g:loaded_syntastic_typescript_tsc_checker") endif let g:loaded_syntastic_typescript_tsc_checker=1 -function! SyntaxCheckers_typescript_tsc_IsAvailable() - return executable("tsc") -endfunction - - function! SyntaxCheckers_typescript_tsc_GetLocList() dict let makeprg = syntastic#makeprg#build({ - \ 'exe': 'tsc', \ 'args': '--module commonjs', \ 'post_args': '--out ' . syntastic#util#DevNull(), \ 'checker': self }) diff --git a/syntax_checkers/vala/valac.vim b/syntax_checkers/vala/valac.vim index 73671952..06b2d115 100644 --- a/syntax_checkers/vala/valac.vim +++ b/syntax_checkers/vala/valac.vim @@ -27,10 +27,6 @@ if exists("g:loaded_syntastic_vala_valac_checker") endif let g:loaded_syntastic_vala_valac_checker = 1 -function! SyntaxCheckers_vala_valac_IsAvailable() - return executable('valac') -endfunction - function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos) let strlength = strlen(matchstr(a:pos['text'], '\m\^\+$')) return '\%>' . (a:pos.col-1) . 'c.*\%<' . (a:pos.col+strlength+1) . 'c' @@ -55,9 +51,9 @@ endfunction function! SyntaxCheckers_vala_valac_GetLocList() dict let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ') let makeprg = syntastic#makeprg#build({ - \ 'exe': 'valac', \ 'args': '-C ' . vala_pkg_args, \ 'checker': self }) + let errorformat = \ '%A%f:%l.%c-%\d%\+.%\d%\+: %t%[a-z]%\+: %m,'. \ '%C%m,'. diff --git a/syntax_checkers/verilog/verilator.vim b/syntax_checkers/verilog/verilator.vim index 1b1d630f..14d2d3dd 100644 --- a/syntax_checkers/verilog/verilator.vim +++ b/syntax_checkers/verilog/verilator.vim @@ -16,8 +16,8 @@ endif let s:save_cpo = &cpo set cpo&vim -function! SyntaxCheckers_verilog_verilator_IsAvailable() - return executable(g:syntastic_verilog_compiler) +function! SyntaxCheckers_verilog_verilator_IsAvailable() dict + return executable(expand(g:syntastic_verilog_compiler)) endfunction if !exists('g:syntastic_verilog_compiler_options') diff --git a/syntax_checkers/vhdl/ghdl.vim b/syntax_checkers/vhdl/ghdl.vim index 2dccac45..34cb5fd1 100644 --- a/syntax_checkers/vhdl/ghdl.vim +++ b/syntax_checkers/vhdl/ghdl.vim @@ -14,13 +14,8 @@ if exists("g:loaded_syntastic_vhdl_ghdl_checker") endif let g:loaded_syntastic_vhdl_ghdl_checker = 1 -function! SyntaxCheckers_vhdl_ghdl_IsAvailable() - return executable("ghdl") -endfunction - function! SyntaxCheckers_vhdl_ghdl_GetLocList() dict let makeprg = syntastic#makeprg#build({ - \ 'exe': 'ghdl', \ 'args': '-s', \ 'checker': self }) diff --git a/syntax_checkers/xhtml/tidy.vim b/syntax_checkers/xhtml/tidy.vim index 2c949c37..ea0873a8 100644 --- a/syntax_checkers/xhtml/tidy.vim +++ b/syntax_checkers/xhtml/tidy.vim @@ -24,10 +24,6 @@ if !exists('g:syntastic_xhtml_tidy_ignore_errors') let g:syntastic_xhtml_tidy_ignore_errors = [] endif -function! SyntaxCheckers_xhtml_tidy_IsAvailable() - return executable("tidy") -endfunction - " TODO: join this with html.vim DRY's sake? function! s:TidyEncOptByFenc() let tidy_opts = { @@ -59,7 +55,6 @@ endfunction function! SyntaxCheckers_xhtml_tidy_GetLocList() dict let encopt = s:TidyEncOptByFenc() let makeprg = syntastic#makeprg#build({ - \ 'exe': 'tidy', \ 'args': encopt . ' -xml -e', \ 'checker': self }) diff --git a/syntax_checkers/xml/xmllint.vim b/syntax_checkers/xml/xmllint.vim index 869fab05..5e8b7d8f 100644 --- a/syntax_checkers/xml/xmllint.vim +++ b/syntax_checkers/xml/xmllint.vim @@ -19,13 +19,8 @@ let g:loaded_syntastic_xml_xmllint_checker=1 " and allow you to validate XML data without network access, see xmlcatalog(1) " and http://www.xmlsoft.org/catalog.html for more information. -function! SyntaxCheckers_xml_xmllint_IsAvailable() - return executable('xmllint') -endfunction - function! SyntaxCheckers_xml_xmllint_GetLocList() dict let makeprg = syntastic#makeprg#build({ - \ 'exe': 'xmllint', \ 'args': '--xinclude --noout --postvalid', \ 'checker': self }) diff --git a/syntax_checkers/yaml/jsyaml.vim b/syntax_checkers/yaml/jsyaml.vim index d70327ce..b8734142 100644 --- a/syntax_checkers/yaml/jsyaml.vim +++ b/syntax_checkers/yaml/jsyaml.vim @@ -18,13 +18,8 @@ if exists("g:loaded_syntastic_yaml_jsyaml_checker") endif let g:loaded_syntastic_yaml_jsyaml_checker=1 -function! SyntaxCheckers_yaml_jsyaml_IsAvailable() - return executable("js-yaml") -endfunction - function! SyntaxCheckers_yaml_jsyaml_GetLocList() dict let makeprg = syntastic#makeprg#build({ - \ 'exe': 'js-yaml', \ 'args': '--compact', \ 'checker': self }) @@ -38,4 +33,5 @@ endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'yaml', - \ 'name': 'jsyaml'}) + \ 'name': 'jsyaml', + \ 'exec': 'js-yaml'}) diff --git a/syntax_checkers/z80/z80syntaxchecker.vim b/syntax_checkers/z80/z80syntaxchecker.vim index 3913643e..a265b004 100644 --- a/syntax_checkers/z80/z80syntaxchecker.vim +++ b/syntax_checkers/z80/z80syntaxchecker.vim @@ -9,24 +9,20 @@ " See http://sam.zoy.org/wtfpl/COPYING for more details. " "============================================================================ +" +" To obtain this application there are two solutions: +" - Install this python package: +" https://github.com/rgiot/pycpcdemotools +" - Copy/paste this script in your search path: +" https://raw.github.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py if exists("g:loaded_syntastic_z80_z80syntaxchecker_checker") finish endif let g:loaded_syntastic_z80_z80syntaxchecker_checker=1 -"bail if the user doesnt have z80_syntax_checker.py installed -"To obtain this application there are two solutions: -" - Install this python package: https://github.com/rgiot/pycpcdemotools -" - Copy/paste this script in your search path: https://raw.github.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py -function! SyntaxCheckers_z80_z80syntaxchecker_IsAvailable() - return executable("z80_syntax_checker.py") -endfunction - function! SyntaxCheckers_z80_z80syntaxchecker_GetLocList() dict - let makeprg = syntastic#makeprg#build({ - \ 'exe': 'z80_syntax_checker.py', - \ 'checker': self }) + let makeprg = syntastic#makeprg#build({ 'checker': self }) let errorformat = '%f:%l %m' @@ -37,4 +33,5 @@ endfunction call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'z80', - \ 'name': 'z80syntaxchecker'}) + \ 'name': 'z80syntaxchecker', + \ 'exec': 'z80_syntax_checker.py'}) diff --git a/syntax_checkers/zpt/zptlint.vim b/syntax_checkers/zpt/zptlint.vim index accda177..1b3491fa 100644 --- a/syntax_checkers/zpt/zptlint.vim +++ b/syntax_checkers/zpt/zptlint.vim @@ -9,12 +9,7 @@ " See http://sam.zoy.org/wtfpl/COPYING for more details. " "============================================================================ - -if exists("g:loaded_syntastic_zpt_zptlint_checker") - finish -endif -let g:loaded_syntastic_zpt_zptlint_checker=1 - +" " In order for this plugin to be useful, you will need to set up the " zpt filetype in your vimrc " @@ -24,14 +19,13 @@ let g:loaded_syntastic_zpt_zptlint_checker=1 " Then install the zptlint program, found on pypi: " http://pypi.python.org/pypi/zptlint -function! SyntaxCheckers_zpt_zptlint_IsAvailable() - return executable("zptlint") -endfunction +if exists("g:loaded_syntastic_zpt_zptlint_checker") + finish +endif +let g:loaded_syntastic_zpt_zptlint_checker=1 function! SyntaxCheckers_zpt_zptlint_GetLocList() dict - let makeprg = syntastic#makeprg#build({ - \ 'exe': 'zptlint', - \ 'checker': self }) + let makeprg = syntastic#makeprg#build({ 'checker': self }) let errorformat= \ '%-P*** Error in: %f,'. diff --git a/syntax_checkers/zsh/zsh.vim b/syntax_checkers/zsh/zsh.vim index da830894..34ef792a 100644 --- a/syntax_checkers/zsh/zsh.vim +++ b/syntax_checkers/zsh/zsh.vim @@ -15,13 +15,8 @@ if exists("g:loaded_syntastic_zsh_zsh_checker") endif let g:loaded_syntastic_zsh_zsh_checker=1 -function! SyntaxCheckers_zsh_zsh_IsAvailable() - return executable("zsh") -endfunction - function! SyntaxCheckers_zsh_zsh_GetLocList() dict let makeprg = syntastic#makeprg#build({ - \ 'exe': 'zsh', \ 'args': '-n', \ 'checker': self })