Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocorrect halts on duplicated attr_reader attribute for Style/AccessorGrouping policy #10633

Closed
PedroSena opened this issue May 13, 2022 · 0 comments · Fixed by #10635
Closed
Assignees
Labels

Comments

@PedroSena
Copy link

Rubocop autocorrect seems to enter an infinite loop on the condition described below and never recovers.

Expected behavior

Expected Rubocop to group duplicated attr_reader into a single call to it

Actual behavior

Rubocop halts, keeps applying changes to the file but seems to be stuck on an infinite loop

Steps to reproduce the problem

foo.rb:

class Foo
  attr_reader :id

  attr_reader :id
end

rubocop -A --only Style/AccessorGrouping foo.rb

RuboCop version

$ bundle exec rubocop -V
1.26.1 (using Parser 3.1.1.0, rubocop-ast 1.16.0, running on ruby 3.1.2 x86_64-linux)
  - rubocop-rails 2.14.2
  - rubocop-rspec 2.9.0
@dvandersluis dvandersluis self-assigned this May 13, 2022
dvandersluis added a commit to dvandersluis/rubocop that referenced this issue May 13, 2022
…orGrouping` when combining multiple of the same accessor.
koic added a commit that referenced this issue May 13, 2022
[Fix #10633] Fix infinite autocorrection loop in `Style/AccessorGrouping` when combining multiple of the same accessor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants