Skip to content

Commit

Permalink
Update lib/rubocop/cop/lint/assignment_in_condition.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Koichi ITO <koic.ito@gmail.com>
  • Loading branch information
2 people authored and bbatsov committed Nov 30, 2022
1 parent 00ec9cb commit 61db857
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/lint/assignment_in_condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def on_if(node)
add_offense(asgn_node.loc.operator) do |corrector|
next unless safe_assignment_allowed?

corrector.replace(asgn_node, "(#{asgn_node.source})")
corrector.wrap(asgn_node, '(', ')')
end
end
end
Expand Down

0 comments on commit 61db857

Please sign in to comment.