diff options
-rw-r--r-- | autoload/ale/fixers/rubocop.vim | 3 | ||||
-rw-r--r-- | test/fixers/test_rubocop_fixer_callback.vader | 17 |
2 files changed, 17 insertions, 3 deletions
diff --git a/autoload/ale/fixers/rubocop.vim b/autoload/ale/fixers/rubocop.vim index 88dc1c43..557b7594 100644 --- a/autoload/ale/fixers/rubocop.vim +++ b/autoload/ale/fixers/rubocop.vim @@ -7,7 +7,8 @@ function! ale#fixers#rubocop#GetCommand(buffer) abort return ale#Escape(l:executable) . l:exec_args \ . (!empty(l:config) ? ' --config ' . ale#Escape(l:config) : '') - \ . ' --auto-correct %t' + \ . ' --auto-correct %t ' + \ . ale#Var(a:buffer, 'ruby_rubocop_options') endfunction diff --git a/test/fixers/test_rubocop_fixer_callback.vader b/test/fixers/test_rubocop_fixer_callback.vader index e3383537..e9a87395 100644 --- a/test/fixers/test_rubocop_fixer_callback.vader +++ b/test/fixers/test_rubocop_fixer_callback.vader @@ -21,7 +21,7 @@ Execute(The rubocop callback should return the correct default values): \ { \ 'read_temporary_file': 1, \ 'command': ale#Escape(g:ale_ruby_rubocop_executable) - \ . ' --auto-correct %t', + \ . ' --auto-correct %t ', \ }, \ ale#fixers#rubocop#Fix(bufnr('')) @@ -33,6 +33,19 @@ Execute(The rubocop callback should include configuration files): \ 'read_temporary_file': 1, \ 'command': ale#Escape(g:ale_ruby_rubocop_executable) \ . ' --config ' . ale#Escape(g:dir . '/ruby_paths/with_config/.rubocop.yml') - \ . ' --auto-correct %t', + \ . ' --auto-correct %t ', + \ }, + \ ale#fixers#rubocop#Fix(bufnr('')) + +Execute(The rubocop callback should include custom rubocop options): + let g:ale_ruby_rubocop_options = '--except Lint/Debugger' + call ale#test#SetFilename('ruby_paths/with_config/dummy.rb') + + AssertEqual + \ { + \ 'read_temporary_file': 1, + \ 'command': ale#Escape(g:ale_ruby_rubocop_executable) + \ . ' --config ' . ale#Escape(g:dir . '/ruby_paths/with_config/.rubocop.yml') + \ . ' --auto-correct %t --except Lint/Debugger', \ }, \ ale#fixers#rubocop#Fix(bufnr('')) |