Merge branch 'master' into gcc_refactor

This commit is contained in:
LCD 47 2013-06-06 11:10:10 +03:00
commit d3d4ff3935
6 changed files with 59 additions and 10 deletions

View File

@ -17,13 +17,17 @@ let g:loaded_syntastic_makeprg_autoload = 1
" \ 'args': '-a -b -c',
" \ 'post_args': '--more --args',
" \ 'tail': '> /tmp/output',
" \ 'filetype': 'ruby',
" \ 'subchecker': 'mri' })
"
"Note that the current filename is added by default - but can be overridden by
"passing in an 'fname' arg.
"
"All options can be overriden by the user with global variables - even when
"not specified by the checker in syntastic#makeprg#build().
"Arguments 'filetype' and 'subchecker' are mandatory, handling of composite
"types and user-defined variables breaks if you omit them.
"
"All other options can be overriden by the user with global variables - even
"when not specified by the checker in syntastic#makeprg#build().
"
"E.g. They could override the checker exe with
"

View File

@ -175,7 +175,7 @@ variable to 0. >
*'syntastic_echo_current_error'*
Default: 1
If enabled, syntastic will echo the errror associated with the current line to
If enabled, syntastic will echo the error associated with the current line to
the command window. If multiple errors are found, the first will be used. >
let g:syntastic_echo_current_error=1
<
@ -395,11 +395,14 @@ Checkers that use 'syntastic#makeprg#build()' look like this: >
\ 'args': '-a -b -c',
\ 'post_args': '--more --args',
\ 'tail': '> /tmp/output',
\ 'filetype': 'ruby',
\ 'subchecker': 'mri' })
<
All of the parameters above can be overriden by setting global variables -
even parameters not specified in the call to syntastic#makeprg#build().
The 'filetype' and 'subchecker' parameters are mandatory. All of the other
parameters above are optional (well, you probably need at least 'exe'), and
can be overriden by setting global variables - even parameters not specified
in the call to syntastic#makeprg#build().
E.g. To override the checker exe above, you could do this: >
let g:syntastic_ruby_mri_exe="another_ruby_checker_exe.rb"

View File

@ -9,18 +9,23 @@
" See http://sam.zoy.org/wtfpl/COPYING for more details.
"
"============================================================================
"
" Note: this script requires CoffeeScript version 1.6.2 or newer.
"
if exists("g:loaded_syntastic_coffee_coffee_checker")
finish
endif
let g:loaded_syntastic_coffee_coffee_checker=1
function! SyntaxCheckers_coffee_coffee_IsAvailable()
return executable("coffee")
return executable("coffee") &&
\ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('coffee --version 2>/dev/null'), [1,6,2])
endfunction
function! SyntaxCheckers_coffee_coffee_GetLocList()
let makeprg = syntastic#makeprg#build({
\ 'exe': 'coffee',
\ 'args': '-cp',
\ 'filetype': 'coffee',
\ 'subchecker': 'coffee' })

View File

@ -0,0 +1,37 @@
"============================================================================
"File: golint.vim
"Description: Check go syntax using 'golint'
"Maintainer: Hiroshi Ioka <hirochachacha@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_go_golint_checker")
finish
endif
let g:loaded_syntastic_go_golint_checker=1
function! SyntaxCheckers_go_golint_IsAvailable()
return executable('golint')
endfunction
function! SyntaxCheckers_go_golint_GetLocList()
let makeprg = syntastic#makeprg#build({
\ 'exe': 'golint',
\ 'filetype': 'go',
\ 'subchecker': 'golint' })
let errorformat = '%f:%l:%c: %m,%-G%.%#'
return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'subtype': 'Style' })
endfunction
call g:SyntasticRegistry.CreateAndRegisterChecker({
\ 'filetype': 'go',
\ 'name': 'golint'})

View File

@ -63,7 +63,7 @@ let s:ignore_html_errors = [
\ "<input> attribute \"type\" has invalid value \"search\""
\ ]
function! s:IgnoreErrror(text)
function! s:IgnoreError(text)
for i in s:ignore_html_errors + g:syntastic_html_tidy_ignore_errors
if stridx(a:text, i) != -1
return 1
@ -101,7 +101,7 @@ function! SyntaxCheckers_html_tidy_GetLocList()
" filter out valid HTML5 from the errors
for n in range(len(loclist))
if loclist[n]['valid'] && s:IgnoreErrror(loclist[n]['text']) == 1
if loclist[n]['valid'] && s:IgnoreError(loclist[n]['text']) == 1
let loclist[n]['valid'] = 0
endif
endfor

View File

@ -47,7 +47,7 @@ function! s:TidyEncOptByFenc()
return get(tidy_opts, &fileencoding, '-utf8')
endfunction
function! s:IgnoreErrror(text)
function! s:IgnoreError(text)
for i in g:syntastic_xhtml_tidy_ignore_errors
if stridx(a:text, i) != -1
return 1
@ -75,7 +75,7 @@ function! SyntaxCheckers_xhtml_tidy_GetLocList()
\ 'defaults': {'bufnr': bufnr("")} })
for n in range(len(loclist))
if loclist[n]['valid'] && s:IgnoreErrror(loclist[n]['text']) == 1
if loclist[n]['valid'] && s:IgnoreError(loclist[n]['text']) == 1
let loclist[n]['valid'] = 0
endif
endfor