diff options
author | w0rp <devw0rp@gmail.com> | 2017-07-06 22:47:07 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-07-06 22:47:07 +0100 |
commit | b43413916d0f215fb7a38c53784b3e68360d914a (patch) | |
tree | b31007af1d15e420b2cecd769ea03725847baf0b /ale_linters/ruby/rubocop.vim | |
parent | 5859050d293787ba3676517b16a9ecd141f3c002 (diff) | |
download | ale-b43413916d0f215fb7a38c53784b3e68360d914a.zip |
Initialize rubocop variables in one place
Diffstat (limited to 'ale_linters/ruby/rubocop.vim')
-rw-r--r-- | ale_linters/ruby/rubocop.vim | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/ale_linters/ruby/rubocop.vim b/ale_linters/ruby/rubocop.vim index f8b07250..9b77f896 100644 --- a/ale_linters/ruby/rubocop.vim +++ b/ale_linters/ruby/rubocop.vim @@ -1,22 +1,8 @@ " Author: ynonp - https://github.com/ynonp " Description: rubocop for Ruby files -" Set this option to change Rubocop options. -if !exists('g:ale_ruby_rubocop_options') - " let g:ale_ruby_rubocop_options = '--lint' - let g:ale_ruby_rubocop_options = '' -endif - -if !exists('g:ale_ruby_rubocop_executable') - let g:ale_ruby_rubocop_executable = 'rubocop' -endif - -function! ale_linters#ruby#rubocop#GetExecutable(buffer) abort - return ale#Var(a:buffer, 'ruby_rubocop_executable') -endfunction - function! ale_linters#ruby#rubocop#GetCommand(buffer) abort - let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable') + let l:executable = ale#handlers#rubocop#GetExecutable(a:buffer) let l:exec_args = l:executable =~? 'bundle$' \ ? ' exec rubocop' \ : '' @@ -52,7 +38,7 @@ endfunction call ale#linter#Define('ruby', { \ 'name': 'rubocop', -\ 'executable_callback': 'ale_linters#ruby#rubocop#GetExecutable', +\ 'executable_callback': 'ale#handlers#rubocop#GetExecutable', \ 'command_callback': 'ale_linters#ruby#rubocop#GetCommand', \ 'callback': 'ale_linters#ruby#rubocop#Handle', \}) |