Because RuboCop is buggy, especially with: ● NOT being a default setting. ○ The core team and many users use the default settings, but other settings are used by less people. ● complex Ruby code. ○ Ruby is a complex language. There are mysterious codes in the world. ○ Cop’s author often overlooks edge cases.
What is the regression test? ● It executes RuboCop ○ with all setting combinations, and ○ in real Ruby projects, that have many / mysterious / cool Ruby code.
With all setting combinations ● Many cops have EnforcedStyle and SupportedStyles attributes. ● The test configures all options. ● It is based on pocke/gry.
Real Ruby projects ● Test with edge cases ○ tric/trick2013, 2015 and 2018. ○ ruby/spec ● Test with large code base ○ ruby/ruby ○ gitlabhq/gitlabhq ○ etc.
rubocop-hq/rubocop#6804, #6803 ● Bug of AutoCorrection ○ -␣10000 => -10_000 ○ 12345e6 => 12_345e6 ● It was found with tric/trick2015/yoshi-taka/entry.rb
In The Future ● Test AutoCorrection dynamically. ○ Currently it tests only SyntaxError, but I hope to make it test RuntimeError. ○ e.g. $ rubocop -a && rspec # $? == 0 Thank you for listening!