All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save g:ale_ruby_rubocop_executable
3 Save g:ale_ruby_rubocop_options
5 " Use an invalid global executable, so we don't match it.
6 let g:ale_ruby_rubocop_executable = 'xxxinvalid'
7 let g:ale_ruby_rubocop_options = ''
9 call ale#test#SetDirectory('/testplugin/test/fixers')
14 call ale#test#RestoreDirectory()
16 Execute(The rubocop callback should return the correct default values):
17 call ale#test#SetFilename('../test-files/ruby/dummy.rb')
21 \ 'process_with': 'ale#fixers#rubocop#PostProcess',
22 \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
23 \ . ' --auto-correct --force-exclusion --stdin %s',
25 \ ale#fixers#rubocop#Fix(bufnr(''))
27 Execute(The rubocop callback should include custom rubocop options):
28 let g:ale_ruby_rubocop_options = '--except Lint/Debugger'
29 call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
33 \ 'process_with': 'ale#fixers#rubocop#PostProcess',
34 \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
35 \ . ' --except Lint/Debugger'
36 \ . ' --auto-correct --force-exclusion --stdin %s',
38 \ ale#fixers#rubocop#Fix(bufnr(''))
40 Execute(The rubocop callback should use auto-correct-all option when set):
41 let g:ale_ruby_rubocop_auto_correct_all = 1
42 call ale#test#SetFilename('../test-files/ruby/with_config/dummy.rb')
46 \ 'process_with': 'ale#fixers#rubocop#PostProcess',
47 \ 'command': ale#Escape(g:ale_ruby_rubocop_executable)
48 \ . ' --auto-correct-all --force-exclusion --stdin %s'
50 \ ale#fixers#rubocop#Fix(bufnr(''))
52 Execute(The rubocop post-processor should remove diagnostics content):
55 \ 'class MyModel < ApplicationRecord',
56 \ ' # rubocop:disable Rails/InverseOf',
57 \ ' has_one :something',
58 \ ' # rubocop:enable Rails/InverseOf',
61 \ 'array = [1, 2, 3,',
63 \ 'array = [''run'',',
67 \ ale#fixers#rubocop#PostProcess(bufnr(''), [
68 \ 'Inspecting 1 file',
72 \ 'app/models/my_model.rb:8:3: C: [Corrected] Layout/ArrayAlignment: ',
76 \ '1 file inspected, 3 offenses detected, 3 offenses corrected',
77 \ '====================',
78 \ 'class MyModel < ApplicationRecord',
79 \ ' # rubocop:disable Rails/InverseOf',
80 \ ' has_one :something',
81 \ ' # rubocop:enable Rails/InverseOf',
84 \ 'array = [1, 2, 3,',
86 \ 'array = [''run'',',