From eb2b9cfcd9f5d7cb0e5b3509e4ebceff95948d2a Mon Sep 17 00:00:00 2001 From: LCD 47 Date: Mon, 25 Apr 2016 09:15:49 +0300 Subject: [PATCH] Cleanup. --- plugin/syntastic.vim | 2 +- syntax_checkers/haskell/ghc-mod.vim | 8 +++---- syntax_checkers/javascript/jsxhint.vim | 8 +++---- syntax_checkers/ocaml/camlp4o.vim | 30 +++++++++----------------- syntax_checkers/perl/perl.vim | 8 +++---- syntax_checkers/python/pylint.vim | 8 +++---- 6 files changed, 27 insertions(+), 37 deletions(-) diff --git a/plugin/syntastic.vim b/plugin/syntastic.vim index 84f7852e..a51be738 100644 --- a/plugin/syntastic.vim +++ b/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.7.0-127' +let g:_SYNTASTIC_VERSION = '3.7.0-128' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 diff --git a/syntax_checkers/haskell/ghc-mod.vim b/syntax_checkers/haskell/ghc-mod.vim index 1d3c946b..928e5b30 100644 --- a/syntax_checkers/haskell/ghc-mod.vim +++ b/syntax_checkers/haskell/ghc-mod.vim @@ -20,7 +20,7 @@ let s:ghc_mod_new = -1 let s:save_cpo = &cpo set cpo&vim -function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict +function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict " {{{1 if !executable(self.getExec()) return 0 endif @@ -59,9 +59,9 @@ function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict let s:ghc_mod_bailout = syntastic#util#versionIsAtLeast(parsed_ver, [5, 4]) return (s:ghc_mod_new >= 0) && (v:version >= 704 || s:ghc_mod_new) && !s:ghc_mod_bailout -endfunction +endfunction " }}}1 -function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict +function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict " {{{1 let makeprg = self.makeprgBuild({ \ 'exe': self.getExecEscaped() . ' check' . (s:ghc_mod_new ? ' --boundary=""' : '') }) @@ -81,7 +81,7 @@ function! SyntaxCheckers_haskell_ghc_mod_GetLocList() dict \ 'preprocess': 'iconv', \ 'postprocess': ['compressWhitespace'], \ 'returns': [0] }) -endfunction +endfunction " }}}1 call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'haskell', diff --git a/syntax_checkers/javascript/jsxhint.vim b/syntax_checkers/javascript/jsxhint.vim index 608fa6ef..e29ce06d 100644 --- a/syntax_checkers/javascript/jsxhint.vim +++ b/syntax_checkers/javascript/jsxhint.vim @@ -17,7 +17,7 @@ let g:loaded_syntastic_javascript_jsxhint_checker = 1 let s:save_cpo = &cpo set cpo&vim -function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict +function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict " {{{1 if !executable(self.getExec()) return 0 endif @@ -32,9 +32,9 @@ function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict endif return syntastic#util#versionIsAtLeast(parsed_ver, [0, 4, 1]) -endfunction +endfunction " }}}1 -function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict +function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict " {{{1 let makeprg = self.makeprgBuild({ \ 'args_after': '--verbose' }) @@ -44,7 +44,7 @@ function! SyntaxCheckers_javascript_jsxhint_GetLocList() dict \ 'makeprg': makeprg, \ 'errorformat': errorformat, \ 'defaults': {'bufnr': bufnr('')} }) -endfunction +endfunction " }}}1 call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'javascript', diff --git a/syntax_checkers/ocaml/camlp4o.vim b/syntax_checkers/ocaml/camlp4o.vim index f48af3ed..f7f34e71 100644 --- a/syntax_checkers/ocaml/camlp4o.vim +++ b/syntax_checkers/ocaml/camlp4o.vim @@ -20,8 +20,6 @@ set cpo&vim " Checker options {{{1 -let s:ocamlpp = get(g:, 'syntastic_ocaml_camlp4r', 0) ? 'camlp4r' : 'camlp4o' - if !exists('g:syntastic_ocaml_use_ocamlc') || !executable('ocamlc') let g:syntastic_ocaml_use_ocamlc = 0 endif @@ -41,6 +39,7 @@ endif " }}}1 function! SyntaxCheckers_ocaml_camlp4o_IsAvailable() dict " {{{1 + let s:ocamlpp = get(g:, 'syntastic_ocaml_camlp4r', 0) ? 'camlp4r' : 'camlp4o' return executable(s:ocamlpp) endfunction " }}}1 @@ -81,31 +80,22 @@ endfunction " }}}1 " Utilities {{{1 function! s:GetMakeprg() " {{{2 - if g:syntastic_ocaml_use_ocamlc - return s:GetOcamlcMakeprg() - endif - - if g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build') - return s:GetOcamlBuildMakeprg() - endif - - return s:GetOtherMakeprg() + return + \ g:syntastic_ocaml_use_ocamlc ? g:syntastic_ocaml_use_ocamlc : + \ (g:syntastic_ocaml_use_ocamlbuild && isdirectory('_build')) ? s:GetOcamlcMakeprg() : + \ s:GetOtherMakeprg() endfunction " }}}2 function! s:GetOcamlcMakeprg() " {{{2 - if g:syntastic_ocaml_use_janestreet_core - let build_cmd = 'ocamlc -I ' - let build_cmd .= syntastic#util#shexpand(g:syntastic_ocaml_janestreet_core_dir) - let build_cmd .= ' -c ' . syntastic#util#shexpand('%') - return build_cmd - else - return 'ocamlc -c ' . syntastic#util#shexpand('%') - endif + let build_cmd = g:syntastic_ocaml_use_janestreet_core ? + \ 'ocamlc -I ' . syntastic#util#shexpand(g:syntastic_ocaml_janestreet_core_dir) : 'ocamlc' + let build_cmd .= ' -c ' . syntastic#util#shexpand('%') + return build_cmd endfunction " }}}2 function! s:GetOcamlBuildMakeprg() " {{{2 return 'ocamlbuild -quiet -no-log -tag annot,' . s:ocamlpp . ' -no-links -no-hygiene -no-sanitize ' . - \ syntastic#util#shexpand('%:r') . '.cmi' + \ syntastic#util#shexpand('%:r') . '.cmi' endfunction " }}}2 function! s:GetOtherMakeprg() " {{{2 diff --git a/syntax_checkers/perl/perl.vim b/syntax_checkers/perl/perl.vim index 93f82042..e039518a 100644 --- a/syntax_checkers/perl/perl.vim +++ b/syntax_checkers/perl/perl.vim @@ -39,7 +39,7 @@ endif let s:save_cpo = &cpo set cpo&vim -function! SyntaxCheckers_perl_perl_IsAvailable() dict +function! SyntaxCheckers_perl_perl_IsAvailable() dict " {{{1 if !exists('g:syntastic_perl_perl_exec') && exists('g:syntastic_perl_interpreter') let g:syntastic_perl_perl_exec = g:syntastic_perl_interpreter endif @@ -48,9 +48,9 @@ function! SyntaxCheckers_perl_perl_IsAvailable() dict " let g:syntastic_perl_interpreter='/usr/bin/env perl' silent! call syntastic#util#system(self.getExecEscaped() . ' -e ' . syntastic#util#shescape('exit(0)')) return v:shell_error == 0 -endfunction +endfunction " }}}1 -function! SyntaxCheckers_perl_perl_GetLocList() dict +function! SyntaxCheckers_perl_perl_GetLocList() dict " {{{1 if type(g:syntastic_perl_lib_path) == type('') call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list') let includes = split(g:syntastic_perl_lib_path, ',') @@ -81,7 +81,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict \ 'errorformat': errorformat, \ 'preprocess': 'perl', \ 'defaults': {'type': 'W'} }) -endfunction +endfunction " }}}1 call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'perl', diff --git a/syntax_checkers/python/pylint.vim b/syntax_checkers/python/pylint.vim index 2a54cee4..884d07a2 100644 --- a/syntax_checkers/python/pylint.vim +++ b/syntax_checkers/python/pylint.vim @@ -19,7 +19,7 @@ set cpo&vim let s:pylint_new = -1 -function! SyntaxCheckers_python_pylint_IsAvailable() dict +function! SyntaxCheckers_python_pylint_IsAvailable() dict " {{{1 if !executable(self.getExec()) return 0 endif @@ -45,9 +45,9 @@ function! SyntaxCheckers_python_pylint_IsAvailable() dict endtry return s:pylint_new >= 0 -endfunction +endfunction " }}}1 -function! SyntaxCheckers_python_pylint_GetLocList() dict +function! SyntaxCheckers_python_pylint_GetLocList() dict " {{{1 let makeprg = self.makeprgBuild({ \ 'args_after': (s:pylint_new ? \ '-f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n' : @@ -86,7 +86,7 @@ function! SyntaxCheckers_python_pylint_GetLocList() dict endfor return loclist -endfunction +endfunction " }}}1 call g:SyntasticRegistry.CreateAndRegisterChecker({ \ 'filetype': 'python',