Skip to content

Commit

Permalink
Add InvertibleUnlessCondition implicit receiver example
Browse files Browse the repository at this point in the history
This change was meant to be in #12711.
  • Loading branch information
sambostock authored and bbatsov committed Feb 29, 2024
1 parent 8acce28 commit f151524
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rubocop/cop/style/invertible_unless_condition.rb
Expand Up @@ -32,12 +32,14 @@ module Style
# foo unless x != y
# foo unless x >= 10
# foo unless x.even?
# foo unless odd?
#
# # good
# foo if bar
# foo if x == y
# foo if x < 10
# foo if x.odd?
# foo if even?
#
# # bad (complex condition)
# foo unless x != y || x.even?
Expand Down

0 comments on commit f151524

Please sign in to comment.