#732 - Use the configuration files when fixing files with rubocop

This commit is contained in:
w0rp
2017-07-06 22:58:14 +01:00
parent b43413916d
commit 854066e849
3 changed files with 20 additions and 4 deletions

View File

@@ -3,8 +3,10 @@ function! ale#fixers#rubocop#GetCommand(buffer) abort
let l:exec_args = l:executable =~? 'bundle$'
\ ? ' exec rubocop'
\ : ''
let l:config = ale#path#FindNearestFile(a:buffer, '.rubocop.yml')
return ale#Escape(l:executable) . l:exec_args
\ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '')
\ . ' --auto-correct %t'
endfunction