class RuboCop::Cop::Layout::EmptyLinesAroundClassBody
end
end
# …
def bar
class Foo
# good
@example EnforcedStyle: no_empty_lines (default)
end
end
# …
def bar
class Foo
# good
@example Enforcedstyle: ending_only
end
end
# …
def bar
class Foo
# good
@example Enforcedstyle: beginning_only
end
def bar; end
class Foo
# good
@example EnforcedStyle: empty_lines_special
end
end
# …
class Bar
class Foo
# good
@example EnforcedStyle: empty_lines_except_namespace
end
end
# …
def bar
class Foo
# good
@example EnforcedStyle: empty_lines
the configuration.
This cop checks if empty lines around the bodies of classes match
def autocorrect(node)
def autocorrect(node) EmptyLineCorrector.correct(node) end
def on_class(node)
def on_class(node) _name, superclass, body = *node adjusted_first_line = superclass.first_line if superclass check(node, body, adjusted_first_line: adjusted_first_line) end
def on_sclass(node)
def on_sclass(node) _obj, body = *node check(node, body) end