Usage of do...end block syntax in conditionals
adi-pen opened this issue · 1 comments
adi-pen commented
I encountered a situation where a do...end
block syntax is used as a work-around to avoid line limits.
Example:
# frozen_string_literal: true
if [].any? do |variable|
# do something
end
true
end
Indenting the block by one level helps identify the end of the conditional easily but still does not feel natural at least to me. This results in a Layout/BlockAlignment
offense.
# frozen_string_literal: true
if [].any? do |variable|
# do something
end
true
end
Could we enforce that do..end
blocks are not used in conditionals or have a style-preference if we support it?
pirj commented
Both exampes look extremely awkward.
Would you like to send a pull request?