Merge remote branch 'upstream/master'
This commit is contained in:
commit
d751322218
@ -66,6 +66,35 @@ To get information or make suggestions check out the [google group](https://grou
|
||||
|
||||
Changelog
|
||||
---------
|
||||
2.3.0 (16-feb-2012)
|
||||
|
||||
* Add syntastic_loc_list_height option
|
||||
* Allow errors to have a "subtype" that is signed differently to standard
|
||||
errors. Currently geared towards differentiating style errors from
|
||||
syntax errors. Currently implemented for phpcs (technosophos).
|
||||
* New checkers for:
|
||||
* yaml
|
||||
* haxe (davidB)
|
||||
* ocaml (edwintorok)
|
||||
* pylint (parantapa)
|
||||
* rust (cjab)
|
||||
* Updates to existing checkers:
|
||||
* jslint
|
||||
* jshint (gillesruppert)
|
||||
* fortran (bmattern)
|
||||
* sass
|
||||
* html (darcyparker)
|
||||
* coffee (darcyparker)
|
||||
* docbk (darcyparker)
|
||||
* xml
|
||||
* xslt
|
||||
* less (irrationalfab)
|
||||
* php (AD7six, technosophos)
|
||||
* cuda
|
||||
* python (mitchellh, pneff)
|
||||
* perl (Anthony Carapetis)
|
||||
* c (naoina, zsprackett)
|
||||
* puppet (frimik)
|
||||
|
||||
2.2.0 (24-dec-2011)
|
||||
|
||||
@ -82,61 +111,3 @@ Changelog
|
||||
* JSON (millermedeiros, tocer)
|
||||
* rst (reStructuredText files) (JNRowe)
|
||||
* gentoo-metadata (JNRowe)
|
||||
|
||||
2.1.0 (14-dec-2011)
|
||||
|
||||
* when the cursor is on a line containing an error, echo the
|
||||
* error msg (kevinw)
|
||||
* various bug fixes and refactoring
|
||||
* updates/fixes to existing checkers:
|
||||
* html (millermedeiros)
|
||||
* erlang
|
||||
* coffeescript
|
||||
* javascript
|
||||
* sh
|
||||
* php (add support for phpcs - technosophos)
|
||||
* add an applescript checker (Zhai Cai)
|
||||
* add support for hyphenated filetypes (JNRowe)
|
||||
|
||||
2.0.0 (2-dec-2011):
|
||||
|
||||
* Add support for highlighting the erroneous parts of lines (kstep)
|
||||
* Add support for displaying errors via balloons (kstep)
|
||||
* Add syntastic_mode_map option to give more control over when checking should be done.
|
||||
* Add :SyntasticCheck command to force a syntax check - useful in passive mode (justone).
|
||||
* Add the option to automatically close the location list, but not automatically open it (milkypostman)
|
||||
* Add syntastic_auto_jump option to automatically jump to the first error (milkypostman)
|
||||
* Only source syntax checkers as needed - instead of loading all of them when vim starts
|
||||
|
||||
* Support for new filetypes:
|
||||
* less (julienXX)
|
||||
* docbook (tpope)
|
||||
* matlab (jasongraham)
|
||||
* go (dtjm)
|
||||
* puppet (uggedal, roman, zsprackett)
|
||||
* haskell (baldo, roman)
|
||||
* tcl (et)
|
||||
* vala (kstep)
|
||||
* cuda (temporaer)
|
||||
* css (oryband, sitedyno)
|
||||
* fortran (Karl Yngve Lervåg)
|
||||
* xml (kusnier)
|
||||
* xslt (kusnier)
|
||||
* erlang (kTT)
|
||||
* zpt (claytron)
|
||||
|
||||
* updates to existing checkers:
|
||||
* javascript (mogren, bryanforbes, cjab, ajduncan)
|
||||
* sass/scss (tmm1, atourino, dlee, epeli)
|
||||
* ruby (changa)
|
||||
* perl (harleypig)
|
||||
* haml (bmihelac)
|
||||
* php (kstep, docteurklein)
|
||||
* python (kstep, soli)
|
||||
* lua (kstep)
|
||||
* html (kstep)
|
||||
* xhtml (kstep)
|
||||
* c (kongo2002, brandonw)
|
||||
* cpp (kongo2002)
|
||||
* coffee (industrial)
|
||||
* eruby (sergevm)
|
||||
|
@ -355,7 +355,7 @@ The latest dev versions are on github
|
||||
==============================================================================
|
||||
7. Changelog *syntastic-changelog*
|
||||
|
||||
next
|
||||
2.3.0
|
||||
- Add syntastic_loc_list_height option
|
||||
- Allow errors to have a "subtype" that is signed differently to standard
|
||||
errors. Currently geared towards differentiating style errors from
|
||||
@ -365,9 +365,11 @@ next
|
||||
- haxe (davidB)
|
||||
- ocaml (edwintorok)
|
||||
- pylint (parantapa)
|
||||
- rust (cjab)
|
||||
|
||||
- Updates to existing checkers:
|
||||
- jslint
|
||||
- jshint (gillesruppert)
|
||||
- fortran (bmattern)
|
||||
- sass
|
||||
- html (darcyparker)
|
||||
@ -378,10 +380,10 @@ next
|
||||
- less (irrationalfab)
|
||||
- php (AD7six, technosophos)
|
||||
- cuda
|
||||
- python (mitchellh)
|
||||
- python (mitchellh, pneff)
|
||||
- perl (Anthony Carapetis)
|
||||
- c (naoina, zsprackett)
|
||||
- puppet
|
||||
- puppet (frimik)
|
||||
|
||||
2.2.0
|
||||
- only do syntax checks when files are saved (not when first opened) - add
|
||||
@ -495,6 +497,9 @@ next
|
||||
Thanks to the following people for testing, bug reports, patches etc. They own,
|
||||
hard.
|
||||
|
||||
Mikael Fridh (frimik)
|
||||
Patrice Neff (pneff )
|
||||
Gilles Ruppert (gillesruppert)
|
||||
Naoya INADA (naoina)
|
||||
Mitchell Hashimoto (mitchellh)
|
||||
irrationalfab
|
||||
|
@ -2,8 +2,8 @@
|
||||
"File: syntastic.vim
|
||||
"Description: vim plugin for on the fly syntax checking
|
||||
"Maintainer: Martin Grenfell <martin.grenfell at gmail dot com>
|
||||
"Version: 2.2.0
|
||||
"Last Change: 24 Dec, 2011
|
||||
"Version: 2.3.0
|
||||
"Last Change: 16 Feb, 2012
|
||||
"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
|
||||
@ -160,8 +160,10 @@ function! s:LocList()
|
||||
endfunction
|
||||
|
||||
"clear the loc list for the buffer
|
||||
function! s:ClearLocList()
|
||||
function! s:ClearCache()
|
||||
let b:syntastic_loclist = []
|
||||
unlet! b:syntastic_errors
|
||||
unlet! b:syntastic_warnings
|
||||
endfunction
|
||||
|
||||
"detect and cache all syntax errors in this buffer
|
||||
@ -169,7 +171,7 @@ endfunction
|
||||
"depends on a function called SyntaxCheckers_{&ft}_GetLocList() existing
|
||||
"elsewhere
|
||||
function! s:CacheErrors()
|
||||
call s:ClearLocList()
|
||||
call s:ClearCache()
|
||||
|
||||
if filereadable(expand("%"))
|
||||
|
||||
@ -195,7 +197,7 @@ function! s:ToggleMode()
|
||||
let g:syntastic_mode_map['mode'] = "active"
|
||||
endif
|
||||
|
||||
call s:ClearLocList()
|
||||
call s:ClearCache()
|
||||
call s:UpdateErrors(1)
|
||||
|
||||
echo "Syntastic: " . g:syntastic_mode_map['mode'] . " mode enabled"
|
||||
@ -217,30 +219,22 @@ function! s:ModeMapAllowsAutoChecking()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
"return true if there are cached errors/warnings for this buf
|
||||
function! s:BufHasErrorsOrWarnings()
|
||||
return !empty(s:LocList())
|
||||
endfunction
|
||||
|
||||
"return true if there are cached errors for this buf
|
||||
function! s:BufHasErrors()
|
||||
return len(s:ErrorsForType('E')) > 0
|
||||
endfunction
|
||||
|
||||
function! s:BufHasErrorsOrWarningsToDisplay()
|
||||
return s:BufHasErrors() || (!g:syntastic_quiet_warnings && s:BufHasErrorsOrWarnings())
|
||||
endfunction
|
||||
|
||||
function! s:ErrorsForType(type)
|
||||
return s:FilterLocList({'type': a:type})
|
||||
return len(s:Errors()) || (!g:syntastic_quiet_warnings && !empty(s:LocList()))
|
||||
endfunction
|
||||
|
||||
function! s:Errors()
|
||||
return s:ErrorsForType("E")
|
||||
if !exists("b:syntastic_errors")
|
||||
let b:syntastic_errors = s:FilterLocList({'type': "E"})
|
||||
endif
|
||||
return b:syntastic_errors
|
||||
endfunction
|
||||
|
||||
function! s:Warnings()
|
||||
return s:ErrorsForType("W")
|
||||
if !exists("b:syntastic_warnings")
|
||||
let b:syntastic_warnings = s:FilterLocList({'type': "W"})
|
||||
endif
|
||||
return b:syntastic_warnings
|
||||
endfunction
|
||||
|
||||
"Filter a loc list (defaults to s:LocList()) by a:filters
|
||||
@ -253,16 +247,21 @@ endfunction
|
||||
function! s:FilterLocList(filters, ...)
|
||||
let llist = a:0 ? a:1 : s:LocList()
|
||||
|
||||
let rv = deepcopy(llist)
|
||||
for error in llist
|
||||
for key in keys(a:filters)
|
||||
let rhs = a:filters[key]
|
||||
if type(rhs) == 1 "string
|
||||
let rhs = '"' . rhs . '"'
|
||||
endif
|
||||
let rv = []
|
||||
|
||||
call filter(rv, "v:val['".key."'] ==? " . rhs)
|
||||
for error in llist
|
||||
|
||||
let passes_filters = 1
|
||||
for key in keys(a:filters)
|
||||
if error[key] !=? a:filters[key]
|
||||
let passes_filters = 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
if passes_filters
|
||||
call add(rv, error)
|
||||
endif
|
||||
endfor
|
||||
return rv
|
||||
endfunction
|
||||
@ -439,30 +438,33 @@ function! SyntasticStatuslineFlag()
|
||||
let errors = s:Errors()
|
||||
let warnings = s:Warnings()
|
||||
|
||||
let num_errors = len(errors)
|
||||
let num_warnings = len(warnings)
|
||||
|
||||
let output = g:syntastic_stl_format
|
||||
|
||||
"hide stuff wrapped in %E(...) unless there are errors
|
||||
let output = substitute(output, '\C%E{\([^}]*\)}', len(errors) ? '\1' : '' , 'g')
|
||||
let output = substitute(output, '\C%E{\([^}]*\)}', num_errors ? '\1' : '' , 'g')
|
||||
|
||||
"hide stuff wrapped in %W(...) unless there are warnings
|
||||
let output = substitute(output, '\C%W{\([^}]*\)}', len(warnings) ? '\1' : '' , 'g')
|
||||
let output = substitute(output, '\C%W{\([^}]*\)}', num_warnings ? '\1' : '' , 'g')
|
||||
|
||||
"hide stuff wrapped in %B(...) unless there are both errors and warnings
|
||||
let output = substitute(output, '\C%B{\([^}]*\)}', (len(warnings) && len(errors)) ? '\1' : '' , 'g')
|
||||
let output = substitute(output, '\C%B{\([^}]*\)}', (num_warnings && num_errors) ? '\1' : '' , 'g')
|
||||
|
||||
"sub in the total errors/warnings/both
|
||||
let output = substitute(output, '\C%w', len(warnings), 'g')
|
||||
let output = substitute(output, '\C%e', len(errors), 'g')
|
||||
let output = substitute(output, '\C%w', num_warnings, 'g')
|
||||
let output = substitute(output, '\C%e', num_errors, 'g')
|
||||
let output = substitute(output, '\C%t', len(s:LocList()), 'g')
|
||||
|
||||
"first error/warning line num
|
||||
let output = substitute(output, '\C%F', s:LocList()[0]['lnum'], 'g')
|
||||
|
||||
"first error line num
|
||||
let output = substitute(output, '\C%fe', len(errors) ? errors[0]['lnum'] : '', 'g')
|
||||
let output = substitute(output, '\C%fe', num_errors ? errors[0]['lnum'] : '', 'g')
|
||||
|
||||
"first warning line num
|
||||
let output = substitute(output, '\C%fw', len(warnings) ? warnings[0]['lnum'] : '', 'g')
|
||||
let output = substitute(output, '\C%fw', num_warnings ? warnings[0]['lnum'] : '', 'g')
|
||||
|
||||
return output
|
||||
else
|
||||
|
@ -32,12 +32,23 @@ function! SyntaxCheckers_puppet_GetLocList()
|
||||
if s:puppetVersion[0] >= '2' && s:puppetVersion[1] >= '7'
|
||||
let makeprg = 'puppet parser validate ' .
|
||||
\ shellescape(expand('%')) .
|
||||
\ ' --color=false --ignoreimport'
|
||||
\ ' --color=false' .
|
||||
\ ' --storeconfigs'
|
||||
|
||||
"add --ignoreimport for versions < 2.7.10
|
||||
if s:puppetVersion[2] < '10'
|
||||
let makeprg .= ' --ignoreimport'
|
||||
endif
|
||||
|
||||
else
|
||||
let makeprg = 'puppet --color=false --parseonly --ignoreimport '.shellescape(expand('%'))
|
||||
endif
|
||||
|
||||
let errorformat = 'err: Could not parse for environment %*[a-z]: %m at %f:%l'
|
||||
"some versions of puppet (e.g. 2.7.10) output the message below if there
|
||||
"are any syntax errors
|
||||
let errorformat = '%-Gerr: Try ''puppet help parser validate'' for usage,'
|
||||
|
||||
let errorformat .= 'err: Could not parse for environment %*[a-z]: %m at %f:%l'
|
||||
|
||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||
endfunction
|
||||
|
@ -31,6 +31,9 @@ if !exists('g:syntastic_python_checker') || !executable(g:syntastic_python_check
|
||||
finish
|
||||
endif
|
||||
endif
|
||||
if !exists('g:syntastic_python_checker_args')
|
||||
let g:syntastic_python_checker_args = ''
|
||||
endif
|
||||
|
||||
function! SyntaxCheckers_python_Term(i)
|
||||
if a:i['type'] ==# 'E'
|
||||
@ -64,7 +67,7 @@ if g:syntastic_python_checker == 'pylint'
|
||||
endfunction
|
||||
else
|
||||
function! SyntaxCheckers_python_GetLocList()
|
||||
let makeprg = g:syntastic_python_checker.' '.shellescape(expand('%'))
|
||||
let makeprg = g:syntastic_python_checker.' '.g:syntastic_python_checker_args.' '.shellescape(expand('%'))
|
||||
let errorformat =
|
||||
\ '%E%f:%l: could not compile,%-Z%p^,%W%f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user