You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect this to be fine - I only want the accessors underneath private to be available internally to the class instances - but the new Style/AccessorGrouping cop says they should all be grouped together. So, I'm guessing it's not picking up on the different access control levels? This feels like a bug to me, unless I'm missing something.
$ rubocop -V
0.87.0 (using Parser 2.7.1.4, rubocop-ast 0.1.0, running on ruby 2.6.6 x86_64-darwin19)
$ rubocop --only Style/AccessorGrouping
Inspecting 1 file
C
Offenses:
foo.rb:2:3: C: Style/AccessorGrouping: Group together all attr_reader attributes.
attr_reader :alpha, :beta
^^^^^^^^^^^^^^^^^^^^^^^^^
foo.rb:6:3: C: Style/AccessorGrouping: Group together all attr_reader attributes.
attr_reader :gamma, :delta
^^^^^^^^^^^^^^^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered:
I have a class that has an
attr_reader
call at the top (default public access), and then again underneathprivate
- essentially:I would expect this to be fine - I only want the accessors underneath private to be available internally to the class instances - but the new
Style/AccessorGrouping
cop says they should all be grouped together. So, I'm guessing it's not picking up on the different access control levels? This feels like a bug to me, unless I'm missing something.The text was updated successfully, but these errors were encountered: