Skip to content

Commit 24a3a4e

Browse files
committed
Cut 1.24.0
1 parent 20c07a2 commit 24a3a4e

File tree

7 files changed

+53
-3
lines changed

7 files changed

+53
-3
lines changed

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.24.0 (2025-02-16)
15+
1416
### New features
1517

1618
* [#490](https://github.com/rubocop/rubocop-performance/pull/490): Pluginfy RuboCop Performance. ([@koic][])

config/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,4 +386,4 @@ Performance/ZipWithoutBlock:
386386
Description: 'Checks for `map { |id| [id] }` and suggests replacing it with `zip`.'
387387
Enabled: pending
388388
Safe: false
389-
VersionAdded: <<next>>
389+
VersionAdded: '1.24'

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.24'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,6 @@ Performance cops optimization analysis for your projects.
6363
* xref:cops_performance.adoc#performancetimesmap[Performance/TimesMap]
6464
* xref:cops_performance.adoc#performanceunfreezestring[Performance/UnfreezeString]
6565
* xref:cops_performance.adoc#performanceuridefaultparser[Performance/UriDefaultParser]
66+
* xref:cops_performance.adoc#performancezipwithoutblock[Performance/ZipWithoutBlock]
6667

6768
// END_COP_LIST

docs/modules/ROOT/pages/cops_performance.adoc

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,3 +2598,38 @@ URI::Parser.new
25982598
# good
25992599
URI::DEFAULT_PARSER
26002600
----
2601+
2602+
[#performancezipwithoutblock]
2603+
== Performance/ZipWithoutBlock
2604+
2605+
|===
2606+
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
2607+
2608+
| Pending
2609+
| No
2610+
| Always (Unsafe)
2611+
| 1.24
2612+
| -
2613+
|===
2614+
2615+
Checks for `map { |id| [id] }` and suggests replacing it with `zip`.
2616+
2617+
[#safety-performancezipwithoutblock]
2618+
=== Safety
2619+
2620+
This cop is unsafe for novel definitions of `map` and `collect`
2621+
on non-Enumerable objects that do not respond to `zip`.
2622+
To make your object enumerable, define an `each` method
2623+
as described in https://ruby-doc.org/core/Enumerable.html
2624+
2625+
[#examples-performancezipwithoutblock]
2626+
=== Examples
2627+
2628+
[source,ruby]
2629+
----
2630+
# bad
2631+
[1, 2, 3].map { |id| [id] }
2632+
2633+
# good
2634+
[1, 2, 3].zip
2635+
----

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.23.1'
7+
STRING = '1.24.0'
88

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

relnotes/v1.24.0.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### New features
2+
3+
* [#490](https://github.com/rubocop/rubocop-performance/pull/490): Pluginfy RuboCop Performance. ([@koic][])
4+
* [#462](https://github.com/rubocop/rubocop-performance/pull/462): Add new `Performance/ZipWithoutBlock` cop that checks patterns like `.map { |id| [id] }` or `.map { [_1] }` and can replace them with `.zip`. ([@corsonknowles][])
5+
6+
### Bug fixes
7+
8+
* [#484](https://github.com/rubocop/rubocop-performance/pull/484): Fix `Performance/CaseWhenSplat` cop error on `when` node without body. ([@viralpraxis][])
9+
10+
[@koic]: https://github.com/koic
11+
[@corsonknowles]: https://github.com/corsonknowles
12+
[@viralpraxis]: https://github.com/viralpraxis

0 commit comments

Comments
 (0)