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
Given the below code, I would expect the Layout/RedundantLineBreak rule to report that the line inside the block should not be wrapped. Note: our line length is set to 84 and InspectBlocks is set to false.
When Layout/RedundantLineBreak inspects a send node, it starts by
expanding the node to inspect. It does this by traversing the AST
upwards as long as the parent is a send node of a block node.
The problem was that if the inspected node is a single node inside
a do..end block, we shouldn't move to the parent block and inspect
it for redundant line breaks. It's only send nodes before the
do..end that we want to expand in order to inspect "the whole
expression". So we should check what kind of block/send
relationship it is before moving upwards in the AST.
Expected behavior
Given the below code, I would expect the
Layout/RedundantLineBreak
rule to report that the line inside the block should not be wrapped. Note: our line length is set to 84 andInspectBlocks
is set tofalse
.The code should be enforced to not wrap:
Actual behavior
Rubocop does not report an error. If I add another line to the block it does report an issue:
RuboCop version
The text was updated successfully, but these errors were encountered: