Style/AccessorGrouping
safe autocorrect results in invalid code
#12692
Labels
Style/AccessorGrouping
safe autocorrect results in invalid code
#12692
Sometimes the
Style/AccessorGrouping
cop, which is marked as a safe autocorrect, corrects to incorrect code.Expected behavior
When running
rubocop -a foo.rb
wherefoo.rb
is the following file:I expect
Style/AccessorGrouping
to either not safe autocorrect, or for it to safe autocorrect to:Actual behavior
It safe autocorrects to:
This code is invalid, because
OTHER_ATTRS
is used before it is defined.Steps to reproduce the problem
Run
rubocop -a foo.rb
wherefoo.rb
is the above file.RuboCop version
The text was updated successfully, but these errors were encountered: