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
The Layout/ClassStructure cop fails to surface private/public method ordering violations when inline access modifiers are used. Given the file ab.rb with:
class A
private def foo
end
public def bar
end
end
class B
private
def foo
end
public
def bar
end
end
Expected behavior
Layout/ClassStructure should be agnostic to visibility modifier and flag both definitions of bar (A#bar and B#bar).
Actual behavior
Only B#bar is flagged:
rubocop ab.rb --only Layout/ClassStructure
Inspecting 1 file
C
Offenses:
ab.rb:15:3: C: [Correctable] Layout/ClassStructure: public_methods is supposed to appear before private_methods.
def bar ...
^^^^^^^
1 file inspected, 1 offense detected, 1 offense auto-correctable
The
Layout/ClassStructure
cop fails to surface private/public method ordering violations when inline access modifiers are used. Given the fileab.rb
with:Expected behavior
Layout/ClassStructure
should be agnostic to visibility modifier and flag both definitions ofbar
(A#bar
andB#bar
).Actual behavior
Only
B#bar
is flagged:Steps to reproduce the problem
☝️
RuboCop version
The text was updated successfully, but these errors were encountered: