Skip to content

Commit

Permalink
Remove redundant true/false returns
Browse files Browse the repository at this point in the history
Follow up: #12176 (comment)
  • Loading branch information
ydah committed Oct 10, 2023
1 parent 7b05f2a commit fb34152
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/layout/indentation_width.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def skip_check?(base_loc, body_node)
# Don't check indentation if the line doesn't start with the body.
# For example, lines like "else do_something".
first_char_pos_on_line = body_node.source_range.source_line =~ /\S/
true unless body_node.loc.column == first_char_pos_on_line
body_node.loc.column != first_char_pos_on_line
end

def offending_range(body_node, indentation)
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/layout/space_inside_parens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def can_be_ignored?(token1, token2)
# follows, and that the rules for space inside don't apply.
return true if token2.comment?

true unless same_line?(token1, token2) && !token1.space_after?
!same_line?(token1, token2) || token1.space_after?
end
end
end
Expand Down

0 comments on commit fb34152

Please sign in to comment.