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-07-02 12:18:18 +01:00
parent 6a16a9393c
commit 1dba960b75
156 changed files with 2657 additions and 1234 deletions

View File

@ -1,49 +1,105 @@
# Bug reports / Github issues
# CONTRIBUTING
- - -
1\. [Bug reports / GitHub issues](#bugreps)
2\. [Submitting a patch](#patches)
3\. [General style notes](#generalstyle)
4\. [Syntax checker notes](#checkerstyle)
- - -
When reporting a bug make sure you search the existing github issues for the
same/similar issues. If you find one, feel free to add a `+1` comment with any
additional information that may help us solve the issue.
<a name="bugreps"></a>
## 1. Bug reports / GitHub issues
Please note that the preferred channel for posting bug reports is the
[issue tracker at GitHub][0]. Reports posted elsewhere are less likely
to be seen by the core team.
When reporting a bug make sure you search the existing GitHub issues
for the same/similar issues. If you find one, feel free to add a `+1`
comment with any additional information that may help us solve the
issue.
When creating a new issue be sure to state the following:
* Steps to reproduce the bug.
* The version of vim you are using.
* The version of syntastic you are using.
* steps to reproduce the bug;
* the version of Vim you are using (run `:ver` to find out);
* the version of syntastic you are using (see `:SyntasticInfo`).
For syntax checker bugs also state the version of the checker executable that you are using.
For syntax checker bugs also state the version of the checker executable
that you are using. Adding debugging information is typically useful
too:
# Submitting a patch
* open a file handled by your checker;
* set `g:syntastic_debug` to 1 or 3;
* run the checker;
* copy the output of `:mes`.
* Fork the repo on github
* Make a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches) and start hacking
* Submit a pull request based off your topic branch
<a name="patches"></a>
Small focused patches are preferred.
## 2. Submitting a patch
Large changes to the code should be discussed with the core team first. Create an issue and explain your plan and see what we say.
Before you consider adding features to syntastic, _please_ spend a few
minutes (re-)reading the latest version of the [manual][1]. Syntastic
is changing rapidly at times, and it's quite possible that some of the
features you want to add exist already.
# General style notes
To submit a patch:
Following the coding conventions/styles used in the syntastic core:
* fork the [repo][2] on GitHub;
* make a [topic branch][3] and start hacking;
* submit a pull request based off your topic branch.
* 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/extractVariable.html) to aid readability.
Small, focused patches are preferred.
# Syntax checker style notes
Large changes to the code should be discussed with the core team first.
Create an issue and explain your plan and see what we say.
The preferred style for error format strings is one "clause" per line. E.g.
(from the coffeelint checker):
Also make sure to update the manual whenever applicable. Nobody can use
features that aren't documented.
```viml
let errorformat = '%E%f:%l:%c: %trror: %m,' .
\ 'Syntax%trror: In %f\, %m on line %l,' .
\ '%EError: In %f\, Parse error on line %l: %m,' .
\ '%EError: In %f\, %m on line %l,' .
\ '%W%f(%l): lint warning: %m,' .
\ '%W%f(%l): warning: %m,' .
\ '%E%f(%l): SyntaxError: %m,' .
\ '%-Z%p^,' .
\ '%-G%.%#'
<a name="generalstyle"></a>
## 3. General style notes
Follow 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][4] to
aid readability.
<a name="checkerstyle"></a>
## 4. Syntax checker notes
Make sure to read the [guide][5] if you plan to add new syntax checkers.
Use the existing checkers as templates, rather than writing everything
from scratch.
The preferred style for error format strings is one "clause" per line.
E.g. (from the `coffee` checker):
```vim
let errorformat =
\ '%E%f:%l:%c: %trror: %m,' .
\ 'Syntax%trror: In %f\, %m on line %l,' .
\ '%EError: In %f\, Parse error on line %l: %m,' .
\ '%EError: In %f\, %m on line %l,' .
\ '%W%f(%l): lint warning: %m,' .
\ '%W%f(%l): warning: %m,' .
\ '%E%f(%l): SyntaxError: %m,' .
\ '%-Z%p^,' .
\ '%-G%.%#'
```
[0]: https://github.com/scrooloose/syntastic/issues
[1]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt
[2]: https://github.com/scrooloose/syntastic
[3]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches
[4]: http://www.refactoring.com/catalog/extractVariable.html
[5]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide

View File

@ -35,16 +35,16 @@ the user is notified and is happy because they didn't have to compile their
code or execute their script to find them.
At the time of this writing, syntax checking plugins exist for ActionScript,
Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bourne shell, C, C++, C#, Chef,
CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir,
Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe,
Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal,
Chef, 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, 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.
lists, Puppet, Python, Racket, R, reStructuredText, 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.
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
@ -76,9 +76,8 @@ First I'll show you how to install Tim Pope's [pathogen][1] so that it's easy to
install syntastic. Do this in your terminal so that you get the `pathogen.vim`
file and the directories it needs:
```sh
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -so ~/.vim/autoload/pathogen.vim \
https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
```
Next you *need* to add this to your `~/.vimrc`:
```vim
@ -92,7 +91,7 @@ execute pathogen#infect()
You now have pathogen installed and can put syntastic into `~/.vim/bundle` like
this:
```sh
cd ~/.vim/bundle
cd ~/.vim/bundle && \
git clone https://github.com/scrooloose/syntastic.git
```
Quit vim and start it back up to reload it, then type:
@ -143,6 +142,14 @@ still producing useful results, the checker is now disabled by default. To
let g:syntastic_enable_perl_checker = 1
```
<a name="faqrust"></a>
__Q. What happened to the `rustc` checker?__
A. It has been included in the [Rust compiler package][12]. If you have
a recent version of the Rust compiler, the checker should be picked up
automatically by syntastic.
<a name="faqloclist"></a>
__Q. I run a checker and the location list is not updated...__
@ -272,8 +279,10 @@ cabbrev <silent> bd lclose\|bdelete
## 4\. Other resources
The preferred place for posting suggestions, reporting bugs, and general
discussions related to syntastic is the [issue tracker at GitHub][4]. There
are also a [google group][5], and a [syntastic tag at StackOverflow][6].
discussions related to syntastic is the [issue tracker at GitHub][4].
A guide for writing syntax checkers can be found in the [wiki][11].
There are also a dedicated [google group][5], and a
[syntastic tag at StackOverflow][6].
Syntastic aims to provide a common interface to syntax checkers for as many
languages as possible. For particular languages, there are, of course, other
@ -291,3 +300,5 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9].
[8]: https://github.com/klen/python-mode
[9]: http://valloric.github.io/YouCompleteMe/
[10]: http://perldoc.perl.org/perlrun.html#*-c*
[11]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide
[12]: https://github.com/rust-lang/rust/

View File

@ -180,7 +180,7 @@ endfunction " }}}2
function! s:getIncludeDirs(filetype) " {{{2
let include_dirs = []
if a:filetype =~# '\v^%(c|cpp|d|objc|objcpp)$' &&
if a:filetype =~# '\v^%(c|cpp|objc|objcpp)$' &&
\ (!exists('g:syntastic_'.a:filetype.'_no_default_include_dirs') ||
\ !g:syntastic_{a:filetype}_no_default_include_dirs)
let include_dirs = copy(s:default_includes)

View File

@ -6,7 +6,7 @@ let g:loaded_syntastic_log_autoload = 1
let s:save_cpo = &cpo
set cpo&vim
let s:deprecation_notices_issued = []
let s:one_time_notices_issued = []
" Public functions {{{1
@ -27,15 +27,39 @@ function! syntastic#log#error(msg) " {{{2
echohl None
endfunction " }}}2
function! syntastic#log#deprecationWarn(msg) " {{{2
if index(s:deprecation_notices_issued, a:msg) >= 0
function! syntastic#log#oneTimeWarn(msg) " {{{2
if index(s:one_time_notices_issued, a:msg) >= 0
return
endif
call add(s:deprecation_notices_issued, a:msg)
call add(s:one_time_notices_issued, a:msg)
call syntastic#log#warn(a:msg)
endfunction " }}}2
" @vimlint(EVL102, 1, l:OLD_VAR)
function! syntastic#log#deprecationWarn(old, new, ...) " {{{2
if exists('g:syntastic_' . a:old) && !exists('g:syntastic_' . a:new)
let msg = 'variable g:syntastic_' . a:old . ' is deprecated, please use '
if a:0
let OLD_VAR = g:syntastic_{a:old}
try
let NEW_VAR = eval(a:1)
let msg .= 'in its stead: let g:syntastic_' . a:new . ' = ' . string(NEW_VAR)
let g:syntastic_{a:new} = NEW_VAR
catch
let msg .= 'g:syntastic_' . a:new . ' instead'
endtry
else
let msg .= 'g:syntastic_' . a:new . ' instead'
let g:syntastic_{a:new} = g:syntastic_{a:old}
endif
call syntastic#log#oneTimeWarn(msg)
endif
endfunction " }}}2
" @vimlint(EVL102, 0, l:OLD_VAR)
function! syntastic#log#debug(level, msg, ...) " {{{2
if !s:isDebugEnabled(a:level)
return
@ -113,6 +137,7 @@ function! s:isDebugEnabled_dumb(level) " {{{2
endfunction " }}}2
let s:isDebugEnabled = function(exists('*and') ? 's:isDebugEnabled_smart' : 's:isDebugEnabled_dumb')
lockvar s:isDebugEnabled
function! s:logRedirect(on) " {{{2
if exists("g:syntastic_debug_file")
@ -138,6 +163,7 @@ function! s:logTimestamp_dumb() " {{{2
endfunction " }}}2
let s:logTimestamp = function(has('reltime') ? 's:logTimestamp_smart' : 's:logTimestamp_dumb')
lockvar s:logTimestamp
function! s:formatVariable(name) " {{{2
let vals = []

View File

@ -14,6 +14,8 @@ function! syntastic#postprocess#compressWhitespace(errors) " {{{2
let e['text'] = substitute(e['text'], "\001", '', 'g')
let e['text'] = substitute(e['text'], '\n', ' ', 'g')
let e['text'] = substitute(e['text'], '\m\s\{2,}', ' ', 'g')
let e['text'] = substitute(e['text'], '\m^\s\+', '', '')
let e['text'] = substitute(e['text'], '\m\s\+$', '', '')
endfor
return a:errors

View File

@ -8,6 +8,26 @@ set cpo&vim
" Public functions {{{1
function! syntastic#preprocess#cabal(errors) " {{{2
let out = []
let star = 0
for err in a:errors
if star
if err == ''
let star = 0
else
let out[-1] .= ' ' . err
endif
else
call add(out, err)
if err =~ '\m^*\s'
let star = 1
endif
endif
endfor
return out
endfunction " }}}2
function! syntastic#preprocess#checkstyle(errors) " {{{2
let out = []
let fname = expand('%')
@ -95,6 +115,10 @@ function! syntastic#preprocess#rparse(errors) " {{{2
return out
endfunction " }}}2
function! syntastic#preprocess#tslint(errors) " {{{2
return map(copy(a:errors), 'substitute(v:val, ''\m^\(([^)]\+)\)\s\(.\+\)$'', ''\2 \1'', "")')
endfunction " }}}2
function! syntastic#preprocess#validator(errors) " {{{2
let out = []
for e in a:errors

View File

@ -88,6 +88,7 @@ endfunction " }}}2
" strwidth() was added in Vim 7.3; if it doesn't exist, we use strlen()
" and hope for the best :)
let s:width = function(exists('*strwidth') ? 'strwidth' : 'strlen')
lockvar s:width
"print as much of a:msg as possible without "Press Enter" prompt appearing
function! syntastic#util#wideMsg(msg) " {{{2

View File

@ -38,9 +38,10 @@ CONTENTS *syntastic-contents*
6.1.Handling of composite filetypes........|syntastic-composite|
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|
6.4.Interaction with PowerShell............|syntastic-powershell|
6.5.Using syntastic with the fizsh shell...|syntastic-fizsh|
6.6.Interaction with Eclim.................|syntastic-eclim|
6.7.Interaction with vim-virtualenv........|syntastic-vim-virtualenv|
7.About........................................|syntastic-about|
8.License......................................|syntastic-license|
@ -83,7 +84,7 @@ see |syntastic-checker-options| for details. You can also change the arguments
passed to a specific checker as well.
Use |:SyntasticCheck| to manually check right now. Use |:SyntasticToggleMode|
to switch between active (checking on writting the buffer) and passive (manual)
to switch between active (checking on writing the buffer) and passive (manual)
checking.
==============================================================================
@ -93,7 +94,7 @@ Syntax checking can be done automatically or on demand (see
|'syntastic_mode_map'| and |:SyntasticToggleMode| for configuring this).
When syntax checking is done, the features below can be used to notify the
user of errors. See |syntastic-options| for how to configure and
user of errors. See |syntastic-global-options| for how to configure and
activate/deactivate these features.
* A statusline flag
@ -169,6 +170,8 @@ and the SpellCap group is used for warnings. If you wish to customize the
colors for highlighting you can use the following groups:
SyntasticError - Links to 'SpellBad' by default
SyntasticWarning - Links to 'SpellCap' by default
SyntasticStyleError - Links to SyntasticError by default
SyntasticStyleWarning - Links to SyntasticWarning by default
Example: >
highlight SyntasticError guibg=#2f0000
@ -288,10 +291,12 @@ to label error messages with the names of the checkers that created them. >
<
*'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. >
By default, when results from multiple checkers are aggregated in a single
error list (that is either when |syntastic_aggregate_errors| is enabled, or
when checking a file with a composite filetype), 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'*
@ -593,7 +598,7 @@ Checkers that use 'makeprgBuild()' construct a 'makeprg' like this: >
\ 'tail': '> /tmp/output' })
<
The result is a 'makeprg' of the form: >
<exe> <args> <filename> <post_args> <tail>
<exe> <args> <fname> <post_args> <tail>
<
*'syntastic_<filetype>_<checker>_exe'*
All arguments above are optional, and can be overridden by setting global
@ -666,7 +671,16 @@ traditional shell, such as 'zsh', 'bash', 'ksh', or even the original Bourne
set shell=bash
<
------------------------------------------------------------------------------
6.4. Using syntastic with the fizsh shell *syntastic-fizsh*
6.4. Interaction with PowerShell *syntastic-powershell*
At the time of this writing, syntastic is not compatible with using 'Windows
PowerShell' (http://technet.microsoft.com/en-us/library/bb978526.aspx) as Vim's
'shell'. You may still run Vim from 'PowerShell', but you do have to point
Vim's 'shell' to a more traditional program, such as 'cmd.exe': >
set shell=cmd.exe
<
------------------------------------------------------------------------------
6.5. Using syntastic with the fizsh shell *syntastic-fizsh*
Using syntastic with the 'fizsh' shell (see https://github.com/zsh-users/fizsh)
is possible, but potentially problematic. In order to do it you'll need to set
@ -679,7 +693,7 @@ interactive features of 'fizsh'. Using a more traditional shell such as 'zsh',
set shell=zsh
<
------------------------------------------------------------------------------
6.5. Interaction with Eclim *syntastic-eclim*
6.6. 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
@ -688,7 +702,7 @@ 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*
6.7. 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

View File

@ -16,9 +16,11 @@ let g:loaded_syntastic_plugin = 1
if has('reltime')
let g:syntastic_start = reltime()
lockvar! g:syntastic_start
endif
let g:syntastic_version = '3.4.0-34'
let g:syntastic_version = '3.4.0-90'
lockvar g:syntastic_version
" Sanity checks {{{1
@ -30,6 +32,8 @@ for s:feature in ['autocmd', 'eval', 'modify_fname', 'quickfix', 'user_commands'
endfor
let s:running_windows = syntastic#util#isRunningWindows()
lockvar s:running_windows
if !s:running_windows && executable('uname')
try
let s:uname = system('uname')
@ -37,6 +41,7 @@ if !s:running_windows && executable('uname')
call syntastic#log#error("your shell " . &shell . " doesn't use traditional UNIX syntax for redirections")
finish
endtry
lockvar s:uname
endif
" }}}1
@ -70,6 +75,7 @@ let g:syntastic_defaults = {
\ 'style_warning_symbol': 'S>',
\ 'warning_symbol': '>>'
\ }
lockvar! g:syntastic_defaults
for s:key in keys(g:syntastic_defaults)
if !exists('g:syntastic_' . s:key)
@ -78,7 +84,7 @@ for s:key in keys(g:syntastic_defaults)
endfor
if exists("g:syntastic_quiet_warnings")
call syntastic#log#deprecationWarn("variable g:syntastic_quiet_warnings is deprecated, please use let g:syntastic_quiet_messages = {'level': 'warnings'} instead")
call syntastic#log#oneTimeWarn("variable g:syntastic_quiet_warnings is deprecated, please use let g:syntastic_quiet_messages = {'level': 'warnings'} instead")
if g:syntastic_quiet_warnings
let s:quiet_warnings = get(g:syntastic_quiet_messages, 'type', [])
if type(s:quiet_warnings) != type([])
@ -106,13 +112,19 @@ let s:debug_dump_options = [
if v:version > 703 || (v:version == 703 && has('patch446'))
call add(s:debug_dump_options, 'shellxescape')
endif
lockvar! s:debug_dump_options
" debug constants
let g:SyntasticDebugTrace = 1
let g:SyntasticDebugLoclist = 2
let g:SyntasticDebugNotifications = 4
let g:SyntasticDebugAutocommands = 8
let g:SyntasticDebugVariables = 16
let g:SyntasticDebugTrace = 1
lockvar g:SyntasticDebugTrace
let g:SyntasticDebugLoclist = 2
lockvar g:SyntasticDebugLoclist
let g:SyntasticDebugNotifications = 4
lockvar g:SyntasticDebugNotifications
let g:SyntasticDebugAutocommands = 8
lockvar g:SyntasticDebugAutocommands
let g:SyntasticDebugVariables = 16
lockvar g:SyntasticDebugVariables
" }}}1
@ -130,7 +142,7 @@ let s:modemap = g:SyntasticModeMap.Instance()
function! s:CompleteCheckerName(argLead, cmdLine, cursorPos) " {{{2
let checker_names = []
for ft in s:resolveFiletypes()
call extend(checker_names, keys(s:registry.getCheckersMap(ft)))
call extend(checker_names, s:registry.getNamesOfAvailableCheckers(ft))
endfor
return join(checker_names, "\n")
endfunction " }}}2
@ -169,11 +181,6 @@ command! SyntasticSetLoclist call g:SyntasticLoclist.current().setloclist()
augroup syntastic
autocmd BufReadPost * call s:BufReadPostHook()
autocmd BufWritePost * call s:BufWritePostHook()
autocmd BufWinEnter * call s:BufWinEnterHook()
" TODO: the next autocmd should be "autocmd BufWinLeave * if &buftype == '' | lclose | endif"
" but in recent versions of Vim lclose can no longer be called from BufWinLeave
autocmd BufEnter * call s:BufEnterHook()
augroup END
@ -198,24 +205,22 @@ function! s:BufWritePostHook() " {{{2
call s:UpdateErrors(1)
endfunction " }}}2
function! s:BufWinEnterHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: BufWinEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
\ ', &buftype = ' . string(&buftype))
if &buftype == ''
call s:notifiers.refresh(g:SyntasticLoclist.current())
endif
endfunction " }}}2
function! s:BufEnterHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: BufEnter, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))) .
\ ', &buftype = ' . string(&buftype))
" TODO: at this point there is no b:syntastic_loclist
let loclist = filter(getloclist(0), 'v:val["valid"] == 1')
let buffers = syntastic#util#unique(map( loclist, 'v:val["bufnr"]' ))
if &buftype == 'quickfix' && !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
call g:SyntasticLoclistHide()
if &buftype == ''
call s:notifiers.refresh(g:SyntasticLoclist.current())
elseif &buftype == 'quickfix'
" TODO: this is needed because in recent versions of Vim lclose
" can no longer be called from BufWinLeave
" TODO: at this point there is no b:syntastic_loclist
let loclist = filter(copy(getloclist(0)), 'v:val["valid"] == 1')
let owner = str2nr(getbufvar(bufnr(""), 'syntastic_owner_buffer'))
let buffers = syntastic#util#unique(map(loclist, 'v:val["bufnr"]') + (owner ? [owner] : []))
if !empty(loclist) && empty(filter( buffers, 'syntastic#util#bufIsActive(v:val)' ))
call SyntasticLoclistHide()
endif
endif
endfunction " }}}2
@ -223,7 +228,7 @@ function! s:QuitPreHook() " {{{2
call syntastic#log#debug(g:SyntasticDebugAutocommands,
\ 'autocmd: QuitPre, buffer ' . bufnr("") . ' = ' . string(bufname(str2nr(bufnr("")))))
let b:syntastic_skip_checks = !g:syntastic_check_on_wq
call g:SyntasticLoclistHide()
call SyntasticLoclistHide()
endfunction " }}}2
" }}}1
@ -278,7 +283,7 @@ endfunction " }}}2
"clear the loc list for the buffer
function! s:ClearCache() " {{{2
call s:notifiers.reset(g:SyntasticLoclist.current())
unlet! b:syntastic_loclist
call b:syntastic_loclist.destroy()
endfunction " }}}2
"detect and cache all syntax errors in this buffer
@ -296,8 +301,8 @@ function! s:CacheErrors(checker_names) " {{{2
" }}}3
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 aggregate_errors = syntastic#util#var('aggregate_errors') || len(filetypes) > 1
let decorate_errors = aggregate_errors && syntastic#util#var('id_checkers')
let sort_aggregated_errors = aggregate_errors && syntastic#util#var('sort_aggregated_errors')
let clist = []
@ -306,8 +311,15 @@ function! s:CacheErrors(checker_names) " {{{2
endfor
let names = []
let unavailable_checkers = 0
for checker in clist
let cname = checker.getFiletype() . '/' . checker.getName()
if !checker.isAvailable()
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Checker ' . cname . ' is not available')
let unavailable_checkers += 1
continue
endif
call syntastic#log#debug(g:SyntasticDebugTrace, 'CacheErrors: Invoking checker: ' . cname)
let loclist = checker.getLocList()
@ -317,6 +329,10 @@ function! s:CacheErrors(checker_names) " {{{2
call loclist.decorate(cname)
endif
call add(names, cname)
if checker.getWantSort() && !sort_aggregated_errors
call loclist.sort()
call syntastic#log#debug(g:SyntasticDebugLoclist, 'sorted:', loclist)
endif
let newLoclist = newLoclist.extend(loclist)
@ -340,7 +356,7 @@ function! s:CacheErrors(checker_names) " {{{2
" }}}3
" issue warning about no active checkers {{{3
if empty(clist)
if len(clist) == unavailable_checkers
if !empty(a:checker_names)
if len(a:checker_names) == 1
call syntastic#log#warn('checker ' . a:checker_names[0] . ' is not available')
@ -360,7 +376,8 @@ function! s:CacheErrors(checker_names) " {{{2
endif
endif
let b:syntastic_loclist = newLoclist
call newLoclist.setOwner(bufnr(''))
call newLoclist.deploy()
endfunction " }}}2
function! s:ToggleMode() " {{{2
@ -550,6 +567,7 @@ endfunction " }}}2
function! s:uname() " {{{2
if !exists('s:uname')
let s:uname = system('uname')
lockvar s:uname
endif
return s:uname
endfunction " }}}2

View File

@ -69,7 +69,6 @@ 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
@ -99,7 +98,10 @@ function! g:SyntasticChecker.makeprgBuild(opts) " {{{2
endfunction " }}}2
function! g:SyntasticChecker.isAvailable() " {{{2
return self._isAvailableFunc()
if !has_key(self, '_available')
let self._available = self._isAvailableFunc()
endif
return self._available
endfunction " }}}2
" }}}1
@ -131,20 +133,12 @@ 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
if e['valid']
let term = self._highlightRegexFunc(e)
if len(term) > 0
if term != ''
let e['hl'] = term
endif
endif

View File

@ -22,7 +22,7 @@ function! g:SyntasticCursorNotifier.refresh(loclist) " {{{2
let b:syntastic_messages = copy(a:loclist.messages(bufnr('')))
let b:oldLine = -1
autocmd! syntastic CursorMoved
autocmd syntastic CursorMoved * call g:SyntasticRefreshCursor()
autocmd syntastic CursorMoved * call SyntasticRefreshCursor()
endif
endfunction " }}}2
@ -40,7 +40,7 @@ endfunction " }}}2
" Private methods {{{1
" The following defensive nonsense is needed because of the nature of autocmd
function! g:SyntasticRefreshCursor() " {{{2
function! SyntasticRefreshCursor() " {{{2
if !exists('b:syntastic_messages') || empty(b:syntastic_messages)
" file not checked
return

View File

@ -5,6 +5,7 @@ let g:loaded_syntastic_notifier_highlighting = 1
" Highlighting requires getmatches introduced in 7.1.040
let s:has_highlighting = v:version > 701 || (v:version == 701 && has('patch040'))
lockvar s:has_highlighting
let g:SyntasticHighlightingNotifier = {}
@ -18,6 +19,7 @@ function! g:SyntasticHighlightingNotifier.New() " {{{2
if !s:setup_done
call self._setup()
let s:setup_done = 1
lockvar s:setup_done
endif
return newObj
@ -35,7 +37,7 @@ function! g:SyntasticHighlightingNotifier.refresh(loclist) " {{{2
let buf = bufnr('')
let issues = filter(a:loclist.copyRaw(), 'v:val["bufnr"] == buf')
for item in issues
let group = item['type'] ==? 'E' ? 'SyntasticError' : 'SyntasticWarning'
let group = 'Syntastic' . get(item, 'subtype', '') . ( item['type'] ==? 'E' ? 'Error' : 'Warning' )
" The function `Syntastic_{filetype}_{checker}_GetHighlightRegex` is
" used to override default highlighting.
@ -80,11 +82,16 @@ function! g:SyntasticHighlightingNotifier._setup() " {{{2
if s:has_highlighting
if !hlexists('SyntasticError')
highlight link SyntasticError SpellBad
endif
if !hlexists('SyntasticWarning')
highlight link SyntasticWarning SpellCap
endif
if !hlexists('SyntasticStyleError')
highlight link SyntasticStyleError SyntasticError
endif
if !hlexists('SyntasticStyleWarning')
highlight link SyntasticStyleWarning SyntasticWarning
endif
endif
endfunction " }}}2

View File

@ -20,12 +20,13 @@ function! g:SyntasticLoclist.New(rawLoclist) " {{{2
let newObj._rawLoclist = llist
let newObj._name = ''
let newObj._owner = bufnr('')
return newObj
endfunction " }}}2
function! g:SyntasticLoclist.current() " {{{2
if !exists("b:syntastic_loclist")
if !exists("b:syntastic_loclist") || empty(b:syntastic_loclist)
let b:syntastic_loclist = g:SyntasticLoclist.New([])
endif
return b:syntastic_loclist
@ -53,6 +54,10 @@ function! g:SyntasticLoclist.getRaw() " {{{2
return self._rawLoclist
endfunction " }}}2
function! g:SyntasticLoclist.getBuffers() " {{{2
return syntastic#util#unique(map(copy(self._rawLoclist), 'str2nr(v:val["bufnr"])') + [self._owner])
endfunction " }}}2
function! g:SyntasticLoclist.getStatuslineFlag() " {{{2
if !exists("self._stl_format")
let self._stl_format = ''
@ -118,6 +123,26 @@ function! g:SyntasticLoclist.setName(name) " {{{2
let self._name = a:name
endfunction " }}}2
function! g:SyntasticLoclist.getOwner() " {{{2
return self._owner
endfunction " }}}2
function! g:SyntasticLoclist.setOwner(buffer) " {{{2
let self._owner = type(a:buffer) == type(0) ? a:buffer : str2nr(a:buffer)
endfunction " }}}2
function! g:SyntasticLoclist.deploy() " {{{2
for buf in self.getBuffers()
call setbufvar(buf, 'syntastic_loclist', self)
endfor
endfunction " }}}2
function! g:SyntasticLoclist.destroy() " {{{2
for buf in self.getBuffers()
call setbufvar(buf, 'syntastic_loclist', {})
endfor
endfunction " }}}2
function! g:SyntasticLoclist.decorate(tag) " {{{2
for e in self._rawLoclist
let e['text'] .= ' [' . a:tag . ']'
@ -216,6 +241,7 @@ function! g:SyntasticLoclist.show() " {{{2
if strpart(title, 0, 16) ==# ':SyntasticCheck ' ||
\ ( (title == '' || title ==# ':setloclist()') && errors == getloclist(0) )
call setwinvar(win, 'quickfix_title', ':SyntasticCheck ' . self._name)
call setbufvar(buf, 'syntastic_owner_buffer', self._owner)
endif
endif
endfor
@ -226,7 +252,7 @@ endfunction " }}}2
" Non-method functions {{{1
function! g:SyntasticLoclistHide() " {{{2
function! SyntasticLoclistHide() " {{{2
call syntastic#log#debug(g:SyntasticDebugNotifications, 'loclist: hide')
silent! lclose
endfunction " }}}2

View File

@ -6,6 +6,7 @@ let g:loaded_syntastic_notifiers = 1
let g:SyntasticNotifiers = {}
let s:notifier_types = ['signs', 'balloons', 'highlighting', 'cursor', 'autoloclist']
lockvar! s:notifier_types
" Public methods {{{1

View File

@ -11,8 +11,10 @@ let s:defaultCheckers = {
\ 'applescript': ['osacompile'],
\ 'asciidoc': ['asciidoc'],
\ 'asm': ['gcc'],
\ 'bro': ['bro'],
\ 'bemhtml': ['bemhtmllint'],
\ 'c': ['gcc'],
\ 'cabal': ['cabal'],
\ 'chef': ['foodcritic'],
\ 'co': ['coco'],
\ 'cobol': ['cobc'],
@ -64,7 +66,6 @@ let s:defaultCheckers = {
\ 'racket': ['racket'],
\ 'rst': ['rst2pseudoxml'],
\ 'ruby': ['mri'],
\ 'rust': ['rustc'],
\ 'sass': ['sass'],
\ 'scala': ['fsc', 'scalac'],
\ 'scss': ['sass', 'scss_lint'],
@ -89,12 +90,14 @@ let s:defaultCheckers = {
\ 'zpt': ['zptlint'],
\ 'zsh': ['zsh', 'shellcheck']
\ }
lockvar! s:defaultCheckers
let s:defaultFiletypeMap = {
\ 'gentoo-metadata': 'xml',
\ 'lhaskell': 'haskell',
\ 'litcoffee': 'coffee'
\ }
lockvar! s:defaultFiletypeMap
let g:SyntasticRegistry = {}
@ -102,14 +105,13 @@ let g:SyntasticRegistry = {}
" Public methods {{{1
" TODO: Handling of filetype aliases: all public methods take aliases as
" Note: Handling of filetype aliases: all public methods take aliases as
" parameters, all private methods take normalized filetypes. Public methods
" are thus supposed to normalize filetypes before calling private methods.
function! g:SyntasticRegistry.Instance() " {{{2
if !exists('s:SyntasticRegistryInstance')
let s:SyntasticRegistryInstance = copy(self)
let s:SyntasticRegistryInstance._checkerRaw = {}
let s:SyntasticRegistryInstance._checkerMap = {}
endif
@ -122,29 +124,23 @@ function! g:SyntasticRegistry.CreateAndRegisterChecker(args) " {{{2
call registry._registerChecker(checker)
endfunction " }}}2
function! g:SyntasticRegistry.isCheckable(ftalias) " {{{2
" Given a list of checker names hints_list, return a map name --> checker.
" If hints_list is empty, user settings are are used instead. Checkers are
" not checked for availability (that is, the corresponding IsAvailable() are
" not run).
function! g:SyntasticRegistry.getCheckers(ftalias, hints_list) " {{{2
let ft = s:normaliseFiletype(a:ftalias)
call self._loadCheckers(ft)
return !empty(self._checkerMap[ft])
endfunction " }}}2
call self._loadCheckersFor(ft)
function! g:SyntasticRegistry.getCheckersMap(ftalias) " {{{2
let ft = s:normaliseFiletype(a:ftalias)
call self._loadCheckers(ft)
return self._checkerMap[ft]
endfunction " }}}2
function! g:SyntasticRegistry.getCheckers(ftalias, list) " {{{2
let checkers_map = self.getCheckersMap(a:ftalias)
let checkers_map = self._checkerMap[ft]
if empty(checkers_map)
return []
endif
let ft = s:normaliseFiletype(a:ftalias)
call self._checkDeprecation(ft)
let names =
\ !empty(a:list) ? a:list :
\ !empty(a:hints_list) ? syntastic#util#unique(a:hints_list) :
\ exists('b:syntastic_checkers') ? b:syntastic_checkers :
\ exists('g:syntastic_' . ft . '_checkers') ? g:syntastic_{ft}_checkers :
\ get(s:defaultCheckers, ft, 0)
@ -153,6 +149,12 @@ function! g:SyntasticRegistry.getCheckers(ftalias, list) " {{{2
\ self._filterCheckersByName(checkers_map, names) : [checkers_map[keys(checkers_map)[0]]]
endfunction " }}}2
" Same as getCheckers(), but keep only the checkers available. This runs the
" corresponding IsAvailable() functions for all checkers.
function! g:SyntasticRegistry.getCheckersAvailable(ftalias, hints_list) " {{{2
return filter(self.getCheckers(a:ftalias, a:hints_list), 'v:val.isAvailable()')
endfunction " }}}2
function! g:SyntasticRegistry.getKnownFiletypes() " {{{2
let types = keys(s:defaultCheckers)
@ -169,8 +171,15 @@ function! g:SyntasticRegistry.getKnownFiletypes() " {{{2
return syntastic#util#unique(types)
endfunction " }}}2
function! g:SyntasticRegistry.getNamesOfAvailableCheckers(ftalias) " {{{2
let ft = s:normaliseFiletype(a:ftalias)
call self._loadCheckersFor(ft)
return keys(filter( copy(self._checkerMap[ft]), 'v:val.isAvailable()' ))
endfunction " }}}2
function! g:SyntasticRegistry.echoInfoFor(ftalias_list) " {{{2
echomsg "Syntastic info for filetype: " . join(a:ftalias_list, '.')
echomsg "Syntastic version: " . g:syntastic_version
echomsg "Info for filetype: " . join(a:ftalias_list, '.')
let ft_list = syntastic#util#unique(map( copy(a:ftalias_list), 's:normaliseFiletype(v:val)' ))
if len(ft_list) != 1
@ -178,13 +187,13 @@ function! g:SyntasticRegistry.echoInfoFor(ftalias_list) " {{{2
let active = []
for ft in ft_list
call extend(available, map( keys(self.getCheckersMap(ft)), 'ft . "/" . v:val' ))
call extend(active, map( self.getCheckers(ft, []), 'ft . "/" . v:val.getName()' ))
call extend(available, map( self.getNamesOfAvailableCheckers(ft), 'ft . "/" . v:val' ))
call extend(active, map( self.getCheckersAvailable(ft, []), 'ft . "/" . v:val.getName()' ))
endfor
else
let ft = ft_list[0]
let available = keys(self.getCheckersMap(ft))
let active = map(self.getCheckers(ft, []), 'v:val.getName()')
let available = self.getNamesOfAvailableCheckers(ft)
let active = map(self.getCheckersAvailable(ft, []), 'v:val.getName()')
endif
echomsg "Available checker(s): " . join(sort(available))
@ -197,52 +206,39 @@ endfunction " }}}2
function! g:SyntasticRegistry._registerChecker(checker) abort " {{{2
let ft = a:checker.getFiletype()
if !has_key(self._checkerRaw, ft)
let self._checkerRaw[ft] = []
if !has_key(self._checkerMap, ft)
let self._checkerMap[ft] = {}
endif
call self._validateUniqueName(a:checker)
let name = a:checker.getName()
call add(self._checkerRaw[ft], name)
if a:checker.isAvailable()
let self._checkerMap[ft][name] = a:checker
if has_key(self._checkerMap[ft], name)
throw 'Syntastic: Duplicate syntax checker name: ' . ft . '/' . name
endif
let self._checkerMap[ft][name] = a:checker
endfunction " }}}2
function! g:SyntasticRegistry._filterCheckersByName(checkers_map, list) " {{{2
return filter( map(copy(a:list), 'get(a:checkers_map, v:val, {})'), '!empty(v:val)' )
endfunction " }}}2
function! g:SyntasticRegistry._loadCheckers(filetype) " {{{2
if has_key(self._checkerRaw, a:filetype)
function! g:SyntasticRegistry._loadCheckersFor(filetype) " {{{2
if has_key(self._checkerMap, a:filetype)
return
endif
execute "runtime! syntax_checkers/" . a:filetype . "/*.vim"
if !has_key(self._checkerRaw, a:filetype)
let self._checkerRaw[a:filetype] = []
if !has_key(self._checkerMap, a:filetype)
let self._checkerMap[a:filetype] = {}
endif
endfunction " }}}2
function! g:SyntasticRegistry._validateUniqueName(checker) abort " {{{2
let ft = a:checker.getFiletype()
let name = a:checker.getName()
if index(self._checkerRaw[ft], name) > -1
throw 'Syntastic: Duplicate syntax checker name: ' . ft . '/' . name
endif
endfunction " }}}2
" Check for obsolete variable g:syntastic_<filetype>_checker
function! g:SyntasticRegistry._checkDeprecation(filetype) " {{{2
if exists('g:syntastic_' . a:filetype . '_checker') && !exists('g:syntastic_' . a:filetype . '_checkers')
let g:syntastic_{a:filetype}_checkers = [g:syntastic_{a:filetype}_checker]
call syntastic#log#deprecationWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated')
call syntastic#log#oneTimeWarn('variable g:syntastic_' . a:filetype . '_checker is deprecated')
endif
endfunction " }}}2

View File

@ -25,6 +25,7 @@ function! g:SyntasticSignsNotifier.New() " {{{2
if !s:setup_done
call self._setup()
let s:setup_done = 1
lockvar s:setup_done
endif
return newObj
@ -41,7 +42,7 @@ function! g:SyntasticSignsNotifier.refresh(loclist) " {{{2
call self._signErrors(a:loclist)
endif
call self._removeSigns(old_signs)
let s:first_sign_id = s:next_sign_id
let s:first_sign_id = exists('s:next_sign_id') ? s:next_sign_id : 5000
endfunction " }}}2
" }}}1
@ -98,13 +99,15 @@ function! g:SyntasticSignsNotifier._signErrors(loclist) " {{{2
if !has_key(seen, i['lnum'])
let seen[i['lnum']] = 1
let sign_severity = i['type'] ==? 'W' ? 'Warning' : 'Error'
let sign_subtype = get(i, 'subtype', '')
let sign_type = 'Syntastic' . sign_subtype . sign_severity
if i['lnum'] > 0
let sign_severity = i['type'] ==? 'W' ? 'Warning' : 'Error'
let sign_subtype = get(i, 'subtype', '')
let sign_type = 'Syntastic' . sign_subtype . sign_severity
execute "sign place " . s:next_sign_id . " line=" . i['lnum'] . " name=" . sign_type . " buffer=" . i['bufnr']
call add(self._bufSignIds(), s:next_sign_id)
let s:next_sign_id += 1
execute "sign place " . s:next_sign_id . " line=" . i['lnum'] . " name=" . sign_type . " buffer=" . i['bufnr']
call add(self._bufSignIds(), s:next_sign_id)
let s:next_sign_id += 1
endif
endif
endfor
endif
@ -113,9 +116,9 @@ endfunction " }}}2
" Remove the signs with the given ids from this buffer
function! g:SyntasticSignsNotifier._removeSigns(ids) " {{{2
if has('signs')
for i in a:ids
execute "sign unplace " . i
call remove(self._bufSignIds(), index(self._bufSignIds(), i))
for s in reverse(copy(a:ids))
execute "sign unplace " . s
call remove(self._bufSignIds(), index(self._bufSignIds(), s))
endfor
endif
endfunction " }}}2

View File

@ -14,10 +14,6 @@ if exists('g:loaded_syntastic_actionscript_mxmlc_checker')
endif
let g:loaded_syntastic_actionscript_mxmlc_checker = 1
if !exists('g:syntastic_actionscript_mxmlc_conf')
let g:syntastic_actionscript_mxmlc_conf = ''
endif
let s:save_cpo = &cpo
set cpo&vim
@ -45,10 +41,10 @@ function! SyntaxCheckers_actionscript_mxmlc_GetHighlightRegex(item)
endfunction
function! SyntaxCheckers_actionscript_mxmlc_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_before': (g:syntastic_actionscript_mxmlc_conf != '' ?
\ ' -load-config+=' . syntastic#util#shexpand(g:syntastic_actionscript_mxmlc_conf) : ''),
\ 'args_after': '-output=' . syntastic#util#DevNull() })
call syntastic#log#deprecationWarn('actionscript_mxmlc_conf', 'actionscript_mxmlc_args',
\ "'-load-config+=' . syntastic#util#shexpand(OLD_VAR)")
let makeprg = self.makeprgBuild({ 'args_after': '-output=' . syntastic#util#DevNull() })
let errorformat =
\ '%f(%l): col: %c %trror: %m,' .

View File

@ -8,7 +8,7 @@
" 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_bemhtml_bemhtmllint_checker")
finish
endif
@ -29,6 +29,7 @@ call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'name': 'bemhtmllint',
\ 'exec': 'bemhtml-lint' })
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -0,0 +1,45 @@
"============================================================================
"File: bro.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Justin Azoff <justin.azoff@gmail.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_bro_bro_checker")
finish
endif
let g:loaded_syntastic_bro_bro_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_bro_bro_IsAvailable() dict
return system(self.getExecEscaped() . ' --help') =~# '--parse-only'
endfunction
function! SyntaxCheckers_bro_bro_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_before': '--parse-only' })
"example: error in ./foo.bro, line 3: unknown identifier banana, at or "near "banana"
let errorformat =
\ '%trror in %f\, line %l: %m,' .
\ '%tarning in %f\, line %l: %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'bro',
\ 'name': 'bro'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -14,24 +14,27 @@ if exists("g:loaded_syntastic_c_checkpatch_checker")
endif
let g:loaded_syntastic_c_checkpatch_checker = 1
" Bail if the user doesn't have `checkpatch.pl` or ./scripts/checkpatch.pl installed.
if executable("checkpatch.pl")
let g:syntastic_c_checker_checkpatch_location = 'checkpatch.pl'
elseif executable("./scripts/checkpatch.pl")
let g:syntastic_c_checker_checkpatch_location = './scripts/checkpatch.pl'
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_c_checkpatch_IsAvailable() dict
return exists("g:syntastic_c_checker_checkpatch_location")
call syntastic#log#deprecationWarn('c_checker_checkpatch_location', 'c_checkpatch_exe')
if !exists('g:syntastic_c_checkpatch_exe') && !executable(self.getExec())
if executable('checkpatch')
let g:syntastic_c_checkpatch_exe = 'checkpatch'
elseif executable('./scripts/checkpatch.pl')
let g:syntastic_c_checkpatch_exe = fnamemodify('./scripts/checkpatch.pl', ':p')
elseif executable('./scripts/checkpatch')
let g:syntastic_c_checkpatch_exe = fnamemodify('./scripts/checkpatch', ':p')
endif
endif
return executable(self.getExec())
endfunction
function! SyntaxCheckers_c_checkpatch_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe': g:syntastic_c_checker_checkpatch_location,
\ 'args_after': '--no-summary --no-tree --terse --file' })
let makeprg = self.makeprgBuild({ 'args_after': '--no-summary --no-tree --terse --file' })
let errorformat =
\ '%f:%l: %tARNING: %m,' .

View File

@ -19,7 +19,7 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_c_make_GetLocList() dict
let makeprg = self.getExecEscaped() . ' -sk'
let makeprg = self.makeprgBuild({ 'args': '-sk', 'fname': '' })
let errorformat =
\ '%-G%f:%s:,' .

View File

@ -0,0 +1,55 @@
"============================================================================
"File: cabal.vim
"Description: Haskell package description (.cabal file) linting and syntax
" validation via 'cabal check'
"Maintainer: Ian D. Bollinger <ian.bollinger@gmail.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_cabal_cabal_checker')
finish
endif
let g:loaded_syntastic_cabal_cabal_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_cabal_cabal_GetHighlightRegex(item)
let field = matchstr(a:item['text'], "\\vParse of field '\\zs[^']+")
if field != ''
return '\v\c^\s*' . field . '\s*:\s*\zs.*$'
endif
let field = matchstr(a:item['text'], "\\v(^|\\s)'\\zs[^']+\\ze'")
if field != ''
return '\V\c\<' . escape(field, '\') . '\>'
endif
return ''
endfunction
function! SyntaxCheckers_cabal_cabal_GetLocList() dict
let makeprg = self.getExecEscaped() . ' check'
let errorformat =
\ '%Ecabal: %f:%l: %m,' .
\ '%W* %m'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'cwd': expand('%:p:h'),
\ 'preprocess': 'cabal',
\ 'defaults': {'bufnr': bufnr('')} })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'cabal',
\ 'name': 'cabal'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -19,7 +19,8 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_co_coco_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-c -o /tmp' })
let tmpdir = $TMPDIR != '' ? $TMPDIR : $TMP != '' ? $TMP : '/tmp'
let makeprg = self.makeprgBuild({ 'args_after': '-c -o ' . tmpdir })
let errorformat =
\ '%EFailed at: %f,' .

View File

@ -19,7 +19,11 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_coffee_coffeelint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '--csv' })
if !exists('s:coffeelint_new')
let s:coffeelint_new = syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version'), [1, 4])
endif
let makeprg = self.makeprgBuild({ 'args_after': (s:coffeelint_new ? '--reporter csv' : '--csv') })
let errorformat =
\ '%f\,%l\,%\d%#\,%trror\,%m,' .

View File

@ -19,17 +19,13 @@ if exists('g:loaded_syntastic_css_csslint_checker')
endif
let g:loaded_syntastic_css_csslint_checker = 1
if !exists('g:syntastic_csslint_options')
let g:syntastic_csslint_options = ''
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_css_csslint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args': g:syntastic_csslint_options,
\ 'args_after': '--format=compact' })
call syntastic#log#deprecationWarn('csslint_options', 'css_csslint_args')
let makeprg = self.makeprgBuild({ 'args_after': '--format=compact' })
" Print CSS Lint's error/warning messages from compact format. Ignores blank lines.
let errorformat =

View File

@ -0,0 +1,26 @@
"============================================================================
"File: recess.vim
"Description: Syntax checking plugin for syntastic.vim using `recess`
" (http://twitter.github.io/recess/).
"Maintainer: Tim Carry <tim at pixelastic 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_css_recess_checker")
finish
endif
let g:loaded_syntastic_css_recess_checker = 1
runtime! syntax_checkers/less/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'css',
\ 'name': 'recess',
\ 'redirect': 'less/recess'})
" vim: set et sts=4 sw=4:

View File

@ -35,6 +35,12 @@ function! SyntaxCheckers_d_dmd_IsAvailable() dict
endfunction
function! SyntaxCheckers_d_dmd_GetLocList() dict
if !exists('g:syntastic_d_include_dirs')
let g:syntastic_d_include_dirs = filter(glob($HOME . '/.dub/packages/*', 1, 1), 'isdirectory(v:val)')
call map(g:syntastic_d_include_dirs, 'isdirectory(v:val . "/source") ? v:val . "/source" : v:val')
call add(g:syntastic_d_include_dirs, './source')
endif
return syntastic#c#GetLocList('d', 'dmd', {
\ 'errorformat':
\ '%-G%f:%s:,%f(%l): %m,' .

View File

@ -19,22 +19,27 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_eruby_ruby_IsAvailable() dict
if !exists("g:syntastic_ruby_exec")
let g:syntastic_ruby_exec = self.getExec()
if !exists('g:syntastic_eruby_ruby_exec') && exists('g:syntastic_ruby_exec')
let g:syntastic_eruby_ruby_exec = g:syntastic_ruby_exec
endif
return executable(expand(g:syntastic_ruby_exec))
let s:exe = self.getExec()
if executable(s:exe)
let s:exe = syntastic#util#shescape(s:exe)
if !syntastic#util#isRunningWindows()
let s:exe = 'RUBYOPT= ' . s:exe
endif
return 1
endif
return 0
endfunction
function! SyntaxCheckers_eruby_ruby_GetLocList() dict
let exe = syntastic#util#shexpand(g:syntastic_ruby_exec)
if !syntastic#util#isRunningWindows()
let exe = 'RUBYOPT= ' . exe
endif
let fname = "'" . escape(expand('%'), "\\'") . "'"
" TODO: encodings became useful in ruby 1.9 :)
if syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [1, 9])
if syntastic#util#versionIsAtLeast(syntastic#util#getVersion(s:exe . ' --version'), [1, 9])
let enc = &fileencoding != '' ? &fileencoding : &encoding
let encoding_spec = ', :encoding => "' . (enc ==? 'utf-8' ? 'UTF-8' : 'BINARY') . '"'
else
@ -43,11 +48,11 @@ function! SyntaxCheckers_eruby_ruby_GetLocList() dict
"gsub fixes issue #7, rails has it's own eruby syntax
let makeprg =
\ exe . ' -rerb -e ' .
\ s:exe . ' -rerb -e ' .
\ syntastic#util#shescape('puts ERB.new(File.read(' .
\ fname . encoding_spec .
\ ').gsub(''<%='',''<%''), nil, ''-'').src') .
\ ' | ' . exe . ' -c'
\ ' | ' . s:exe . ' -c'
let errorformat =
\ '%-GSyntax OK,'.

View File

@ -19,16 +19,12 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_haml_haml_IsAvailable() dict
if !exists('g:syntastic_haml_interpreter')
let g:syntastic_haml_interpreter = self.getExec()
endif
return executable(expand(g:syntastic_haml_interpreter))
call syntastic#log#deprecationWarn('haml_interpreter', 'haml_haml_exec')
return executable(self.getExec())
endfunction
function! SyntaxCheckers_haml_haml_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe': syntastic#util#shexpand(g:syntastic_haml_interpreter),
\ 'args_after': '-c' })
let makeprg = self.makeprgBuild({ 'args_after': '-c' })
let errorformat =
\ 'Haml error on line %l: %m,' .

View File

@ -19,7 +19,9 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_haskell_hdevtools_GetLocList() dict
if exists('g:hdevtools_options')
if !exists('g:syntastic_haskell_hdevtools_args') && exists('g:hdevtools_options')
call syntastic#log#oneTimeWarn('variable g:hdevtools_options is deprecated, ' .
\ 'please use g:syntastic_haskell_hdevtools_args instead')
let g:syntastic_haskell_hdevtools_args = g:hdevtools_options
endif

View File

@ -14,29 +14,20 @@ if exists('g:loaded_syntastic_html_jshint_checker')
endif
let g:loaded_syntastic_html_jshint_checker = 1
if !exists('g:syntastic_jshint_exec')
let g:syntastic_jshint_exec = 'jshint'
endif
if !exists('g:syntastic_html_jshint_conf')
let g:syntastic_html_jshint_conf = ''
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_html_jshint_IsAvailable() dict
let exe = expand(g:syntastic_jshint_exec)
return executable(exe) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(exe . ' --version'), [2,4])
call syntastic#log#deprecationWarn('jshint_exec', 'html_jshint_exec')
return executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [2,4])
endfunction
function! SyntaxCheckers_html_jshint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe': expand(g:syntastic_jshint_exec),
\ 'args': (g:syntastic_html_jshint_conf != '' ?
\ '--config ' . syntastic#util#shexpand(g:syntastic_html_jshint_conf) : ''),
\ 'args_after': '--verbose --extract always' })
call syntastic#log#deprecationWarn('html_jshint_conf', 'html_jshint_args',
\ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
let makeprg = self.makeprgBuild({ 'args_after': '--verbose --extract always' })
let errorformat = '%A%f: line %l\, col %v\, %m \(%t%*\d\)'

View File

@ -123,6 +123,7 @@ let s:ignore_errors = [
\ "proprietary attribute \"aria-valuenow\"",
\ "proprietary attribute \"aria-valuetext\""
\ ]
lockvar! s:ignore_errors
let s:blocklevel_tags = [
\ "main",
@ -135,6 +136,7 @@ let s:blocklevel_tags = [
\ "figure",
\ "figcaption"
\ ]
lockvar! s:blocklevel_tags
let s:inline_tags = [
\ "video",
@ -153,11 +155,13 @@ let s:inline_tags = [
\ "details",
\ "datalist"
\ ]
lockvar! s:inline_tags
let s:empty_tags = [
\ "wbr",
\ "keygen"
\ ]
lockvar! s:empty_tags
function! s:IgnoreError(text)
for i in s:ignore_errors + g:syntastic_html_tidy_ignore_errors

View File

@ -10,32 +10,36 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
if exists("g:loaded_syntastic_java_javac_checker")
if exists('g:loaded_syntastic_java_javac_checker')
finish
endif
let g:loaded_syntastic_java_javac_checker = 1
let g:syntastic_java_javac_maven_pom_tags = ["build", "properties"]
let g:syntastic_java_javac_maven_pom_tags = ['build', 'properties']
let g:syntastic_java_javac_maven_pom_properties = {}
let s:has_maven = 0
" Global Options
if !exists("g:syntastic_java_javac_executable")
if !exists('g:syntastic_java_javac_executable')
let g:syntastic_java_javac_executable = 'javac'
endif
if !exists("g:syntastic_java_maven_executable")
if !exists('g:syntastic_java_maven_executable')
let g:syntastic_java_maven_executable = 'mvn'
endif
if !exists("g:syntastic_java_javac_options")
if !exists('g:syntastic_java_javac_options')
let g:syntastic_java_javac_options = '-Xlint'
endif
if !exists("g:syntastic_java_javac_classpath")
if !exists('g:syntastic_java_maven_options')
let g:syntastic_java_maven_options = ''
endif
if !exists('g:syntastic_java_javac_classpath')
let g:syntastic_java_javac_classpath = ''
endif
if !exists("g:syntastic_java_javac_delete_output")
if !exists('g:syntastic_java_javac_delete_output')
let g:syntastic_java_javac_delete_output = 1
endif
@ -43,20 +47,22 @@ let s:save_cpo = &cpo
set cpo&vim
function! s:CygwinPath(path)
return substitute(system("cygpath -m " . syntastic#util#shescape(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")
if !exists('g:syntastic_java_javac_temp_dir')
if has('win32') || has('win64')
let g:syntastic_java_javac_temp_dir = $TEMP."\\vim-syntastic-javac"
let g:syntastic_java_javac_temp_dir = $TEMP . syntastic#util#Slash() . 'vim-syntastic-javac'
elseif has('win32unix')
let g:syntastic_java_javac_temp_dir = s:CygwinPath('/tmp/vim-syntastic-javac')
elseif $TMPDIR != ''
let g:syntastic_java_javac_temp_dir = $TMPDIR . '/vim-syntastic-javac'
else
let g:syntastic_java_javac_temp_dir = '/tmp/vim-syntastic-javac'
endif
endif
if !exists("g:syntastic_java_javac_autoload_maven_classpath")
if !exists('g:syntastic_java_javac_autoload_maven_classpath')
let g:syntastic_java_javac_autoload_maven_classpath = 1
endif
@ -72,16 +78,16 @@ if !exists('g:syntastic_java_javac_custom_classpath_command')
let g:syntastic_java_javac_custom_classpath_command = ''
endif
if !exists("g:syntastic_java_javac_maven_pom_ftime")
if !exists('g:syntastic_java_javac_maven_pom_ftime')
let g:syntastic_java_javac_maven_pom_ftime = {}
endif
if !exists("g:syntastic_java_javac_maven_pom_classpath")
if !exists('g:syntastic_java_javac_maven_pom_classpath')
let g:syntastic_java_javac_maven_pom_classpath = {}
endif
function! s:RemoveCarriageReturn(line)
return substitute(a:line, '\r', '', 'g')
return substitute(a:line, "\r", '', 'g')
endfunction
" recursively remove directory and all it's sub-directories
@ -90,36 +96,25 @@ function! s:RemoveDir(dir)
for f in split(globpath(a:dir, '*'), "\n")
call s:RemoveDir(f)
endfor
silent! call system('rmdir ' . a:dir)
silent! call system('rmdir ' . syntastic#util#shescape(a:dir))
else
silent! call delete(a:dir)
endif
endfunction
function! s:ClassSep()
return (syntastic#util#isRunningWindows() || has('win32unix')) ? ';' : ':'
endfunction
function! s:AddToClasspath(classpath, path)
if a:path == ''
return a:classpath
endif
if a:classpath != '' && a:path != ''
if has('win32') || has('win32unix') || has('win64')
return a:classpath . ";" . a:path
else
return a:classpath . ":" . a:path
endif
else
return a:path
endif
return (a:classpath != '') ? a:classpath . s:ClassSep() . a:path : a:path
endfunction
function! s:SplitClasspath(classpath)
if a:classpath == ''
return []
endif
if has('win32') || has('win32unix') || has('win64')
return split(a:classpath, ";")
else
return split(a:classpath, ":")
endif
return split(a:classpath, s:ClassSep())
endfunction
function! s:LoadConfigFile()
@ -145,15 +140,15 @@ function! s:SaveClasspath()
while i < len(lines)
if match(lines[i], 'g:syntastic_java_javac_classpath') != -1
call remove(lines, i)
let i -= 1
else
let i += 1
endif
let i += 1
endwhile
else
let lines = []
endif
" add new g:syntastic_java_javac_classpath option to config
call add(lines, 'let g:syntastic_java_javac_classpath = "'.path.'"')
call add(lines, 'let g:syntastic_java_javac_classpath = ' . string(path))
" save config file lines
call writefile(lines, expand(g:syntastic_java_javac_config_file))
endif
@ -169,7 +164,7 @@ function! s:EditClasspath()
let path = []
let pathlines = split(g:syntastic_java_javac_classpath, "\n")
for p in pathlines
let path += s:SplitClasspath(p)
call extend(path, s:SplitClasspath(p))
endfor
execute (len(path) + 5) . 'sp ' . fnameescape(command)
@ -223,10 +218,12 @@ endfunction
function! s:GetMavenProperties()
let mvn_properties = {}
let pom = findfile("pom.xml", ".;")
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 = syntastic#util#shexpand(g:syntastic_java_maven_executable) . ' -f ' . pom
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
\ ' -f ' . syntastic#util#shescape(pom) .
\ ' ' . g:syntastic_java_maven_options
let mvn_is_managed_tag = 1
let mvn_settings_output = split(system(mvn_cmd . ' help:effective-pom'), "\n")
let current_path = 'project'
@ -239,7 +236,7 @@ function! s:GetMavenProperties()
let matches = matchlist(line, '\m^\s*</\([a-zA-Z0-9\-\.]\+\)>\s*$')
if !empty(matches)
let mvn_is_managed_tag = index(g:syntastic_java_javac_maven_pom_tags, matches[1]) < 0
let current_path = substitute(current_path, '\m\.' . matches[1] . "$", '', '')
let current_path = substitute(current_path, '\m\.' . matches[1] . '$', '', '')
else
let matches = matchlist(line, '\m^\s*<\([a-zA-Z0-9\-\.]\+\)>\(.\+\)</[a-zA-Z0-9\-\.]\+>\s*$')
if mvn_is_managed_tag && !empty(matches)
@ -262,10 +259,12 @@ if g:syntastic_java_javac_config_file_enabled
endif
function! s:GetMavenClasspath()
let pom = findfile("pom.xml", ".;")
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 = syntastic#util#shexpand(g:syntastic_java_maven_executable) . ' -f ' . pom
let mvn_cmd = syntastic#util#shexpand(g:syntastic_java_maven_executable) .
\ ' -f ' . syntastic#util#shescape(pom) .
\ ' ' . g:syntastic_java_maven_options
let mvn_classpath_output = split(system(mvn_cmd . ' dependency:build-classpath'), "\n")
let mvn_classpath = ''
let class_path_next = 0
@ -308,20 +307,20 @@ function! SyntaxCheckers_java_javac_IsAvailable() dict
endfunction
function! s:MavenOutputDirectory()
let pom = findfile("pom.xml", ".;")
let pom = findfile('pom.xml', '.;')
if s:has_maven && filereadable(pom)
let mvn_properties = s:GetMavenProperties()
let output_dir = getcwd()
if has_key(mvn_properties, 'project.properties.build.dir')
let output_dir = mvn_properties['project.properties.build.dir']
endif
if stridx(expand( '%:p:h' ), "src.main.java") >= 0
if stridx(expand( '%:p:h' ), 'src.main.java') >= 0
let output_dir .= '/target/classes'
if has_key(mvn_properties, 'project.build.outputDirectory')
let output_dir = mvn_properties['project.build.outputDirectory']
endif
endif
if stridx(expand( '%:p:h' ), "src.test.java") >= 0
if stridx(expand( '%:p:h' ), 'src.test.java') >= 0
let output_dir .= '/target/test-classes'
if has_key(mvn_properties, 'project.build.testOutputDirectory')
let output_dir = mvn_properties['project.build.testOutputDirectory']
@ -337,13 +336,12 @@ function! s:MavenOutputDirectory()
endfunction
function! SyntaxCheckers_java_javac_GetLocList() dict
let javac_opts = g:syntastic_java_javac_options
let output_dir = ""
let output_dir = ''
if g:syntastic_java_javac_delete_output
let output_dir = g:syntastic_java_javac_temp_dir
let javac_opts .= ' -d ' . output_dir
let javac_opts .= ' -d ' . syntastic#util#shescape(output_dir)
endif
" load classpath from config file
@ -354,12 +352,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
let javac_classpath = ''
" add classpathes to javac_classpath
if has('win32') || has('win32unix') || has('win64')
let javac_classpath_split = ';'
else
let javac_classpath_split = ':'
endif
for path in split(g:syntastic_java_javac_classpath, javac_classpath_split)
for path in split(g:syntastic_java_javac_classpath, s:ClassSep())
if path != ''
try
let ps = glob(path, 0, 1)
@ -378,7 +371,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
if s:has_maven && g:syntastic_java_javac_autoload_maven_classpath
if !g:syntastic_java_javac_delete_output
let javac_opts .= ' -d ' . s:MavenOutputDirectory()
let javac_opts .= ' -d ' . syntastic#util#shescape(s:MavenOutputDirectory())
endif
let javac_classpath = s:AddToClasspath(javac_classpath, s:GetMavenClasspath())
endif
@ -386,7 +379,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
" load custom classpath
if g:syntastic_java_javac_custom_classpath_command != ''
let lines = system(g:syntastic_java_javac_custom_classpath_command)
if has('win32') || has('win32unix') || has('win64')
if syntastic#util#isRunningWindows() || has('win32unix')
let lines = substitute(lines, "\r\n", "\n", 'g')
endif
for l in split(lines, "\n")
@ -395,17 +388,10 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
endif
if javac_classpath != ''
let javac_opts .= ' -cp "' . fnameescape(javac_classpath) . '"'
let javac_opts .= ' -cp ' . syntastic#util#shexpand(javac_classpath)
endif
" path seperator
if has('win32') || has('win32unix') || has('win64')
let sep = "\\"
else
let sep = '/'
endif
let fname = fnameescape(expand ( '%:p:h' ) . sep . expand ( '%:t' ))
let fname = expand('%:p:h') . syntastic#util#Slash() . expand ('%:t')
if has('win32unix')
let fname = s:CygwinPath(fname)
@ -413,7 +399,7 @@ function! SyntaxCheckers_java_javac_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args': javac_opts,
\ 'fname': fname,
\ 'fname': syntastic#util#shescape(fname),
\ 'tail': '2>&1' })
" unashamedly stolen from *errorformat-javac* (quickfix.txt) and modified to include error types

View File

@ -8,48 +8,36 @@
" Want To Public License, Version 2, as published by Sam Hocevar.
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"============================================================================
"
" To enable this plugin, edit the .vimrc like this:
"
" let g:syntastic_javascript_checker = "closurecompiler"
"
" and set the path to the Google Closure Compiler:
"
" let g:syntastic_javascript_closure_compiler_path = '/path/to/google-closure-compiler.jar'
"
" It takes additional options for Google Closure Compiler with the variable
" g:syntastic_javascript_closure_compiler_options.
"
if exists("g:loaded_syntastic_javascript_closurecompiler_checker")
finish
endif
let g:loaded_syntastic_javascript_closurecompiler_checker = 1
if !exists("g:syntastic_javascript_closure_compiler_options")
let g:syntastic_javascript_closure_compiler_options = ""
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_closurecompiler_IsAvailable() dict
call syntastic#log#deprecationWarn('javascript_closure_compiler_path', 'javascript_closurecompiler_path')
return
\ executable("java") &&
\ exists("g:syntastic_javascript_closure_compiler_path") &&
\ filereadable(g:syntastic_javascript_closure_compiler_path)
\ exists("g:syntastic_javascript_closurecompiler_path") &&
\ filereadable(g:syntastic_javascript_closurecompiler_path)
endfunction
function! SyntaxCheckers_javascript_closurecompiler_GetLocList() dict
if exists("g:syntastic_javascript_closure_compiler_file_list")
let file_list = join(readfile(g:syntastic_javascript_closure_compiler_file_list))
call syntastic#log#deprecationWarn('javascript_closure_compiler_options', 'javascript_closurecompiler_args')
call syntastic#log#deprecationWarn('javascript_closure_compiler_file_list', 'javascript_closurecompiler_file_list')
if exists("g:syntastic_javascript_closurecompiler_file_list")
let file_list = join(readfile(g:syntastic_javascript_closurecompiler_file_list))
else
let file_list = syntastic#util#shexpand('%')
endif
let makeprg = self.makeprgBuild({
\ 'exe': 'java -jar ' . g:syntastic_javascript_closure_compiler_path,
\ 'args': g:syntastic_javascript_closure_compiler_options,
\ 'exe_after': '-jar ' . g:syntastic_javascript_closurecompiler_path,
\ 'args_after': '--js' ,
\ 'fname': file_list })

View File

@ -14,27 +14,24 @@ if exists('g:loaded_syntastic_javascript_eslint_checker')
endif
let g:loaded_syntastic_javascript_eslint_checker = 1
if !exists('g:syntastic_javascript_eslint_conf')
let g:syntastic_javascript_eslint_conf = ''
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])
\ executable(self.getExec()) &&
\ syntastic#util#versionIsAtLeast(syntastic#util#getVersion(self.getExecEscaped() . ' --version'), [0, 1])
endfunction
function! SyntaxCheckers_javascript_eslint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_before': '-f compact',
\ 'args': (g:syntastic_javascript_eslint_conf != '' ?
\ '--config ' . syntastic#util#shexpand(g:syntastic_javascript_eslint_conf) : '') })
call syntastic#log#deprecationWarn('javascript_eslint_conf', 'javascript_eslint_args',
\ "'--config ' . syntastic#util#shexpand(OLD_VAR)")
let makeprg = self.makeprgBuild({ 'args_before': '-f compact' })
let errorformat =
\ '%E%f: line %l\, col %c\, Error - %m'
\ '%E%f: line %l\, col %c\, Error - %m,' .
\ '%W%f: line %l\, col %c\, Warning - %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,

View File

@ -14,16 +14,13 @@ if exists("g:loaded_syntastic_javascript_gjslint_checker")
endif
let g:loaded_syntastic_javascript_gjslint_checker = 1
if !exists("g:syntastic_javascript_gjslint_conf")
let g:syntastic_javascript_gjslint_conf = ""
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_gjslint_GetLocList() dict
call syntastic#log#deprecationWarn('javascript_gjslint_conf', 'javascript_gjslint_args')
let makeprg = self.makeprgBuild({
\ 'args': g:syntastic_javascript_gjslint_conf,
\ 'args_after': '--nosummary --unix_mode --nodebug_indentation --nobeep' })
let errorformat =

View File

@ -14,34 +14,27 @@ if exists('g:loaded_syntastic_javascript_jshint_checker')
endif
let g:loaded_syntastic_javascript_jshint_checker = 1
if !exists('g:syntastic_javascript_jshint_conf')
let g:syntastic_javascript_jshint_conf = ''
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_jshint_IsAvailable() dict
if !exists('g:syntastic_jshint_exec')
let g:syntastic_jshint_exec = self.getExec()
endif
if !executable(expand(g:syntastic_jshint_exec))
call syntastic#log#deprecationWarn('jshint_exec', 'javascript_jshint_exec')
if !executable(self.getExec())
return 0
endif
let s:jshint_version = syntastic#util#getVersion(syntastic#util#shexpand(g:syntastic_jshint_exec) . ' --version')
let s:jshint_version = syntastic#util#getVersion(self.getExecEscaped() . ' --version')
return syntastic#util#versionIsAtLeast(s:jshint_version, [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({
\ '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 makeprg = self.makeprgBuild({ 'args_after': (s:jshint_new ? '--verbose ' : '') })
let errorformat = s:jshint_new ?
\ '%A%f: line %l\, col %v\, %m \(%t%*\d\)' :

View File

@ -14,17 +14,14 @@ if exists("g:loaded_syntastic_javascript_jsl_checker")
endif
let g:loaded_syntastic_javascript_jsl_checker = 1
if !exists("g:syntastic_javascript_jsl_conf")
let g:syntastic_javascript_jsl_conf = ""
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_javascript_jsl_GetLocList() dict
call syntastic#log#deprecationWarn('javascript_jsl_conf', 'javascript_jsl_args',
\ "'-conf ' . syntastic#util#shexpand(OLD_VAR)")
let makeprg = self.makeprgBuild({
\ '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

@ -22,7 +22,7 @@ set cpo&vim
function! SyntaxCheckers_javascript_jslint_GetHighlightRegex(item)
let term = matchstr(a:item['text'], '\mExpected .* and instead saw ''\zs.*\ze''')
if term != ''
let term = '\V' . escape(term, '\')
let term = '\V\<' . escape(term, '\') . '\>'
endif
return term
endfunction

View File

@ -0,0 +1,44 @@
"============================================================================
"File: recess.vim
"Description: Syntax checking plugin for syntastic.vim using `recess`
" (http://twitter.github.io/recess/).
"Maintainer: Tim Carry <tim at pixelastic 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_less_recess_checker')
finish
endif
let g:loaded_syntastic_less_recess_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_less_recess_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'post_args_after': '--format=compact --stripColors' })
let errorformat =
\ '%E%m in %f,' .
\ '%Z %#%l.%.%#,' .
\ '%f:%l:%m,' .
\ '%-G%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'less',
\ 'name': 'recess'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -20,13 +20,14 @@ set cpo&vim
function! SyntaxCheckers_lisp_clisp_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after': '-q -c ' . syntastic#c#NullOutput() })
\ 'args_after': '-q',
\ 'fname_before': '-c' })
let errorformat =
\ '%-G;%.%#,' .
\ '%W%>WARNING:%.%#line %l : %m,' .
\ '%W%>WARNING:%.%# line %l : %m,' .
\ '%Z %#%m,' .
\ '%W%>WARNING:%.%#lines %l..%\d\# : %m,' .
\ '%W%>WARNING:%.%# lines %l%\%.%\%.%\d%\+ : %m,' .
\ '%Z %#%m,' .
\ '%E%>The following functions were %m,' .
\ '%Z %m,' .

View File

@ -50,25 +50,25 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_perl_perl_IsAvailable() dict
if !exists('g:syntastic_perl_interpreter')
let g:syntastic_perl_interpreter = self.getExec()
if !exists('g:syntastic_perl_perl_exec') && exists('g:syntastic_perl_interpreter')
let g:syntastic_perl_perl_exec = g:syntastic_perl_interpreter
endif
" don't call executable() here, to allow things like
" let g:syntastic_perl_interpreter='/usr/bin/env perl'
silent! call system(syntastic#util#shexpand(g:syntastic_perl_interpreter) . ' -e ' . syntastic#util#shescape('exit(0)'))
silent! call system(self.getExecEscaped() . ' -e ' . syntastic#util#shescape('exit(0)'))
return v:shell_error == 0
endfunction
function! SyntaxCheckers_perl_perl_GetLocList() dict
if !exists('g:syntastic_enable_perl_checker') || !g:syntastic_enable_perl_checker
call syntastic#log#error('checker perl/perl: checks disabled for security reasons; set g:syntastic_enable_perl_checker to 1 to override')
call syntastic#log#error('checker perl/perl: checks disabled for security reasons; ' .
\ 'set g:syntastic_enable_perl_checker to 1 to override')
return []
endif
let exe = expand(g:syntastic_perl_interpreter)
if type(g:syntastic_perl_lib_path) == type('')
call syntastic#log#deprecationWarn('variable g:syntastic_perl_lib_path should be a list')
call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list')
let includes = split(g:syntastic_perl_lib_path, ',')
else
let includes = copy(syntastic#util#var('perl_lib_path'))
@ -79,9 +79,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict
\ (index(shebang['args'], '-t') >= 0 ? ' -t' : '')
let errorformat = '%f:%l:%m'
let makeprg = self.makeprgBuild({
\ 'exe': exe,
\ 'args_before': '-c -X ' . extra })
let makeprg = self.makeprgBuild({ 'args_before': '-c -X ' . extra })
let errors = SyntasticMake({
\ 'makeprg': makeprg,
@ -92,9 +90,7 @@ function! SyntaxCheckers_perl_perl_GetLocList() dict
return errors
endif
let makeprg = self.makeprgBuild({
\ 'exe': exe,
\ 'args_before': '-c -Mwarnings ' . extra })
let makeprg = self.makeprgBuild({ 'args_before': '-c -Mwarnings ' . extra })
return SyntasticMake({
\ 'makeprg': makeprg,

View File

@ -27,8 +27,8 @@ function! SyntaxCheckers_php_phpcs_GetLocList() dict
\ 'args_after': '--report=csv' })
let errorformat =
\ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity,'.
\ '"%f"\,%l\,%v\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]'
\ '%-GFile\,Line\,Column\,Type\,Message\,Source\,Severity%.%#,'.
\ '"%f"\,%l\,%v\,%t%*[a-zA-Z]\,"%m"\,%*[a-zA-Z0-9_.-]\,%*[0-9]%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,

View File

@ -18,11 +18,6 @@ let g:loaded_syntastic_puppet_puppetlint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
if exists("g:syntastic_puppet_lint_arguments")
let g:syntastic_puppet_puppetlint_args = g:syntastic_puppet_lint_arguments
call syntastic#log#deprecationWarn("variable g:syntastic_puppet_lint_arguments is deprecated, please use g:syntastic_puppet_puppetlint_args instead")
endif
function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
return
\ executable("puppet") &&
@ -32,6 +27,8 @@ function! SyntaxCheckers_puppet_puppetlint_IsAvailable() dict
endfunction
function! SyntaxCheckers_puppet_puppetlint_GetLocList() dict
call syntastic#log#deprecationWarn('puppet_lint_arguments', 'puppet_puppetlint_args')
let makeprg = self.makeprgBuild({
\ 'args_after': '--log-format "%{KIND} [%{check}] %{message} at %{fullpath}:%{linenumber}"' })

View File

@ -19,7 +19,8 @@ function! SyntaxCheckers_python_flake8_GetHighlightRegex(item)
endfunction
function! SyntaxCheckers_python_flake8_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat =
\ '%E%f:%l: could not compile,%-Z%p^,' .

View File

@ -19,7 +19,9 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_frosted_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-vb' })
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb'),
\ 'args_after': '-vb' })
let errorformat =
\ '%f:%l:%c:%m,' .

View File

@ -5,7 +5,7 @@
"
" For details about pep257 see: https://github.com/GreenSteam/pep257
if exists("g:loaded_syntastic_python_pep257_checker")
if exists('g:loaded_syntastic_python_pep257_checker')
finish
endif
let g:loaded_syntastic_python_pep257_checker = 1
@ -14,12 +14,24 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_pep257_GetLocList() dict
let makeprg = self.makeprgBuild({})
if !exists('s:pep257_new')
let s:pep257_new = syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version'), [0, 3])
endif
let errorformat =
\ '%E%f:%l:%c%\%.%\%.%\d%\+:%\d%\+: %m,' .
\ '%E%f:%l:%c: %m,' .
\ '%+C %m'
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
if s:pep257_new
let errorformat =
\ '%E%f:%l %.%#:,' .
\ '%+C %m'
else
let errorformat =
\ '%E%f:%l:%c%\%.%\%.%\d%\+:%\d%\+: %m,' .
\ '%E%f:%l:%c: %m,' .
\ '%+C %m'
endif
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
@ -28,10 +40,12 @@ function! SyntaxCheckers_python_pep257_GetLocList() dict
\ 'preprocess': 'killEmpty',
\ 'postprocess': ['compressWhitespace'] })
" pep257 outputs byte offsets rather than column numbers
for e in loclist
let e['col'] = get(e, 'col', 0) + 1
endfor
if s:pep257_new == 0
" byte offsets rather than column numbers
for e in loclist
let e['col'] = get(e, 'col', 0) + 1
endfor
endif
return loclist
endfunction

View File

@ -21,7 +21,8 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_pep8_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat = '%f:%l:%c: %m'

View File

@ -14,7 +14,8 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_python_py3kwarn_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat = '%W%f:%l:%c: %m'

View File

@ -26,21 +26,22 @@ function! SyntaxCheckers_python_pyflakes_GetHighlightRegex(i)
\ || stridx(a:i['text'], 'shadowed by loop variable') >= 0
" fun with Python's %r: try "..." first, then '...'
let terms = split(a:i['text'], '"', 1)
if len(terms) > 2
return terms[1]
let term = matchstr(a:i['text'], '\m^.\{-}"\zs.\{-1,}\ze"')
if term != ''
return '\V\<' . escape(term, '\') . '\>'
endif
let terms = split(a:i['text'], "'", 1)
if len(terms) > 2
return terms[1]
let term = matchstr(a:i['text'], '\m^.\{-}''\zs.\{-1,}\ze''')
if term != ''
return '\V\<' . escape(term, '\') . '\>'
endif
endif
return ''
endfunction
function! SyntaxCheckers_python_pyflakes_GetLocList() dict
let makeprg = self.makeprgBuild({})
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb') })
let errorformat =
\ '%E%f:%l: could not compile,'.

View File

@ -23,7 +23,9 @@ function! SyntaxCheckers_python_pylama_GetHighlightRegex(item)
endfunction
function! SyntaxCheckers_python_pylama_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-f pep8' })
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb'),
\ 'args_after': '-f pep8' })
" TODO: "WARNING:pylama:..." messages are probably a logging bug
let errorformat =

View File

@ -23,6 +23,7 @@ endfunction
function! SyntaxCheckers_python_pylint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb'),
\ 'args_after': (s:pylint_new ? '-f text --msg-template="{path}:{line}:{column}:{C}: [{symbol}] {msg}" -r n' : '-f parseable -r n -i y') })
let errorformat =

View File

@ -26,7 +26,9 @@ function! SyntaxCheckers_python_python_IsAvailable() dict
endfunction
function! SyntaxCheckers_python_python_GetLocList() dict
let makeprg = self.makeprgBuild({ 'exe': [self.getExec(), s:compiler] })
let makeprg = self.makeprgBuild({
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'TERM=dumb'),
\ 'exe': [self.getExec(), s:compiler] })
let errorformat = '%E%f:%l:%c: %m'

View File

@ -39,8 +39,11 @@ function! SyntaxCheckers_r_lint_IsAvailable() dict
endfunction
function! SyntaxCheckers_r_lint_GetLocList() dict
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
let setwd = 'setwd("' . escape(getcwd(), '"\') . '"); '
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
\ ' -e ' . syntastic#util#shescape('library(lint); try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') .
\ ' -e ' . syntastic#util#shescape(setwd . 'library(lint); ' .
\ 'try(lint(commandArgs(TRUE), ' . g:syntastic_r_lint_styles . '))') .
\ ' --args ' . syntastic#util#shexpand('%')
let errorformat =

View File

@ -51,8 +51,9 @@ function! SyntaxCheckers_r_svtools_GetLocList() dict
return []
endif
let setwd = syntastic#util#isRunningWindows() ? 'setwd("' . escape(getcwd(), '"\') . '"); ' : ''
let makeprg = self.getExecEscaped() . ' --slave --restore --no-save' .
\ ' -e ' . syntastic#util#shescape('library(svTools); ' .
\ ' -e ' . syntastic#util#shescape(setwd . 'library(svTools); ' .
\ 'try(lint(commandArgs(TRUE), filename = commandArgs(TRUE), type = "flat", sep = ":"))') .
\ ' --args ' . syntastic#util#shexpand('%')

View File

@ -19,17 +19,9 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_ruby_jruby_GetLocList() dict
if syntastic#util#isRunningWindows()
let exe = self.getExecEscaped()
let args = '-T1'
else
let exe = 'RUBYOPT= ' . self.getExecEscaped()
let args = ''
endif
let makeprg = self.makeprgBuild({
\ 'exe': exe,
\ 'args': args,
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'RUBYOPT='),
\ 'args': (syntastic#util#isRunningWindows() ? '-T1' : ''),
\ 'args_after': '-W1 -c' })
let errorformat =

View File

@ -19,7 +19,7 @@ set cpo&vim
function! SyntaxCheckers_ruby_macruby_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe': 'RUBYOPT= ' . self.getExecEscaped(),
\ 'exe_before': 'RUBYOPT=',
\ 'args_after': '-W1 -c' })
let errorformat =

View File

@ -18,6 +18,13 @@ let g:loaded_syntastic_ruby_mri_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_ruby_mri_IsAvailable() dict
if !exists('g:syntastic_ruby_mri_exec') && exists('g:syntastic_ruby_exec')
let g:syntastic_ruby_mri_exec = g:syntastic_ruby_exec
endif
return executable(self.getExec())
endfunction
function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
if stridx(a:i['text'], 'assigned but unused variable') >= 0
let term = split(a:i['text'], ' - ')[1]
@ -28,17 +35,8 @@ function! SyntaxCheckers_ruby_mri_GetHighlightRegex(i)
endfunction
function! SyntaxCheckers_ruby_mri_GetLocList() dict
if !exists('g:syntastic_ruby_exec')
let g:syntastic_ruby_exec = self.getExec()
endif
let exe = syntastic#util#shexpand(g:syntastic_ruby_exec)
if !syntastic#util#isRunningWindows()
let exe = 'RUBYOPT= ' . exe
endif
let makeprg = self.makeprgBuild({
\ 'exe': exe,
\ 'exe_before': (syntastic#util#isRunningWindows() ? '' : 'RUBYOPT='),
\ 'args_after': '-w -T1 -c' })
"this is a hack to filter out a repeated useless warning in rspec files

View File

@ -20,7 +20,11 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_ruby_rubylint_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args': 'analyze --presenter=syntastic' })
if !exists('s:rubylint_new')
let s:rubylint_new = syntastic#util#versionIsAtLeast(syntastic#util#getVersion(
\ self.getExecEscaped() . ' --version'), [2])
endif
let makeprg = self.makeprgBuild({ 'args': (s:rubylint_new ? '' : 'analyze ') . '--presenter=syntastic' })
let errorformat = '%f:%t:%l:%c: %m'

View File

@ -18,6 +18,7 @@ let g:loaded_syntastic_sass_sass_checker = 1
"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()
lockvar s:sass_cache_location
"By default do not check partials as unknown variables are a syntax error
if !exists("g:syntastic_sass_check_partials")

View File

@ -1,7 +1,7 @@
"============================================================================
"File: rust.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: Chad Jablonski <chad.jablonski at gmail dot com>
"File: sassc.vim
"Description: Syntax checking plugin for syntastic
"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
@ -10,22 +10,18 @@
"
"============================================================================
if exists("g:loaded_syntastic_rust_rustc_checker")
if exists("g:loaded_syntastic_sass_sassc_checker")
finish
endif
let g:loaded_syntastic_rust_rustc_checker = 1
let g:loaded_syntastic_sass_sassc_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_rust_rustc_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '--no-trans' })
function! SyntaxCheckers_sass_sassc_GetLocList() dict
let makeprg = self.makeprgBuild({ 'fname_after': syntastic#util#DevNull() })
let errorformat =
\ '%E%f:%l:%c: %\d%#:%\d%# %.%\{-}error:%.%\{-} %m,' .
\ '%W%f:%l:%c: %\d%#:%\d%# %.%\{-}warning:%.%\{-} %m,' .
\ '%C%f:%l %m,' .
\ '%-Z%.%#'
let errorformat = '%f:%l: %trror: %m'
return SyntasticMake({
\ 'makeprg': makeprg,
@ -33,8 +29,8 @@ function! SyntaxCheckers_rust_rustc_GetLocList() dict
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'rust',
\ 'name': 'rustc'})
\ 'filetype': 'sass',
\ 'name': 'sassc'})
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -15,19 +15,16 @@ if exists('g:loaded_syntastic_scala_fsc_checker')
endif
let g:loaded_syntastic_scala_fsc_checker = 1
if !exists('g:syntastic_scala_options')
let g:syntastic_scala_options = ''
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_scala_fsc_GetLocList() dict
call syntastic#log#deprecationWarn('scala_options', 'scala_fsc_args')
" fsc has some serious problems with the
" working directory changing after being started
" that's why we better pass an absolute path
let makeprg = self.makeprgBuild({
\ 'args': g:syntastic_scala_options,
\ 'args_after': '-Ystop-after:parser',
\ 'fname': syntastic#util#shexpand('%:p') })

View File

@ -15,17 +15,13 @@ if exists("g:loaded_syntastic_scala_scalac_checker")
endif
let g:loaded_syntastic_scala_scalac_checker = 1
if !exists('g:syntastic_scala_options')
let g:syntastic_scala_options = ''
endif
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_scala_scalac_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args': g:syntastic_scala_options,
\ 'args_after': '-Ystop-after:parser' })
call syntastic#log#deprecationWarn('scala_options', 'scala_scalac_args')
let makeprg = self.makeprgBuild({ 'args_after': '-Ystop-after:parser' })
let errorformat =
\ '%E%f:%l: %trror: %m,' .

View File

@ -1,4 +1,3 @@
"============================================================================
"File: scss.vim
"Description: scss syntax checking plugin for syntastic

View File

@ -0,0 +1,25 @@
"============================================================================
"File: sassc.vim
"Description: Syntax checking plugin for syntastic
"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_scss_sassc_checker")
finish
endif
let g:loaded_syntastic_scss_sassc_checker = 1
runtime! syntax_checkers/sass/*.vim
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'scss',
\ 'name': 'sassc',
\ 'redirect': 'sass/sassc'})
" vim: set et sts=4 sw=4:

View File

@ -18,41 +18,6 @@ let g:loaded_syntastic_sh_sh_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! s:GetShell()
if !exists('b:shell') || b:shell == ''
let b:shell = ''
let shebang = getbufline(bufnr('%'), 1)[0]
if shebang != ''
if stridx(shebang, 'bash') >= 0
let b:shell = 'bash'
elseif stridx(shebang, 'zsh') >= 0
let b:shell = 'zsh'
elseif stridx(shebang, 'sh') >= 0
let b:shell = 'sh'
endif
endif
" try to use env variable in case no shebang could be found
if b:shell == ''
let b:shell = fnamemodify(expand('$SHELL'), ':t')
endif
endif
return b:shell
endfunction
function! s:ForwardToZshChecker()
let registry = g:SyntasticRegistry.Instance()
if registry.isCheckable('zsh')
return registry.getCheckers('zsh', ['zsh'])[0].getLocListRaw()
else
return []
endif
endfunction
function! s:IsShellValid()
return len(s:GetShell()) > 0 && executable(s:GetShell())
endfunction
function! SyntaxCheckers_sh_sh_IsAvailable() dict
return s:IsShellValid()
endfunction
@ -77,6 +42,42 @@ function! SyntaxCheckers_sh_sh_GetLocList() dict
\ 'errorformat': errorformat })
endfunction
function! s:GetShell()
if !exists('b:shell') || b:shell == ''
let b:shell = ''
let shebang = syntastic#util#parseShebang()['exe']
if shebang != ''
if shebang[-strlen('bash'):-1] ==# 'bash'
let b:shell = 'bash'
elseif shebang[-strlen('zsh'):-1] ==# 'zsh'
let b:shell = 'zsh'
elseif shebang[-strlen('sh'):-1] ==# 'sh'
let b:shell = 'sh'
endif
endif
" try to use env variable in case no shebang could be found
if b:shell == ''
let b:shell = fnamemodify(expand('$SHELL'), ':t')
endif
endif
return b:shell
endfunction
function! s:IsShellValid()
let shell = s:GetShell()
return shell != '' && executable(shell)
endfunction
function! s:ForwardToZshChecker()
let registry = g:SyntasticRegistry.Instance()
let zsh_checkers = registry.getCheckersAvailable('zsh', ['zsh'])
if !empty(zsh_checkers)
return zsh_checkers[0].getLocListRaw()
else
return []
endif
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'sh',
\ 'name': 'sh' })

View File

@ -0,0 +1,46 @@
"============================================================================
"File: typescript/tslint.vim
"Description: TypeScript linter
"Maintainer: Seon-Wook Park <seon.wook@swook.net>
"============================================================================
if exists("g:loaded_syntastic_typescript_tslint_checker")
finish
endif
let g:loaded_syntastic_typescript_tslint_checker = 1
let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_typescript_tslint_GetHighlightRegex(item)
let term = matchstr(a:item['text'], "\\m\\s'\\zs.\\{-}\\ze'\\s")
return term != '' ? '\V' . escape(term, '\') : ''
endfunction
function! SyntaxCheckers_typescript_tslint_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'args_after': '--format verbose',
\ 'fname_before': '-f' })
" (comment-format) ts/app.ts[12, 36]: comment must start with lowercase letter
let errorformat = '%f[%l\, %c]: %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'preprocess': 'tslint',
\ 'returns': [0, 2] })
call self.setWantSort(1)
return loclist
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'typescript',
\ 'name': 'tslint'})
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: set et sts=4 sw=4:

View File

@ -37,7 +37,7 @@ set cpo&vim
function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos)
let length = strlen(matchstr(a:pos['text'], '\m\^\+$'))
return '\%>' . (a:pos['col'] - 1) . 'c.*\%<' . (a:pos['col'] + length + 1) . 'c'
return '\%>' . (a:pos['col'] - 1) . 'c\%<' . (a:pos['col'] + length) . 'c'
endfunction
function! s:GetValaModules()

View File

@ -19,7 +19,7 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_vhdl_ghdl_GetLocList() dict
let makeprg = self.makeprgBuild({ 'args_after': '-s' })
let makeprg = self.makeprgBuild({ 'args_before': '-s' })
let errorformat = '%f:%l:%c: %m'

View File

@ -29,7 +29,7 @@ function! SyntaxCheckers_vim_vimlint_GetHighlightRegex(item)
endif
endif
return '\V' . (col ? '\%' . col . 'c' : '') . escape(term, '\')
return col ? '\%>' . (col - 1) . 'c\%<' . (col + strlen(term)) . 'c' : '\V' . escape(term, '\')
endif
return ''
@ -81,7 +81,8 @@ endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'vim',
\ 'name': 'vimlint'})
\ 'name': 'vimlint',
\ 'exec': 'vim' })
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -24,19 +24,18 @@ let s:save_cpo = &cpo
set cpo&vim
function! SyntaxCheckers_yaml_yamlxs_IsAvailable() dict
if !exists('g:syntastic_perl_interpreter')
let g:syntastic_perl_interpreter = self.getExec()
if !exists('g:syntastic_yaml_yamlxs_exec') && exists('g:syntastic_perl_interpreter')
let g:syntastic_yaml_yamlxs_exec = g:syntastic_perl_interpreter
endif
" don't call executable() here, to allow things like
" let g:syntastic_perl_interpreter='/usr/bin/env perl'
silent! call system(s:Exe() . ' ' . s:Modules() . ' -e ' . syntastic#util#shescape('exit(0)'))
silent! call system(self.getExecEscaped() . ' ' . s:Modules() . ' -e ' . syntastic#util#shescape('exit(0)'))
return v:shell_error == 0
endfunction
function! SyntaxCheckers_yaml_yamlxs_GetLocList() dict
let makeprg = self.makeprgBuild({
\ 'exe': s:Exe(),
\ 'args_before': s:Modules() . ' -e ' . syntastic#util#shescape('YAML::XS::LoadFile($ARGV[0])') })
let errorformat =
@ -53,13 +52,9 @@ function! SyntaxCheckers_yaml_yamlxs_GetLocList() dict
\ 'defaults': {'bufnr': bufnr("")} })
endfunction
function! s:Exe()
return syntastic#util#shexpand(g:syntastic_perl_interpreter)
endfunction
function s:Modules()
if type(g:syntastic_perl_lib_path) == type('')
call syntastic#log#deprecationWarn('variable g:syntastic_perl_lib_path should be a list')
call syntastic#log#oneTimeWarn('variable g:syntastic_perl_lib_path should be a list')
let includes = split(g:syntastic_perl_lib_path, ',')
else
let includes = copy(syntastic#util#var('perl_lib_path'))

View File

@ -14,7 +14,7 @@
" - 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
" https://raw.githubusercontent.com/rgiot/pycpcdemotools/master/cpcdemotools/source_checker/z80_syntax_checker.py
if exists("g:loaded_syntastic_z80_z80syntaxchecker_checker")
finish