Pattern: Literal assignment in condition
Issue: -
Checks for literal assignments in the conditions of if
, while
, and until
.
# bad
if x = 42
do_something
end
# good
if x == 42
do_something
end
# good
if x = y
do_something
end
Pattern: Literal assignment in condition
Issue: -
Checks for literal assignments in the conditions of if
, while
, and until
.
# bad
if x = 42
do_something
end
# good
if x == 42
do_something
end
# good
if x = y
do_something
end