diff options
author | Ryan Rosenblum <ryan.rosenblum@gmail.com> | 2018-08-24 11:33:59 -0400 |
---|---|---|
committer | Ryan Rosenblum <ryan.rosenblum@gmail.com> | 2018-09-12 16:53:28 -0400 |
commit | 9e09b7ca3559e2c14ed2401bb666b441b22dafff (patch) | |
tree | 2ef0434865ce0c88bd02489cc756742c63a5c3dd /autoload | |
parent | 78af99c2566ef8fed443ce253e0de9323b9e5043 (diff) | |
download | ale-9e09b7ca3559e2c14ed2401bb666b441b22dafff.zip |
Update all Ruby linters to work consistently with bundler
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/fixers/rubocop.vim | 5 | ||||
-rw-r--r-- | autoload/ale/handlers/rubocop.vim | 4 | ||||
-rw-r--r-- | autoload/ale/handlers/ruby.vim | 7 |
3 files changed, 11 insertions, 5 deletions
diff --git a/autoload/ale/fixers/rubocop.vim b/autoload/ale/fixers/rubocop.vim index 0a39ef62..47a78308 100644 --- a/autoload/ale/fixers/rubocop.vim +++ b/autoload/ale/fixers/rubocop.vim @@ -1,12 +1,9 @@ function! ale#fixers#rubocop#GetCommand(buffer) abort let l:executable = ale#handlers#rubocop#GetExecutable(a:buffer) - let l:exec_args = l:executable =~? 'bundle$' - \ ? ' exec rubocop' - \ : '' let l:config = ale#path#FindNearestFile(a:buffer, '.rubocop.yml') let l:options = ale#Var(a:buffer, 'ruby_rubocop_options') - return ale#Escape(l:executable) . l:exec_args + return l:executable \ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '') \ . (!empty(l:options) ? ' ' . l:options : '') \ . ' --auto-correct %t' diff --git a/autoload/ale/handlers/rubocop.vim b/autoload/ale/handlers/rubocop.vim index f6367cf5..09af7085 100644 --- a/autoload/ale/handlers/rubocop.vim +++ b/autoload/ale/handlers/rubocop.vim @@ -2,5 +2,7 @@ call ale#Set('ruby_rubocop_options', '') call ale#Set('ruby_rubocop_executable', 'rubocop') function! ale#handlers#rubocop#GetExecutable(buffer) abort - return ale#Var(a:buffer, 'ruby_rubocop_executable') + let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable') + + return ale#handlers#ruby#EscapeExecutable(l:executable, 'rubocop') endfunction diff --git a/autoload/ale/handlers/ruby.vim b/autoload/ale/handlers/ruby.vim index 110fe156..c28b8b75 100644 --- a/autoload/ale/handlers/ruby.vim +++ b/autoload/ale/handlers/ruby.vim @@ -37,3 +37,10 @@ function! ale#handlers#ruby#HandleSyntaxErrors(buffer, lines) abort return s:HandleSyntaxError(a:buffer, a:lines) endfunction +function! ale#handlers#ruby#EscapeExecutable(executable, bundle_exec) abort + let l:exec_args = a:executable =~? 'bundle' + \ ? ' exec ' . a:bundle_exec + \ : '' + + return ale#Escape(a:executable) . l:exec_args +endfunction |