1
0
mirror of https://github.com/amix/vimrc synced 2025-06-23 23:15:01 +08:00

Updated plugins

This commit is contained in:
amix
2014-04-18 13:58:02 +01:00
parent ac3ef260c8
commit 6a16a9393c
91 changed files with 2554 additions and 708 deletions

View File

@ -29,7 +29,7 @@ Following the coding conventions/styles used in the syntastic core:
* Use 4 space indents.
* Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!).
* Don't use `l:` prefixes for variables unless actually required (i.e. almost never).
* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/introduceExplainingVariable.html) to aid readability.
* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/extractVariable.html) to aid readability.
# Syntax checker style notes

View File

@ -40,10 +40,11 @@ CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir,
Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP,
LLVM intermediate language, Lua, MATLAB, NASM, Objective-C, Objective-C++,
OCaml, Perl, Perl POD, PHP, gettext Portable Object, Puppet, Python, Racket,
reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig,
TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope
page templates, and zsh.
OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and iOS property
lists, Puppet, Python, Racket, R, reStructuredText, Ruby, Rust, 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.
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
@ -111,6 +112,8 @@ If you get an error when you do this, then you probably didn't install
## 3\. FAQ
<a name="faqinfo"></a>
__Q. I installed syntastic but it isn't reporting any errors...__
A. The most likely reason is that none of the syntax checkers that it requires
@ -125,6 +128,8 @@ error output for a syntax checker may have changed. In this case, make sure you
have the latest version of the syntax checker installed. If it still fails then
create an issue - or better yet, create a pull request.
<a name="faqperl"></a>
__Q. The `perl` checker has stopped working...__
A. The `perl` checker runs `perl -c` against your file, which in turn
@ -138,6 +143,8 @@ still producing useful results, the checker is now disabled by default. To
let g:syntastic_enable_perl_checker = 1
```
<a name="faqloclist"></a>
__Q. I run a checker and the location list is not updated...__
A. By default the location list is changed only when you run the `:Errors`
@ -148,6 +155,8 @@ your vimrc:
let g:syntastic_always_populate_loc_list = 1
```
<a name="faqargs"></a>
__Q. How can I pass additional arguments to a checker?__
A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers
@ -162,6 +171,8 @@ let g:syntastic_ruby_mri_args = "--my --args --here"
See `:help syntastic-checker-options` for more information.
<a name="faqcheckers"></a>
__Q. Syntastic supports several checkers for my filetype - how do I tell it
which one(s) to use?__
@ -190,6 +201,32 @@ let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']
This is telling syntastic to run the `php` checker first, and if no errors are
found, run `phpcs`, and then `phpmd`.
You can also run checkers explicitly by calling `:SyntasticCheck <checker>`.
e.g. to run `phpcs` and `phpmd`:
```vim
:SyntasticCheck phpcs phpmd
```
This works for any checkers available for the current filetype, even if they
aren't listed in `g:syntastic_<filetype>_checkers`. You can't run checkers for
"foreign" filetypes though (e.g. you can't run, say, a Python checker if the
current filetype is `php`).
<a name="faqaggregate"></a>
__Q. How can I display together the errors found by all checkers enabled for
the current file?__
A. Set `g:syntastic_aggregate_errors` to 1 in your vimrc:
```vim
let g:syntastic_aggregate_errors = 1
```
See `:help syntastic-aggregating-errors` for more details.
<a name="faqlnext"></a>
__Q. How can I jump between the different errors without using the location
list at the bottom of the window?__
@ -200,6 +237,8 @@ If you use these commands a lot then you may want to add shortcut mappings to
your vimrc, or install something like [unimpaired][2], which provides such
mappings (among other things).
<a name="faqstyle"></a>
__Q. A syntax checker is giving me unwanted/strange style tips?__
A. Some filetypes (e.g. php) have style checkers as well as syntax
@ -214,6 +253,8 @@ let g:syntastic_quiet_messages = { "type": "style" }
```
See `:help syntastic_quiet_messages` for details.
<a name="faqbdelete"></a>
__Q. The error window is closed automatically when I :quit the current buffer
but not when I :bdelete it?__
@ -248,5 +289,5 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9].
[6]: http://stackoverflow.com/questions/tagged/syntastic
[7]: https://github.com/davidhalter/jedi-vim
[8]: https://github.com/klen/python-mode
[9]: https://github.com/Valloric/YouCompleteMe
[9]: http://valloric.github.io/YouCompleteMe/
[10]: http://perldoc.perl.org/perlrun.html#*-c*

View File

@ -8,25 +8,6 @@ set cpo&vim
" Public functions {{{1
function! s:compareErrorItems(a, b) " {{{2
if a:a['bufnr'] != a:b['bufnr']
" group by files
return a:a['bufnr'] - a:b['bufnr']
elseif a:a['lnum'] != a:b['lnum']
return a:a['lnum'] - a:b['lnum']
elseif a:a['type'] !=? a:b['type']
" errors take precedence over warnings
return a:a['type'] ==? 'e' ? -1 : 1
else
return get(a:a, 'col', 0) - get(a:b, 'col', 0)
endif
endfunction " }}}2
" natural sort
function! syntastic#postprocess#sort(errors) " {{{2
return sort(copy(a:errors), 's:compareErrorItems')
endfunction " }}}2
" merge consecutive blanks
function! syntastic#postprocess#compressWhitespace(errors) " {{{2
for e in a:errors

View File

@ -56,6 +56,45 @@ function! syntastic#preprocess#perl(errors) " {{{2
return syntastic#util#unique(out)
endfunction " }}}2
function! syntastic#preprocess#rparse(errors) " {{{2
let errlist = copy(a:errors)
" remove uninteresting lines and handle continuations
let i = 0
while i < len(errlist)
if i > 0 && errlist[i][:1] == ' ' && errlist[i] !~ '\m\s\+\^$'
let errlist[i-1] .= errlist[i][1:]
call remove(errlist, i)
elseif errlist[i] !~ '\m^\(Lint:\|Lint checking:\|Error in\) '
call remove(errlist, i)
else
let i += 1
endif
endwhile
let out = []
let fname = ''
for e in errlist
if match(e, '\m^Lint: ') == 0
let parts = matchlist(e, '\m^Lint: \(.*\): found on lines \([0-9, ]\+\)\(+\(\d\+\) more\)\=')
if len(parts) >= 3
for line in split(parts[2], '\m,\s*')
call add(out, 'E:' . fname . ':' . line . ': ' . parts[1])
endfor
endif
if len(parts) >= 5 && parts[4] != ''
call add(out, 'E:' . fname . ':0: ' . parts[1] . ' - ' . parts[4] . ' messages not shown')
endif
elseif match(e, '\m^Lint checking: ') == 0
let fname = matchstr(e, '\m^Lint checking: \zs.*')
elseif match(e, '\m^Error in ') == 0
call add(out, substitute(e, '\m^Error in .\+ : .\+\ze:\d\+:\d\+: ', 'E:' . fname, ''))
endif
endfor
return out
endfunction " }}}2
function! syntastic#preprocess#validator(errors) " {{{2
let out = []
for e in a:errors

View File

@ -101,7 +101,7 @@ function! syntastic#util#wideMsg(msg) " {{{2
"convert tabs to spaces so that the tabs count towards the window
"width as the proper amount of characters
let chunks = split(msg, "\t", 1)
let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - s:width(v:val) % &ts)'), '') . chunks[-1]
let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &tabstop - s:width(v:val) % &tabstop)'), '') . chunks[-1]
let msg = strpart(msg, 0, &columns - 1)
set noruler noshowcmd
@ -218,6 +218,13 @@ function! syntastic#util#dictFilter(errors, filter) " {{{2
endtry
endfunction " }}}2
function! syntastic#util#sortLoclist(errors) " {{{2
for e in a:errors
call s:setScreenColumn(e)
endfor
call sort(a:errors, 's:compareErrorItems')
endfunction " }}}2
" }}}1
" Private functions {{{1
@ -254,6 +261,49 @@ function! s:translateElement(key, term) " {{{2
return ret
endfunction " }}}2
function! s:screenWidth(str, tabstop) " {{{2
let chunks = split(a:str, "\t", 1)
let width = s:width(chunks[-1])
for c in chunks[:-2]
let cwidth = s:width(c)
let width += cwidth + a:tabstop - cwidth % a:tabstop
endfor
return width
endfunction " }}}2
function! s:setScreenColumn(item) " {{{2
if !has_key(a:item, 'scol')
let col = get(a:item, 'col', 0)
if col != 0 && a:item['vcol'] == 0
let buf = str2nr(a:item['bufnr'])
try
let line = getbufline(buf, a:item['lnum'])[0]
catch /\m^Vim\%((\a\+)\)\=:E684/
let line = ''
endtry
let a:item['scol'] = s:screenWidth(strpart(line, 0, col), getbufvar(buf, '&tabstop'))
else
let a:item['scol'] = col
endif
endif
endfunction " }}}2
function! s:compareErrorItems(a, b) " {{{2
if a:a['bufnr'] != a:b['bufnr']
" group by file
return a:a['bufnr'] - a:b['bufnr']
elseif a:a['lnum'] != a:b['lnum']
" sort by line
return a:a['lnum'] - a:b['lnum']
elseif a:a['type'] !=? a:b['type']
" errors take precedence over warnings
return a:a['type'] ==? 'E' ? -1 : 1
else
" sort by screen column
return a:a['scol'] - a:b['scol']
endif
endfunction " }}}2
" }}}1
let &cpo = s:save_cpo

View File

@ -39,6 +39,8 @@ CONTENTS *syntastic-contents*
6.2.Interaction with python-mode...........|syntastic-pymode|
6.3.Interaction with the fish shell........|syntastic-fish|
6.4.Using syntastic with the fizsh shell...|syntastic-fizsh|
6.5.Interaction with Eclim.................|syntastic-eclim|
6.6.Interaction with vim-virtualenv........|syntastic-vim-virtualenv|
7.About........................................|syntastic-about|
8.License......................................|syntastic-license|
@ -186,7 +188,12 @@ If |'syntastic_aggregate_errors'| is set, syntastic runs all checkers that
apply (still cf. |syntastic-filetype-checkers|), then aggregates errors found
by all checkers in a single list, and notifies you. In this mode each error
message is labeled with the name of the checker that generated it, but you can
disable these labels by unsetting '|syntastic_id_checkers|'.
disable generation of these labels by turning off '|syntastic_id_checkers|'.
If |'syntastic_sort_aggregated_errors'| is set (which is the default), messages
in the aggregated list are grouped by file, then sorted by line number, then
type, then column number. Otherwise messages produced by the same checker are
grouped together.
------------------------------------------------------------------------------
2.6 Filtering errors *syntastic-filtering-errors*
@ -278,6 +285,14 @@ a file with a composite filetype), it might not be immediately obvious which
checker has produced a given error message. This variable instructs syntastic
to label error messages with the names of the checkers that created them. >
let g:syntastic_id_checkers = 0
<
*'syntastic_sort_aggregated_errors'*
Default: 1
By default, when |syntastic_aggregate_errors| is enabled, errors are grouped
by file, then sorted by line number, then grouped by type (namely, errors take
precedence over warnings), then they are sorted by column number. If you want
to leave messages grouped by checker output, set this variable to 0. >
let g:syntastic_sort_aggregated_errors = 0
<
*'syntastic_echo_current_error'*
Default: 1
@ -557,10 +572,10 @@ Use |:SyntasticInfo| to see which checkers are available for a given filetype.
------------------------------------------------------------------------------
5.2 Choosing the executable *syntastic-config-exec*
*'syntastic_<filetype>_<subchecker>_exec'*
*'syntastic_<filetype>_<checker>_exec'*
The executable used by a checker is normally defined automatically, when the
checkers is registered. You can however override it by setting the variable
'g:syntastic_<filetype>_<subchecker>_exec': >
'g:syntastic_<filetype>_<checker>_exec': >
let g:syntastic_ruby_mri_exec = '~/bin/ruby2'
<
------------------------------------------------------------------------------
@ -569,7 +584,7 @@ checkers is registered. You can however override it by setting the variable
Most checkers use the 'makeprgBuild()' function and provide many options by
default - in fact you can customise every part of the command that gets called.
*'syntastic_<filetype>_<subchecker>_<option>'*
*'syntastic_<filetype>_<checker>_<option>'*
Checkers that use 'makeprgBuild()' construct a 'makeprg' like this: >
let makeprg = self.makeprgBuild({
\ 'exe': self.getExec(),
@ -580,7 +595,7 @@ Checkers that use 'makeprgBuild()' construct a 'makeprg' like this: >
The result is a 'makeprg' of the form: >
<exe> <args> <filename> <post_args> <tail>
<
*'syntastic_<filetype>_<subchecker>_exe'*
*'syntastic_<filetype>_<checker>_exe'*
All arguments above are optional, and can be overridden by setting global
variables 'g:syntastic_<filetype>_<checker-name>_<option-name>' - even
parameters not specified in the call to makeprgBuild(). These variables also
@ -598,7 +613,7 @@ To override the args and the tail: >
let g:syntastic_ruby_mri_tail = "> /tmp/my-output-file-biatch"
<
The general form of the override options is: >
syntastic_<filetype>_<subchecker>_<option-name>
syntastic_<filetype>_<checker>_<option-name>
<
For checkers that do not use the 'makeprgBuild()' function you will have to
look at the source code of the checker in question. If there are specific
@ -663,6 +678,23 @@ interactive features of 'fizsh'. Using a more traditional shell such as 'zsh',
'bash', 'ksh', or the original Bourne 'sh' might be a better choice: >
set shell=zsh
<
------------------------------------------------------------------------------
6.5. Interaction with Eclim *syntastic-eclim*
As far as syntastic is concerned there shouldn't be any compatibility problems
with the 'Eclim' Vim plugin (see http://eclim.org/). However, at the time of
this writing there are several reports that 'Eclim' triggers a bug in Vim that
makes syntastic forget some of its configuration parameters. No solutions or
workarounds are known for now.
------------------------------------------------------------------------------
6.6. Interaction with vim-virtualenv *syntastic-vim-virtualenv*
At the time of this writing, syntastic can't run checkers installed
in Python virtual environments activated by 'vim-virtualenv' (see
https://github.com/jmcantrell/vim-virtualenv). This is a limitation of
'vim-virtualenv'.
==============================================================================
7. About *syntastic-about*

View File

@ -18,7 +18,7 @@ if has('reltime')
let g:syntastic_start = reltime()
endif
let g:syntastic_version = '3.4.0'
let g:syntastic_version = '3.4.0-34'
" Sanity checks {{{1
@ -64,6 +64,7 @@ let g:syntastic_defaults = {
\ 'loc_list_height': 10,
\ 'quiet_messages': {},
\ 'reuse_loc_lists': (v:version >= 704),
\ 'sort_aggregated_errors': 1,
\ 'stl_format': '[Syntax: line:%F (%t)]',
\ 'style_error_symbol': 'S>',
\ 'style_warning_symbol': 'S>',
@ -297,6 +298,7 @@ function! s:CacheErrors(checker_names) " {{{2
let filetypes = s:resolveFiletypes()
let aggregate_errors = syntastic#util#var('aggregate_errors')
let decorate_errors = (aggregate_errors || len(filetypes) > 1) && syntastic#util#var('id_checkers')
let sort_aggregated_errors = aggregate_errors && syntastic#util#var('sort_aggregated_errors')
let clist = []
for type in filetypes
@ -352,6 +354,10 @@ function! s:CacheErrors(checker_names) " {{{2
" }}}3
call syntastic#log#debug(g:SyntasticDebugLoclist, 'aggregated:', newLoclist)
if sort_aggregated_errors
call newLoclist.sort()
call syntastic#log#debug(g:SyntasticDebugLoclist, 'sorted:', newLoclist)
endif
endif
let b:syntastic_loclist = newLoclist

View File

@ -13,6 +13,7 @@ function! g:SyntasticChecker.New(args) " {{{2
let newObj._filetype = a:args['filetype']
let newObj._name = a:args['name']
let newObj._exec = get(a:args, 'exec', newObj._name)
let newObj._sort = 0
if has_key(a:args, 'redirect')
let [filetype, name] = split(a:args['redirect'], '/')
@ -68,6 +69,7 @@ function! g:SyntasticChecker.getLocListRaw() " {{{2
call self._populateHighlightRegexes(list)
call syntastic#log#debug(g:SyntasticDebugLoclist, name . ' raw:', list)
call self._quietMessages(list)
call self._sortMessages(list)
return list
endfunction " }}}2
@ -75,6 +77,14 @@ function! g:SyntasticChecker.getLocList() " {{{2
return g:SyntasticLoclist.New(self.getLocListRaw())
endfunction " }}}2
function! g:SyntasticChecker.getWantSort() " {{{2
return self._sort
endfunction " }}}2
function! g:SyntasticChecker.setWantSort(val) " {{{2
let self._sort = a:val
endfunction " }}}2
function! g:SyntasticChecker.makeprgBuild(opts) " {{{2
let basename = self._filetype . '_' . self._name . '_'
@ -121,6 +131,14 @@ function! g:SyntasticChecker._quietMessages(errors) " {{{2
endif
endfunction " }}}2
function! g:SyntasticChecker._sortMessages(errors) " {{{2
" don't sort now if we're going to sort the aggregated list later
if self._sort && !(syntastic#util#var('aggregate_errors') && syntastic#util#var('sort_aggregated_errors'))
call syntastic#util#sortLoclist(a:errors)
call syntastic#log#debug(g:SyntasticDebugLoclist, 'sorted:', a:errors)
endif
endfunction " }}}2
function! g:SyntasticChecker._populateHighlightRegexes(errors) " {{{2
if has_key(self, '_highlightRegexFunc')
for e in a:errors

View File

@ -37,6 +37,10 @@ function! g:SyntasticLoclist.extend(other) " {{{2
return g:SyntasticLoclist.New(list)
endfunction " }}}2
function! g:SyntasticLoclist.sort() " {{{2
call syntastic#util#sortLoclist(self._rawLoclist)
endfunction " }}}2
function! g:SyntasticLoclist.isEmpty() " {{{2
return empty(self._rawLoclist)
endfunction " }}}2

View File

@ -60,6 +60,7 @@ let s:defaultCheckers = {
\ 'pod': ['podchecker'],
\ 'puppet': ['puppet', 'puppetlint'],
\ 'python': ['python', 'flake8', 'pylint'],
\ 'r': [],
\ 'racket': ['racket'],
\ 'rst': ['rst2pseudoxml'],
\ 'ruby': ['mri'],

View File

@ -47,7 +47,7 @@ endfunction
function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_before': (g:syntastic_actionscript_mxmlc_conf != '' ?
\ ' -load-config+=' . g:syntastic_actionscript_mxmlc_conf : ''),
\ ' -load-config+=' . syntastic#util#shexpand(g:syntastic_actionscript_mxmlc_conf) : ''),
\ 'args_after': '-output=' . syntastic#util#DevNull() })
let errorformat =

View File

@ -30,7 +30,6 @@ set cpo&vim
function! SyntaxCheckers_c_oclint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after': '-text',
\ 'post_args_before': '-- -c ' . syntastic#c#ReadConfig(g:syntastic_oclint_config_file) })
let errorformat =
@ -42,12 +41,16 @@ function! SyntaxCheckers_c_oclint_GetLocList() dict
\ '%W%f:%l:%c: warning: %m,' .
\ '%-G%.%#'
return SyntasticMake({
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'postprocess': ['compressWhitespace', 'sort'],
\ 'postprocess': ['compressWhitespace'],
\ 'returns': [0, 3, 5] })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View File

@ -35,8 +35,11 @@ function! SyntaxCheckers_c_splint_GetLocList() dict
let errorformat =
\ '%-G%f:%l:%v: %[%#]%[%#]%[%#] Internal Bug %.%#,' .
\ '%-G%f(%l\,%v): %[%#]%[%#]%[%#] Internal Bug %.%#,' .
\ '%W%f:%l:%v: %m,' .
\ '%W%f(%l\,%v): %m,' .
\ '%W%f:%l: %m,' .
\ '%W%f(%l): %m,' .
\ '%-C %\+In file included from %.%#,' .
\ '%-C %\+from %.%#,' .
\ '%+C %.%#'

View File

@ -43,13 +43,14 @@ function! SyntaxCheckers_css_prettycss_GetLocList() dict
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr("")},
\ 'postprocess': ['sort'] })
\ 'defaults': {'bufnr': bufnr("")} })
for e in loclist
let e["text"] .= ')'
endfor
call self.setWantSort(1)
return loclist
endfunction

View File

@ -19,22 +19,28 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe': self.getExecEscaped() . ' check',
\ 'args': get(g:, 'hdevtools_options', '') })
if exists('g:hdevtools_options')
let g:syntastic_haskell_hdevtools_args = g:hdevtools_options
endif
let errorformat= '\%-Z\ %#,'.
\ '%W%f:%l:%c:\ Warning:\ %m,'.
\ '%W%f:%l:%c:\ Warning:,'.
\ '%E%f:%l:%c:\ %m,'.
\ '%E%>%f:%l:%c:,'.
\ '%+C\ \ %#%m,'.
\ '%W%>%f:%l:%c:,'.
\ '%+C\ \ %#%tarning:\ %m,'
let makeprg = self.makeprgBuild({
\ 'exe_after': 'check',
\ 'fname': syntastic#util#shexpand('%:p') })
let errorformat =
\ '%-Z %#,'.
\ '%W%f:%l:%v: Warning: %m,'.
\ '%W%f:%l:%v: Warning:,'.
\ '%E%f:%l:%v: %m,'.
\ '%E%>%f:%l:%v:,'.
\ '%+C %#%m,'.
\ '%W%>%f:%l:%v:,'.
\ '%+C %#%tarning: %m,'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'vcol': 1},
\ 'postprocess': ['compressWhitespace'] })
endfunction

View File

@ -14,16 +14,18 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_haskell_hlint_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'fname': syntastic#util#shexpand('%:p')})
let errorformat =
\ '%E%f:%l:%c: Error: %m,' .
\ '%W%f:%l:%c: Warning: %m,' .
\ '%E%f:%l:%v: Error: %m,' .
\ '%W%f:%l:%v: Warning: %m,' .
\ '%C%m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'vcol': 1},
\ 'postprocess': ['compressWhitespace'] })
endfunction

View File

@ -0,0 +1,43 @@
"============================================================================
"File: scan.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot 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_haskell_scan_checker')
finish
endif
let g:loaded_syntastic_haskell_scan_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_haskell_scan_GetLocList() dict
let makeprg = self.makeprgBuild({})
let errorformat = '%f:%l:%v: %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style' })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'haskell',
\ 'name': 'scan'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -34,7 +34,8 @@ endfunction
function! SyntaxCheckers_html_jshint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe': expand(g:syntastic_jshint_exec),
\ 'args': (g:syntastic_html_jshint_conf != '' ? '--config ' . g:syntastic_html_jshint_conf : ''),
\ 'args': (g:syntastic_html_jshint_conf != '' ?
\ '--config ' . syntastic#util#shexpand(g:syntastic_html_jshint_conf) : ''),
\ 'args_after': '--verbose --extract always' })
let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)'

View File

@ -10,7 +10,15 @@
"
"============================================================================
"
" Checker option:
" Note: if you need to check HTML5 sources, you might consider installing a
" fork of HTML Tidy, named "HTML Tidy for HTML5":
"
" http://w3c.github.io/tidy-html5/
"
" HTML Tidy for HTML5 can be used without changes by this checker, just install
" it and point g:syntastic_html_tidy_exec to the executable.
"
" Checker options:
"
" - g:syntastic_html_tidy_ignore_errors (list; default: [])
" list of errors to ignore
@ -48,108 +56,108 @@ set cpo&vim
" TODO: join this with xhtml.vim for DRY's sake?
function! s:TidyEncOptByFenc()
let tidy_opts = {
\'utf-8': '-utf8',
\'ascii': '-ascii',
\'latin1': '-latin1',
\'iso-2022-jp': '-iso-2022',
\'cp1252': '-win1252',
\'macroman': '-mac',
\'utf-16le': '-utf16le',
\'utf-16': '-utf16',
\'big5': '-big5',
\'cp932': '-shiftjis',
\'sjis': '-shiftjis',
\'cp850': '-ibm858',
\}
\ 'utf-8': '-utf8',
\ 'ascii': '-ascii',
\ 'latin1': '-latin1',
\ 'iso-2022-jp': '-iso-2022',
\ 'cp1252': '-win1252',
\ 'macroman': '-mac',
\ 'utf-16le': '-utf16le',
\ 'utf-16': '-utf16',
\ 'big5': '-big5',
\ 'cp932': '-shiftjis',
\ 'sjis': '-shiftjis',
\ 'cp850': '-ibm858',
\ }
return get(tidy_opts, &fileencoding, '-utf8')
endfunction
let s:ignore_errors = [
\ "<table> lacks \"summary\" attribute",
\ "not approved by W3C",
\ "<input> proprietary attribute \"placeholder\"",
\ "<meta> proprietary attribute \"charset\"",
\ "<meta> lacks \"content\" attribute",
\ "inserting \"type\" attribute",
\ "proprietary attribute \"data-",
\ "missing <!DOCTYPE> declaration",
\ "inserting implicit <body>",
\ "inserting missing 'title' element",
\ "unescaped & or unknown entity",
\ "<input> attribute \"type\" has invalid value",
\ "proprietary attribute \"role\"",
\ "proprietary attribute \"aria-activedescendant\"",
\ "proprietary attribute \"aria-atomic\"",
\ "proprietary attribute \"aria-autocomplete\"",
\ "proprietary attribute \"aria-busy\"",
\ "proprietary attribute \"aria-checked\"",
\ "proprietary attribute \"aria-controls\"",
\ "proprietary attribute \"aria-describedby\"",
\ "proprietary attribute \"aria-disabled\"",
\ "proprietary attribute \"aria-dropeffect\"",
\ "proprietary attribute \"aria-expanded\"",
\ "proprietary attribute \"aria-flowto\"",
\ "proprietary attribute \"aria-grabbed\"",
\ "proprietary attribute \"aria-haspopup\"",
\ "proprietary attribute \"aria-hidden\"",
\ "proprietary attribute \"aria-invalid\"",
\ "proprietary attribute \"aria-label\"",
\ "proprietary attribute \"aria-labelledby\"",
\ "proprietary attribute \"aria-level\"",
\ "proprietary attribute \"aria-live\"",
\ "proprietary attribute \"aria-multiline\"",
\ "proprietary attribute \"aria-multiselectable\"",
\ "proprietary attribute \"aria-orientation\"",
\ "proprietary attribute \"aria-owns\"",
\ "proprietary attribute \"aria-posinset\"",
\ "proprietary attribute \"aria-pressed\"",
\ "proprietary attribute \"aria-readonly\"",
\ "proprietary attribute \"aria-relevant\"",
\ "proprietary attribute \"aria-relevant\"",
\ "proprietary attribute \"aria-required\"",
\ "proprietary attribute \"aria-selected\"",
\ "proprietary attribute \"aria-setsize\"",
\ "proprietary attribute \"aria-sort\"",
\ "proprietary attribute \"aria-valuemax\"",
\ "proprietary attribute \"aria-valuemin\"",
\ "proprietary attribute \"aria-valuenow\"",
\ "proprietary attribute \"aria-valuetext\""
\ ]
\ "<table> lacks \"summary\" attribute",
\ "not approved by W3C",
\ "<input> proprietary attribute \"placeholder\"",
\ "<meta> proprietary attribute \"charset\"",
\ "<meta> lacks \"content\" attribute",
\ "inserting \"type\" attribute",
\ "proprietary attribute \"data-",
\ "missing <!DOCTYPE> declaration",
\ "inserting implicit <body>",
\ "inserting missing 'title' element",
\ "unescaped & or unknown entity",
\ "<input> attribute \"type\" has invalid value",
\ "proprietary attribute \"role\"",
\ "proprietary attribute \"aria-activedescendant\"",
\ "proprietary attribute \"aria-atomic\"",
\ "proprietary attribute \"aria-autocomplete\"",
\ "proprietary attribute \"aria-busy\"",
\ "proprietary attribute \"aria-checked\"",
\ "proprietary attribute \"aria-controls\"",
\ "proprietary attribute \"aria-describedby\"",
\ "proprietary attribute \"aria-disabled\"",
\ "proprietary attribute \"aria-dropeffect\"",
\ "proprietary attribute \"aria-expanded\"",
\ "proprietary attribute \"aria-flowto\"",
\ "proprietary attribute \"aria-grabbed\"",
\ "proprietary attribute \"aria-haspopup\"",
\ "proprietary attribute \"aria-hidden\"",
\ "proprietary attribute \"aria-invalid\"",
\ "proprietary attribute \"aria-label\"",
\ "proprietary attribute \"aria-labelledby\"",
\ "proprietary attribute \"aria-level\"",
\ "proprietary attribute \"aria-live\"",
\ "proprietary attribute \"aria-multiline\"",
\ "proprietary attribute \"aria-multiselectable\"",
\ "proprietary attribute \"aria-orientation\"",
\ "proprietary attribute \"aria-owns\"",
\ "proprietary attribute \"aria-posinset\"",
\ "proprietary attribute \"aria-pressed\"",
\ "proprietary attribute \"aria-readonly\"",
\ "proprietary attribute \"aria-relevant\"",
\ "proprietary attribute \"aria-relevant\"",
\ "proprietary attribute \"aria-required\"",
\ "proprietary attribute \"aria-selected\"",
\ "proprietary attribute \"aria-setsize\"",
\ "proprietary attribute \"aria-sort\"",
\ "proprietary attribute \"aria-valuemax\"",
\ "proprietary attribute \"aria-valuemin\"",
\ "proprietary attribute \"aria-valuenow\"",
\ "proprietary attribute \"aria-valuetext\""
\ ]
let s:blocklevel_tags = [
\ "main",
\ "section",
\ "article",
\ "aside",
\ "header",
\ "footer",
\ "nav",
\ "figure",
\ "figcaption"
\ ]
\ "main",
\ "section",
\ "article",
\ "aside",
\ "header",
\ "footer",
\ "nav",
\ "figure",
\ "figcaption"
\ ]
let s:inline_tags = [
\ "video",
\ "audio",
\ "source",
\ "embed",
\ "mark",
\ "progress",
\ "meter",
\ "time",
\ "ruby",
\ "rt",
\ "rp",
\ "canvas",
\ "command",
\ "details",
\ "datalist"
\ ]
\ "video",
\ "audio",
\ "source",
\ "embed",
\ "mark",
\ "progress",
\ "meter",
\ "time",
\ "ruby",
\ "rt",
\ "rp",
\ "canvas",
\ "command",
\ "details",
\ "datalist"
\ ]
let s:empty_tags = [
\ "wbr",
\ "keygen"
\ ]
\ "wbr",
\ "keygen"
\ ]
function! s:IgnoreError(text)
for i in s:ignore_errors + g:syntastic_html_tidy_ignore_errors

View File

@ -37,8 +37,9 @@ function! SyntaxCheckers_java_checkstyle_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after': '-cp ' . g:syntastic_java_checkstyle_classpath .
\ ' com.puppycrawl.tools.checkstyle.Main -c ' . g:syntastic_java_checkstyle_conf_file .
\ ' -f xml',
\ ' com.puppycrawl.tools.checkstyle.Main -c ' .
\ syntastic#util#shexpand(g:syntastic_java_checkstyle_conf_file) .
\ ' -f xml',
\ 'fname': fname })
let errorformat = '%f:%t:%l:%c:%m'

View File

@ -43,7 +43,7 @@ let s:save_cpo = &cpo
set cpo&vim
function! s:CygwinPath(path)
return substitute(system("cygpath -m " . a:path), '\n', '', 'g')
return substitute(system("cygpath -m " . syntastic#util#shescape(a:path)), '\n', '', 'g')
endfunction
if !exists("g:syntastic_java_javac_temp_dir")
@ -123,8 +123,8 @@ function! s:SplitClasspath(classpath)
endfunction
function! s:LoadConfigFile()
if filereadable(g:syntastic_java_javac_config_file)
exe 'source '.g:syntastic_java_javac_config_file
if filereadable(expand(g:syntastic_java_javac_config_file))
exe 'source ' . fnameescape(expand(g:syntastic_java_javac_config_file))
endif
endfunction
@ -137,9 +137,9 @@ function! s:SaveClasspath()
endfor
" save classpath to config file
if g:syntastic_java_javac_config_file_enabled
if filereadable(g:syntastic_java_javac_config_file)
if filereadable(expand(g:syntastic_java_javac_config_file))
" load lines from config file
let lines = readfile(g:syntastic_java_javac_config_file)
let lines = readfile(expand(g:syntastic_java_javac_config_file))
" strip g:syntastic_java_javac_classpath options from config file lines
let i = 0
while i < len(lines)
@ -155,7 +155,7 @@ function! s:SaveClasspath()
" add new g:syntastic_java_javac_classpath option to config
call add(lines, 'let g:syntastic_java_javac_classpath = "'.path.'"')
" save config file lines
call writefile(lines, g:syntastic_java_javac_config_file)
call writefile(lines, expand(g:syntastic_java_javac_config_file))
endif
" set new classpath
let g:syntastic_java_javac_classpath = path
@ -192,7 +192,7 @@ function! s:SaveConfig()
let lines = getline(1, line('$'))
if g:syntastic_java_javac_config_file_enabled
" save config file lines
call writefile(lines, g:syntastic_java_javac_config_file)
call writefile(lines, expand(g:syntastic_java_javac_config_file))
endif
let &modified = 0
endfunction
@ -202,8 +202,8 @@ function! s:EditConfig()
let winnr = bufwinnr('^' . command . '$')
if winnr < 0
let lines = []
if filereadable(g:syntastic_java_javac_config_file)
let lines = readfile(g:syntastic_java_javac_config_file)
if filereadable(expand(g:syntastic_java_javac_config_file))
let lines = readfile(expand(g:syntastic_java_javac_config_file))
endif
execute (len(lines) + 5) . 'sp ' . fnameescape(command)
@ -329,7 +329,7 @@ function! s:MavenOutputDirectory()
endif
if has('win32unix')
let output_dir=s:CygwinPath(output_dir)
let output_dir = s:CygwinPath(output_dir)
endif
return output_dir
endif
@ -408,7 +408,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
let fname = fnameescape(expand ( '%:p:h' ) . sep . expand ( '%:t' ))
if has('win32unix')
let fname = s:CygwinPath(fname)
let fname = s:CygwinPath(fname)
endif
let makeprg = self.makeprgBuild({

View File

@ -21,22 +21,31 @@ endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_eslint_IsAvailable() dict
return
\ executable('eslint') &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion('eslint --version'), [0, 1])
endfunction
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args': (g:syntastic_javascript_eslint_conf != '' ? '--config ' . g:syntastic_javascript_eslint_conf : '') })
\ 'args_before': '-f compact',
\ 'args': (g:syntastic_javascript_eslint_conf != '' ?
\ '--config ' . syntastic#util#shexpand(g:syntastic_javascript_eslint_conf) : '') })
let errorformat =
\ '%E%f: line %l\, col %c\, Error - %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['sort'] })
\ 'errorformat': errorformat })
for e in loclist
let e['col'] += 1
endfor
call self.setWantSort(1)
return loclist
endfunction

View File

@ -19,14 +19,19 @@ set cpo&vim
function! SyntaxCheckers_javascript_jscs_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '--no-colors --reporter checkstyle' })
let errorformat = '%f:%t:%l:%c:%m'
return SyntasticMake({
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'preprocess': 'checkstyle',
\ 'postprocess': ['sort'],
\ 'returns': [0, 2] })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View File

@ -25,19 +25,22 @@ function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
if !exists('g:syntastic_jshint_exec')
let g:syntastic_jshint_exec = self.getExec()
endif
return executable(expand(g:syntastic_jshint_exec))
if !executable(expand(g:syntastic_jshint_exec))
return 0
endif
let s:jshint_version = syntastic#util#getVersion(syntastic#util#shexpand(g:syntastic_jshint_exec) . ' --version')
return syntastic#util#versionIsAtLeast(s:jshint_version, [1])
endfunction
function! SyntaxCheckers_javascript_jshint_GetLocList() dict
let exe = syntastic#util#shexpand(g:syntastic_jshint_exec)
if !exists('s:jshint_new')
let s:jshint_new =
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [1, 1])
let s:jshint_new = syntastic#util#versionIsAtLeast(s:jshint_version, [1, 1])
endif
let makeprg = self.makeprgBuild({
\ 'exe': exe,
\ 'args': (g:syntastic_javascript_jshint_conf != '' ? '--config ' . g:syntastic_javascript_jshint_conf : ''),
\ 'exe': syntastic#util#shexpand(g:syntastic_jshint_exec),
\ 'args': (g:syntastic_javascript_jshint_conf != '' ?
\ '--config ' . syntastic#util#shexpand(g:syntastic_javascript_jshint_conf) : ''),
\ 'args_after': (s:jshint_new ? '--verbose ' : '') })
let errorformat = s:jshint_new ?

View File

@ -23,7 +23,8 @@ set cpo&vim
function! SyntaxCheckers_javascript_jsl_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args': (g:syntastic_javascript_jsl_conf != '' ? '-conf ' . g:syntastic_javascript_jsl_conf : ''),
\ 'args': (g:syntastic_javascript_jsl_conf != '' ?
\ '-conf ' . syntastic#util#shexpand(g:syntastic_javascript_jsl_conf) : ''),
\ 'args_after': '-nologo -nofilelisting -nosummary -nocontext -process' })
let errorformat =

View File

@ -18,10 +18,6 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_jsxhint_IsAvailable() dict
if !executable('jshint') || !syntastic#util#versionIsAtLeast(syntastic#util#getVersion('jshint --version'), [1, 1])
return 0
endif
let jsxhint_version = system(self.getExecEscaped() . ' --version')
return
\ v:shell_error == 0 &&

View File

@ -32,8 +32,7 @@ function! SyntaxCheckers_python_pylama_GetLocList() dict
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['sort'] })
\ 'errorformat': errorformat })
" adjust for weirdness in each checker
for e in loclist
@ -53,6 +52,8 @@ function! SyntaxCheckers_python_pylama_GetLocList() dict
endif
endfor
call self.setWantSort(1)
return loclist
endfunction

View File

@ -32,10 +32,9 @@ function! SyntaxCheckers_python_pylint_GetLocList() dict
\ '%-Z%p^%.%#,' .
\ '%-G%.%#'
let loclist=SyntasticMake({
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'postprocess': ['sort'],
\ 'returns': range(32) })
for e in loclist
@ -55,6 +54,8 @@ function! SyntaxCheckers_python_pylint_GetLocList() dict
let e['vcol'] = 0
endfor
call self.setWantSort(1)
return loclist
endfunction
@ -63,9 +64,10 @@ 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".
" On NixOS, that would be ".pylint-wrapped 0.26.0", that would be.
" On NixOS, that would be ".pylint-wrapped 0.26.0".
" On Arch Linux it's "pylint2 1.1.0".
" Have you guys considered switching to creative writing yet? ;)
let pylint_version = filter(split(system(exe . ' --version'), '\m, \=\|\n'), 'v:val =~# ''\m^\.\=pylint\>''')[0]
let pylint_version = filter(split(system(exe . ' --version'), '\m, \=\|\n'), 'v:val =~# ''\m^\.\=pylint[-0-9]*\>''')[0]
let pylint_version = substitute(pylint_version, '\v^\S+\s+', '', '')
let ret = syntastic#util#versionIsAtLeast(syntastic#util#parseVersion(pylint_version), [1])
catch /\m^Vim\%((\a\+)\)\=:E684/

View File

@ -0,0 +1,78 @@
"============================================================================
"File: lint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot 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_r_lint_checker")
finish
endif
let g:loaded_syntastic_r_lint_checker = 1
if !exists('g:syntastic_r_lint_styles')
let g:syntastic_r_lint_styles = 'lint.style'
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_r_lint_GetHighlightRegex(item)
let term = matchstr(a:item['text'], '\m`\zs[^`]\+\ze`')
if term == ''
let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
endif
return term != '' ? '\V' . escape(term, '\') : ''
endfunction
function! SyntaxCheckers_r_lint_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
call system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(lint)'))
return v:shell_error == 0
endfunction
function! SyntaxCheckers_r_lint_GetLocList() dict
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
\ ' -e ' . syntastic#util#shescape('library(lint); try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') .
\ ' --args ' . syntastic#util#shexpand('%')
let errorformat =
\ '%t:%f:%l:%v: %m,' .
\ '%t:%f:%l: %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'preprocess': 'rparse',
\ 'returns': [0] })
for e in loclist
if e['type'] == 'F'
" parse error
let e['type'] = 'E'
call remove(e, 'subtype')
endif
endfor
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'r',
\ 'name': 'lint',
\ 'exec': 'R' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -0,0 +1,77 @@
"============================================================================
"File: svtools.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot 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.
"
"============================================================================
"
" Security:
"
" This checker runs the code in your file. This is probably fine if you
" wrote the file yourself, but it can be a problem if you're trying to
" check third party files. If you are 100% willing to let Vim run the
" code in your file, set g:syntastic_enable_r_svtools_checker to 1 in
" your vimrc to enable this checker:
"
" let g:syntastic_enable_r_svtools_checker = 1
if exists("g:loaded_syntastic_r_svtools_checker")
finish
endif
let g:loaded_syntastic_r_svtools_checker = 1
if !exists('g:syntastic_r_svtools_styles')
let g:syntastic_r_svtools_styles = 'lint.style'
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_r_svtools_GetHighlightRegex(item)
let term = matchstr(a:item['text'], "\\m'\\zs[^']\\+\\ze'")
return term != '' ? '\V' . escape(term, '\') : ''
endfunction
function! SyntaxCheckers_r_svtools_IsAvailable() dict
if !executable(self.getExec())
return 0
endif
call system(self.getExecEscaped() . ' --slave --restore --no-save -e ' . syntastic#util#shescape('library(svTools)'))
return v:shell_error == 0
endfunction
function! SyntaxCheckers_r_svtools_GetLocList() dict
if !exists('g:syntastic_enable_r_svtools_checker') || !g:syntastic_enable_r_svtools_checker
call syntastic#log#error('checker r/svtools: checks disabled for security reasons; set g:syntastic_enable_r_svtools_checker to 1 to override')
return []
endif
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
\ ' -e ' . syntastic#util#shescape('library(svTools); ' .
\ 'try(lint(commandArgs(TRUE), filename = commandArgs(TRUE), type = "flat", sep = ":"))') .
\ ' --args ' . syntastic#util#shexpand('%')
let errorformat =
\ '%trror:%f:%\s%#%l:%\s%#%v:%m,' .
\ '%tarning:%f:%\s%#%l:%\s%#%v:%m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'returns': [0] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'r',
\ 'name': 'svtools',
\ 'exec': 'R' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -38,13 +38,14 @@ function! SyntaxCheckers_racket_code_ayatollah_GetLocList() dict
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'postprocess': ['sort'] })
\ 'subtype': 'Style' })
for e in loclist
let e['col'] += 1
endfor
call self.setWantSort(1)
return loclist
endfunction

