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
# Demonstrate that comments aren't allowed before an access modifier
class MyClass
def foo
bar
end
# FIXME: Get rid of private methods in this class.
private
def bar
puts 'bar called'
end
end
Generates the following offense
comment_before_access_modifier.rb:8:3: C: Style/EmptyLinesAroundAccessModifier: Keep a blank line before and after private.
private
^^^^^^^
If an access modifier has a comment before it, but an empty line before the comment, then it should not generate an offense, or it should be possible to configure the cop to not generate an offense.
I don't have any opinion about comments after an access modifier. I guess they should be allowed for consistency, but I don't see the point of having a comment after an access modifier.
The text was updated successfully, but these errors were encountered:
The following code
Generates the following offense
If an access modifier has a comment before it, but an empty line before the comment, then it should not generate an offense, or it should be possible to configure the cop to not generate an offense.
I don't have any opinion about comments after an access modifier. I guess they should be allowed for consistency, but I don't see the point of having a comment after an access modifier.
The text was updated successfully, but these errors were encountered: