mirror of
https://github.com/amix/vimrc
synced 2025-06-24 07:44:59 +08:00
Updated plugins
This commit is contained in:
@ -25,10 +25,7 @@ function! SyntaxCheckers_coffee_coffee_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
|
||||
call self.log(self.getExec() . ' version = ', ver)
|
||||
|
||||
let ver = self.getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
|
||||
return syntastic#util#versionIsAtLeast(ver, [1, 6, 2])
|
||||
endfunction
|
||||
|
||||
|
@ -20,9 +20,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict
|
||||
if !exists('s:coffeelint_new')
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
let s:coffeelint_new = syntastic#util#versionIsAtLeast(ver, [1, 4])
|
||||
let s:coffeelint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 4])
|
||||
endif
|
||||
let makeprg = self.makeprgBuild({ 'args_after': (s:coffeelint_new ? '--reporter csv' : '--csv') })
|
||||
|
||||
|
@ -27,10 +27,14 @@ function! SyntaxCheckers_eruby_ruby_IsAvailable() dict
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_eruby_ruby_GetLocList() dict
|
||||
if !exists('s:ruby_new')
|
||||
let s:ruby_new = syntastic#util#versionIsAtLeast(self.getVersion(), [1, 9])
|
||||
endif
|
||||
|
||||
let fname = "'" . escape(expand('%', 1), "\\'") . "'"
|
||||
|
||||
" TODO: encodings became useful in ruby 1.9 :)
|
||||
if syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped(). ' --version'), [1, 9])
|
||||
if s:ruby_new
|
||||
let enc = &fileencoding != '' ? &fileencoding : &encoding
|
||||
let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"'
|
||||
else
|
||||
|
@ -41,7 +41,7 @@ function! SyntaxCheckers_haskell_ghc_mod_IsAvailable() dict
|
||||
" need either a Vim that can handle NULs in system() output, or a
|
||||
" ghc-mod that has the "--boundary" option.
|
||||
let parsed_ver = syntastic#util#parseVersion(ver[0])
|
||||
call self.log(self.getExec() . ' version =', parsed_ver)
|
||||
call self.setVersion(parsed_ver)
|
||||
let s:ghc_mod_new = syntastic#util#versionIsAtLeast(parsed_ver, [2, 1, 2])
|
||||
else
|
||||
call syntastic#log#error("checker haskell/ghc_mod: can't parse version string (abnormal termination?)")
|
||||
|
@ -22,11 +22,7 @@ function! SyntaxCheckers_html_jshint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [2, 4])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 4])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_html_jshint_GetLocList() dict
|
||||
|
@ -204,7 +204,7 @@ endfunction " }}}2
|
||||
|
||||
function! s:LoadConfigFile() " {{{2
|
||||
if filereadable(expand(g:syntastic_java_javac_config_file, 1))
|
||||
exe 'source ' . fnameescape(expand(g:syntastic_java_javac_config_file, 1))
|
||||
execute 'source ' . fnameescape(expand(g:syntastic_java_javac_config_file, 1))
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
|
@ -25,11 +25,7 @@ function! SyntaxCheckers_javascript_eslint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [0, 1])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 1])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
|
||||
|
@ -27,20 +27,16 @@ function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
|
||||
return 0
|
||||
endif
|
||||
|
||||
let s:jshint_version = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', s:jshint_version)
|
||||
let ver = self.getVersion()
|
||||
let s:jshint_new = syntastic#util#versionIsAtLeast(ver, [1, 1])
|
||||
|
||||
return syntastic#util#versionIsAtLeast(s:jshint_version, [1])
|
||||
return syntastic#util#versionIsAtLeast(ver, [1])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_javascript_jshint_GetLocList() dict
|
||||
call syntastic#log#deprecationWarn('javascript_jshint_conf', 'javascript_jshint_args',
|
||||
\ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
|
||||
|
||||
if !exists('s:jshint_new')
|
||||
let s:jshint_new = syntastic#util#versionIsAtLeast(s:jshint_version, [1, 1])
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_after': (s:jshint_new ? '--verbose ' : '') })
|
||||
|
||||
let errorformat = s:jshint_new ?
|
||||
|
@ -24,7 +24,7 @@ function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#parseVersion(jsxhint_version)
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
call self.setVersion(ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [0, 4, 1])
|
||||
endfunction
|
||||
|
@ -19,18 +19,12 @@ let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_puppet_puppet_GetLocList() dict
|
||||
if !exists('s:puppet_version')
|
||||
let s:puppet_version = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
|
||||
call self.log(self.getExec() . ' version =', s:puppet_version)
|
||||
if !exists('s:puppet_new')
|
||||
let s:puppet_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2, 7, 0])
|
||||
endif
|
||||
|
||||
if syntastic#util#versionIsAtLeast(s:puppet_version, [2,7,0])
|
||||
let args = 'parser validate --color=false'
|
||||
else
|
||||
let args = '--color=false --parseonly'
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_before': args })
|
||||
let makeprg = self.makeprgBuild({
|
||||
\ 'args_before': (s:puppet_new ? 'parser validate --color=false' : '--color=false --parseonly') })
|
||||
|
||||
let errorformat =
|
||||
\ '%-Gerr: Try ''puppet help parser validate'' for usage,' .
|
||||
|
@ -24,10 +24,7 @@ function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
|
||||
if !executable('puppet') || !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
|
||||
let ver = self.getVersion(self.getExecEscaped() . ' --version 2>' . syntastic#util#DevNull())
|
||||
return syntastic#util#versionIsAtLeast(ver, [0, 1, 10])
|
||||
endfunction
|
||||
|
||||
|
@ -13,9 +13,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_python_pep257_GetLocList() dict
|
||||
if !exists('s:pep257_new')
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
let s:pep257_new = syntastic#util#versionIsAtLeast(ver, [0, 3])
|
||||
let s:pep257_new = syntastic#util#versionIsAtLeast(self.getVersion(), [0, 3])
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({})
|
||||
|
@ -26,11 +26,7 @@ function! SyntaxCheckers_python_prospector_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [0, 7])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 7])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_prospector_GetLocList() dict
|
||||
|
@ -35,8 +35,7 @@ function! SyntaxCheckers_python_pylint_IsAvailable() dict
|
||||
let pylint_version = filter( split(system(self.getExecEscaped() . ' --version'), '\m, \=\|\n'),
|
||||
\ 'v:val =~# ''\m^\(python[-0-9]*-\|\.\)\=pylint[-0-9]*\>''' )[0]
|
||||
let ver = syntastic#util#parseVersion(substitute(pylint_version, '\v^\S+\s+', '', ''))
|
||||
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
call self.setVersion(ver)
|
||||
|
||||
let s:pylint_new = syntastic#util#versionIsAtLeast(ver, [1])
|
||||
catch /\m^Vim\%((\a\+)\)\=:E684/
|
||||
|
@ -28,11 +28,7 @@ function! SyntaxCheckers_python_python_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [2, 6])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [2, 6])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_python_python_GetLocList() dict
|
||||
|
@ -22,11 +22,7 @@ function! SyntaxCheckers_ruby_reek_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [1, 3, 0])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [1, 3, 0])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_reek_GetLocList() dict
|
||||
|
@ -22,11 +22,7 @@ function! SyntaxCheckers_ruby_rubocop_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [0, 12, 0])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 12, 0])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_ruby_rubocop_GetLocList() dict
|
||||
|
@ -21,9 +21,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_ruby_rubylint_GetLocList() dict
|
||||
if !exists('s:rubylint_new')
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
let s:rubylint_new = syntastic#util#versionIsAtLeast(ver, [2])
|
||||
let s:rubylint_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2])
|
||||
endif
|
||||
let makeprg = self.makeprgBuild({ 'args': (s:rubylint_new ? '' : 'analyze ') . '--presenter=syntastic' })
|
||||
|
||||
|
@ -21,11 +21,7 @@ function! SyntaxCheckers_scss_scss_lint_IsAvailable() dict
|
||||
if !executable(self.getExec())
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
|
||||
return syntastic#util#versionIsAtLeast(ver, [0, 12])
|
||||
return syntastic#util#versionIsAtLeast(self.getVersion(), [0, 12])
|
||||
endfunction
|
||||
|
||||
function! SyntaxCheckers_scss_scss_lint_GetLocList() dict
|
||||
|
@ -20,8 +20,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_slim_slimrb_GetLocList() dict
|
||||
if !exists('s:slimrb_new')
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version 2>'. syntastic#util#DevNull())
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
let ver = self.getVersion(self.getExecEscaped() . ' --version 2>'. syntastic#util#DevNull())
|
||||
let s:slimrb_new = syntastic#util#versionIsAtLeast(ver, [1, 3, 1])
|
||||
endif
|
||||
|
||||
|
48
sources_non_forked/syntastic/syntax_checkers/swift/xcrun.vim
Normal file
48
sources_non_forked/syntastic/syntax_checkers/swift/xcrun.vim
Normal file
@ -0,0 +1,48 @@
|
||||
"============================================================================
|
||||
"File: xcrun.vim
|
||||
"Description: swift syntax checker - using xcrun
|
||||
"Maintainer: Tom Fogg <tom@canobe.com>
|
||||
"License: This program is free software. It comes without any warranty,
|
||||
" to the extent permitted by applicable law. You can redistribute
|
||||
" it and/or modify it under the terms of the Do What The Fuck You
|
||||
" Want To Public License, Version 2, as published by Sam Hocevar.
|
||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
"============================================================================
|
||||
|
||||
if exists("g:loaded_syntastic_swift_xcrun_checker")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntastic_xcrun_checker = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_swift_xcrun_GetLocList() dict
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_after': 'swift' })
|
||||
|
||||
let errorformat=
|
||||
\ '%f:%l:%c:{%*[^}]}: %trror: %m,'.
|
||||
\ '%f:%l:%c:{%*[^}]}: fatal %trror: %m,'.
|
||||
\ '%f:%l:%c:{%*[^}]}: %tarning: %m,'.
|
||||
\ '%f:%l:%c: %trror: %m,'.
|
||||
\ '%f:%l:%c: fatal %trror: %m,'.
|
||||
\ '%f:%l:%c: %tarning: %m,'.
|
||||
\ '%f:%l: %trror: %m,'.
|
||||
\ '%f:%l: fatal %trror: %m,'.
|
||||
\ '%f:%l: %tarning: %m,' .
|
||||
\ '%-G%.%#'
|
||||
|
||||
return SyntasticMake({
|
||||
\ 'makeprg': makeprg,
|
||||
\ 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
||||
call g:SyntasticRegistry.CreateAndRegisterChecker({
|
||||
\ 'filetype': 'swift',
|
||||
\ 'name': 'xcrun'})
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
@ -20,9 +20,7 @@ set cpo&vim
|
||||
|
||||
function! SyntaxCheckers_yaml_jsyaml_GetLocList() dict
|
||||
if !exists('s:js_yaml_new')
|
||||
let ver = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
|
||||
call self.log(self.getExec() . ' version =', ver)
|
||||
let s:js_yaml_new = syntastic#util#versionIsAtLeast(ver, [2])
|
||||
let s:js_yaml_new = syntastic#util#versionIsAtLeast(self.getVersion(), [2])
|
||||
endif
|
||||
|
||||
let makeprg = self.makeprgBuild({ 'args_after': (s:js_yaml_new ? '' : '--compact') })
|
||||
|
Reference in New Issue
Block a user