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
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?
The text was updated successfully, but these errors were encountered:
I encountered a situation where a
do...end
block syntax is used as a work-around to avoid line limits.Example:
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.Could we enforce that
do..end
blocks are not used in conditionals or have a style-preference if we support it?The text was updated successfully, but these errors were encountered: