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
Style/ClassAndModuleChildren
does not handle comments properly
#9767
Comments
I think in both cases, we should probably just move all comments to above the outer class/module. |
… comments Closes rubocop#9767
@dvandersluis I feel the existing behaviour for |
@tejasbubane I actually have never even noticed that But that's not actually what I was getting at. My point was that there's no way of knowing if the inline comment was for module A or class B in the original case, so putting it on top is probably "safer". |
class A::B # some comment Since this is definition of My point is |
EnforcedStyle: compact
autocorrects to
The
class A comment
disappears.EnforcedStyle: nested
autocorrects to
The comment moves to the inner class which may not be desired.
RuboCop version
master
The text was updated successfully, but these errors were encountered: