Version check for rubocop.

Only rubocop versions 0.9.0 or later are supported.
This commit is contained in:
LCD 47 2013-07-12 07:01:16 +03:00
parent 0f6dad6b4c
commit 3e46bcf71a

View File

@ -19,7 +19,9 @@ endif
let g:loaded_syntastic_ruby_rubocop_checker=1
function! SyntaxCheckers_ruby_rubocop_IsAvailable()
return executable('rubocop')
return
\ executable('rubocop') &&
\ syntastic#util#versionIsAtLeast(syntastic#util#parseVersion('rubocop --version'), [0,9,0])
endfunction
function! SyntaxCheckers_ruby_rubocop_GetLocList()
@ -29,7 +31,7 @@ function! SyntaxCheckers_ruby_rubocop_GetLocList()
\ 'filetype': 'ruby',
\ 'subchecker': 'rubocop' })
let errorformat = '%f:%l:%c:\ %t:\ %m'
let errorformat = '%f:%l:%c: %t: %m'
let loclist = SyntasticMake({
\ 'makeprg': makeprg,