I may be missing something obvious, but it seems that Rubocop skips the alignment of end
when closing a begin
block.
Given the case:
begin
# Foo
end
I would expect the "end" to have a Layout error: Layout/EndAlignment end is not aligned with begin
However, Rubocop seems to believe this is correct.
I would expect one of Layout/DefEndAlignment
, Layout/EndAlignment
, and Layout/BlockAlignment
to manage this behavior, but no option in any of them seems to have any effect.
Any Rubocop experts know how to fix this configuration, or is this a potential bug?
Use case of using begin
without a rescue
is using memoization to set a calculated value
@ivar ||= begin
# Do some stuff
# Do more stuff
# Then return the value
end