View File

@ -45,11 +45,14 @@ function! SyntaxCheckers_tex_chktex_GetLocList() dict
\ '%Z%p^,' .
\ '%-G%.%#'
return SyntasticMake({
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style',
\ 'postprocess': ['sort'] })
\ 'subtype': 'Style' })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View File

@ -23,11 +23,14 @@ function! SyntaxCheckers_typescript_tsc_GetLocList() dict
\ '%Eerror %m,' .
\ '%C%\s%\+%m'
return SyntasticMake({
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': {'bufnr': bufnr("")},
\ 'postprocess': ['sort'] })
\ 'defaults': {'bufnr': bufnr("")} })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({

View File

@ -36,14 +36,9 @@ function! SyntaxCheckers_vim_vimlint_GetHighlightRegex(item)
endfunction
function! SyntaxCheckers_vim_vimlint_IsAvailable() dict
let ret = 0
try
call vimlint#vimlint(syntastic#util#DevNull(), { 'output': [], 'quiet': 1 })
let ret = 1
catch /\m^Vim\%((\a\+)\)\=:E117/
" do nothing
endtry
return ret
return
\ globpath(&runtimepath, 'autoload/vimlparser.vim') != '' &&
\ globpath(&runtimepath, 'autoload/vimlint.vim') != ''
endfunction
function! SyntaxCheckers_vim_vimlint_GetLocList() dict

View File

@ -30,19 +30,19 @@ set cpo&vim
" TODO: join this with html.vim DRY's sake?
function! s:TidyEncOptByFenc()
let tidy_opts = {
\'utf-8': '-utf8',
\'ascii': '-ascii',
\'latin1': '-latin1',
\'iso-2022-jp': '-iso-2022',
\'cp1252': '-win1252',
\'macroman': '-mac',
\'utf-16le': '-utf16le',
\'utf-16': '-utf16',
\'big5': '-big5',
\'cp932': '-shiftjis',
\'sjis': '-shiftjis',
\'cp850': '-ibm858',
\}
\ 'utf-8': '-utf8',
\ 'ascii': '-ascii',
\ 'latin1': '-latin1',
\ 'iso-2022-jp': '-iso-2022',
\ 'cp1252': '-win1252',
\ 'macroman': '-mac',
\ 'utf-16le': '-utf16le',
\ 'utf-16': '-utf16',
\ 'big5': '-big5',
\ 'cp932': '-shiftjis',
\ 'sjis': '-shiftjis',
\ 'cp850': '-ibm858',
\ }
return get(tidy_opts, &fileencoding, '-utf8')
endfunction

View File

@ -0,0 +1,42 @@
"============================================================================
"File: plutil.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: LCD 47 <lcd047 at gmail dot 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_xml_plutil_checker")
finish
endif
let g:loaded_syntastic_xml_plutil_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_xml_plutil_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_before': '-lint -s',
\ 'fname_before': '--' })
let errorformat =
\ '%E%f: %m at line %l'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'returns': [0, 1] })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'xml',
\ 'name': 'plutil'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4: