diff --git a/CHANGELOG.md b/CHANGELOG.md index e1467f04037..e4a2f00ca24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ * [#7509](https://github.com/rubocop-hq/rubocop/issues/7509): Fix `Layout/SpaceInsideArrayLiteralBrackets` to correct empty lines. ([@ayacai115][]) * [#7517](https://github.com/rubocop-hq/rubocop/issues/7517): `Style/SpaceAroundKeyword` allows `::` after `super`. ([@ozydingo][]) * [#7515](https://github.com/rubocop-hq/rubocop/issues/7515): Fix a false negative for `Style/RedundantParentheses` when calling a method with safe navigation operator. ([@koic][]) +* [#7477](https://github.com/rubocop-hq/rubocop/issues/7477): Fix line length autocorrect for semicolons in string literals. ([@maxh][]) +* [#7522](https://github.com/rubocop-hq/rubocop/pull/7522): Fix a false-positive edge case (`n % 2 == 2`) for `Style/EvenOdd`. ([@buehmann][]) ### Changes @@ -15,10 +17,6 @@ * [#7469](https://github.com/rubocop-hq/rubocop/pull/7469): **(Breaking)** Replace usages of the terms `Whitelist` and `Blacklist` with better alternatives. ([@koic][]) * [#7502](https://github.com/rubocop-hq/rubocop/pull/7502): Remove `SafeMode` module. ([@koic][]) -### Bug fixes - -* [#7477](https://github.com/rubocop-hq/rubocop/issues/7477): Fix line length autocorrect for semicolons in string literals. ([@maxh][]) - ## 0.76.0 (2019-10-28) ### Bug fixes diff --git a/lib/rubocop/cop/style/even_odd.rb b/lib/rubocop/cop/style/even_odd.rb index 5d039d5fb91..92c8b49b220 100644 --- a/lib/rubocop/cop/style/even_odd.rb +++ b/lib/rubocop/cop/style/even_odd.rb @@ -23,7 +23,7 @@ class EvenOdd < Cop {(send $_ :% (int 2)) (begin (send $_ :% (int 2)))} ${:== :!=} - (int ${0 1 2})) + (int ${0 1})) PATTERN def on_send(node) diff --git a/spec/rubocop/cop/style/even_odd_spec.rb b/spec/rubocop/cop/style/even_odd_spec.rb index d1d056d6807..8ef06038720 100644 --- a/spec/rubocop/cop/style/even_odd_spec.rb +++ b/spec/rubocop/cop/style/even_odd_spec.rb @@ -73,6 +73,10 @@ RUBY end + it 'accepts x % 2 == 2' do + expect_no_offenses('x % 2 == 2') + end + it 'accepts x % 3 == 0' do expect_no_offenses('x % 3 == 0') end