mirror of
https://github.com/amix/vimrc
synced 2025-06-23 23:15:01 +08:00
Updated plugins
This commit is contained in:
@ -59,10 +59,10 @@ Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo,
|
||||
LISP, LLVM intermediate language, Lua, Markdown, MATLAB, NASM, Objective-C,
|
||||
Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and
|
||||
iOS property lists, Puppet, Python, R, Racket, Relax NG, reStructuredText, RPM
|
||||
spec, Ruby, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig, TypeScript, Vala,
|
||||
Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope page templates,
|
||||
and zsh. See the [wiki][3] for details about the corresponding supported
|
||||
checkers.
|
||||
spec, Ruby, SASS/SCSS, Scala, Slim, Swift, Tcl, TeX, Texinfo, Twig, TypeScript,
|
||||
Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope page
|
||||
templates, and zsh. See the [wiki][3] for details about the corresponding
|
||||
supported checkers.
|
||||
|
||||
Below is a screenshot showing the methods that Syntastic uses to display syntax
|
||||
errors. Note that, in practise, you will only have a subset of these methods
|
||||
|
@ -121,12 +121,6 @@ function! syntastic#util#parseVersion(version) " {{{2
|
||||
return map(split(matchstr( a:version, '\v^\D*\zs\d+(\.\d+)+\ze' ), '\m\.'), 'str2nr(v:val)')
|
||||
endfunction " }}}2
|
||||
|
||||
" Run 'command' in a shell and parse output as a version string.
|
||||
" Returns an array of version components.
|
||||
function! syntastic#util#getVersion(command) " {{{2
|
||||
return syntastic#util#parseVersion(system(a:command))
|
||||
endfunction " }}}2
|
||||
|
||||
" Verify that the 'installed' version is at least the 'required' version.
|
||||
"
|
||||
" 'installed' and 'required' must be arrays. If they have different lengths,
|
||||
|
@ -19,7 +19,7 @@ if has('reltime')
|
||||
lockvar! g:_SYNTASTIC_START
|
||||
endif
|
||||
|
||||
let g:_SYNTASTIC_VERSION = '3.5.0-148'
|
||||
let g:_SYNTASTIC_VERSION = '3.6.0-14'
|
||||
lockvar g:_SYNTASTIC_VERSION
|
||||
|
||||
" Sanity checks {{{1
|
||||
|
@ -77,6 +77,27 @@ function! g:SyntasticChecker.getLocList() " {{{2
|
||||
return g:SyntasticLoclist.New(self.getLocListRaw())
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticChecker.getVersion(...) " {{{2
|
||||
if !exists('self._version')
|
||||
let command = a:0 ? a:1 : self.getExecEscaped() . ' --version'
|
||||
let version_output = system(command)
|
||||
call self.log('getVersion: ' . string(command) . ': ' .
|
||||
\ string(split(version_output, "\n", 1)) .
|
||||
\ (v:shell_error ? ' (exit code ' . v:shell_error . ')' : '') )
|
||||
call self.setVersion(syntastic#util#parseVersion(version_output))
|
||||
endif
|
||||
return get(self, '_version', [])
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticChecker.setVersion(version) " {{{2
|
||||
if len(a:version)
|
||||
let self._version = copy(a:version)
|
||||
call self.log(self.getExec() . ' version =', a:version)
|
||||
else
|
||||
call syntastic#log#error("checker " . self._filetype . "/" . self._name . ": can't parse version string (abnormal termination?)")
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
||||
function! g:SyntasticChecker.log(msg, ...) " {{{2
|
||||
let leader = self._filetype . '/' . self._name . ': '
|
||||
if a:0 > 0
|
||||
|
@ -74,6 +74,7 @@ let s:_DEFAULT_CHECKERS = {
|
||||
\ 'sh': ['sh', 'shellcheck'],
|
||||
\ 'slim': ['slimrb'],
|
||||
\ 'spec': ['rpmlint'],
|
||||
\ 'swift': ['xcrun'],
|
||||
\ 'tcl': ['nagelfar'],
|
||||
\ 'tex': ['lacheck', 'chktex'],
|
||||
\ 'texinfo': ['makeinfo'],
|
||||
|
@ -71,13 +71,13 @@ function! g:SyntasticSignsNotifier._setup() " {{{2
|
||||
endif
|
||||
|
||||
" define the signs used to display syntax and style errors/warns
|
||||
exe 'sign define SyntasticError text=' . g:syntastic_error_symbol .
|
||||
execute 'sign define SyntasticError text=' . g:syntastic_error_symbol .
|
||||
\ ' texthl=SyntasticErrorSign linehl=SyntasticErrorLine'
|
||||
exe 'sign define SyntasticWarning text=' . g:syntastic_warning_symbol .
|
||||
execute 'sign define SyntasticWarning text=' . g:syntastic_warning_symbol .
|
||||
\ ' texthl=SyntasticWarningSign linehl=SyntasticWarningLine'
|
||||
exe 'sign define SyntasticStyleError text=' . g:syntastic_style_error_symbol .
|
||||
execute 'sign define SyntasticStyleError text=' . g:syntastic_style_error_symbol .
|
||||
\ ' texthl=SyntasticStyleErrorSign linehl=SyntasticStyleErrorLine'
|
||||
exe 'sign define SyntasticStyleWarning text=' . g:syntastic_style_warning_symbol .
|
||||
execute 'sign define SyntasticStyleWarning text=' . g:syntastic_style_warning_symbol .
|
||||
\ ' texthl=SyntasticStyleWarningSign linehl=SyntasticStyleWarningLine'
|
||||
endif
|
||||
endfunction " }}}2
|
||||
|
@ -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