Enable Style/NegatedIf Rubocop cop
Favor unless
over if
for negative conditions (or control flow ||).
# bad
do_something if !some_condition
# bad
do_something if not some_condition
# good
do_something unless some_condition
# good
some_condition || do_something
See #17478 (closed)