Skip to content

Commit 4498b1d

Browse files
committed
Cut 1.18.0
1 parent 4a41d26 commit 4498b1d

5 files changed

Lines changed: 26 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
## master (unreleased)
1313

14+
## 1.18.0 (2023-05-21)
15+
1416
### Bug fixes
1517

1618
* [#359](https://github.com/rubocop/rubocop-performance/issues/359): Fix a false positive for `Performance/RedundantEqualityComparisonBlock` when the block variable is used on both sides of `==`. ([@koic][])

docs/antora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ name: rubocop-performance
22
title: RuboCop Performance
33
# We always provide version without patch here (e.g. 1.1),
44
# as patch versions should not appear in the docs.
5-
version: ~
5+
version: '1.18'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops_performance.adoc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,26 +423,30 @@ end
423423

424424
Identifies places where `sort { |a, b| a.foo <=> b.foo }`
425425
can be replaced by `sort_by(&:foo)`.
426-
This cop also checks `max` and `min` methods.
426+
This cop also checks `sort!`, `min`, `max` and `minmax` methods.
427427

428428
=== Examples
429429

430430
[source,ruby]
431431
----
432432
# bad
433-
array.sort { |a, b| a.foo <=> b.foo }
434-
array.max { |a, b| a.foo <=> b.foo }
435-
array.min { |a, b| a.foo <=> b.foo }
436-
array.sort { |a, b| a[:foo] <=> b[:foo] }
433+
array.sort { |a, b| a.foo <=> b.foo }
434+
array.sort! { |a, b| a.foo <=> b.foo }
435+
array.max { |a, b| a.foo <=> b.foo }
436+
array.min { |a, b| a.foo <=> b.foo }
437+
array.minmax { |a, b| a.foo <=> b.foo }
438+
array.sort { |a, b| a[:foo] <=> b[:foo] }
437439
438440
# good
439441
array.sort_by(&:foo)
442+
array.sort_by!(&:foo)
440443
array.sort_by { |v| v.foo }
441444
array.sort_by do |var|
442445
var.foo
443446
end
444447
array.max_by(&:foo)
445448
array.min_by(&:foo)
449+
array.minmax_by(&:foo)
446450
array.sort_by { |a| a[:foo] }
447451
----
448452

lib/rubocop/performance/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module RuboCop
44
module Performance
55
# This module holds the RuboCop Performance version information.
66
module Version
7-
STRING = '1.17.1'
7+
STRING = '1.18.0'
88

99
def self.document_version
1010
STRING.match('\d+\.\d+').to_s

relnotes/v1.18.0.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Bug fixes
2+
3+
* [#359](https://github.com/rubocop/rubocop-performance/issues/359): Fix a false positive for `Performance/RedundantEqualityComparisonBlock` when the block variable is used on both sides of `==`. ([@koic][])
4+
* [#351](https://github.com/rubocop/rubocop-performance/issues/351): Fix an incorrect autocorrect for `Performance/ConstantRegexp` and `Performance/RegexpMatch` when autocorrecting both at the same time. ([@fatkodima][])
5+
6+
### Changes
7+
8+
* [#357](https://github.com/rubocop/rubocop-performance/pull/357): Add `sort!` and `minmax` to `Performance/CompareWithBlock`. ([@vlad-pisanov][])
9+
* [#353](https://github.com/rubocop/rubocop-performance/pull/353): **(Breaking)** Drop Ruby 2.6 support. ([@koic][])
10+
11+
[@koic]: https://github.com/koic
12+
[@fatkodima]: https://github.com/fatkodima
13+
[@vlad-pisanov]: https://github.com/vlad-pisanov

0 commit comments

Comments
 (0)