Skip to content

Commit bf5f64f

Browse files
committed
Cut 1.22.0
1 parent d26b441 commit bf5f64f

File tree

6 files changed

+32
-14
lines changed

6 files changed

+32
-14
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.22.0 (2024-09-16)
15+
1416
### Bug fixes
1517

1618
* [#454](https://github.com/rubocop/rubocop-performance/issues/454): Fix false positives for `Performance/BigDecimalWithNumericArgument` when using BigDecimal 3.1+. ([@koic][])

config/default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Performance/BlockGivenWithExplicitBlock:
3636
# https://github.com/rubocop/rubocop-performance/issues/385
3737
Enabled: false
3838
VersionAdded: '1.9'
39-
VersionChanged: <<next>>
39+
VersionChanged: '1.22'
4040

4141
Performance/Caller:
4242
Description: >-

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

docs/modules/ROOT/pages/cops_performance.adoc

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ array.take(3)
8484
8585
== Performance/BigDecimalWithNumericArgument
8686
87+
NOTE: Required Ruby version: 3.1
88+
8789
|===
8890
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
8991
@@ -94,25 +96,25 @@ array.take(3)
9496
| -
9597
|===
9698
97-
Identifies places where numeric argument to BigDecimal should be
98-
converted to string. Initializing from String is faster
99-
than from Numeric for BigDecimal.
99+
Identifies places where string argument to `BigDecimal` should be
100+
converted to numeric. Initializing from Integer is faster
101+
than from String for BigDecimal.
100102
101103
=== Examples
102104
103105
[source,ruby]
104106
----
105107
# bad
106-
BigDecimal(1, 2)
107-
4.to_d(6)
108-
BigDecimal(1.2, 3, exception: true)
109-
4.5.to_d(6, exception: true)
110-
111-
# good
112108
BigDecimal('1', 2)
113109
BigDecimal('4', 6)
114110
BigDecimal('1.2', 3, exception: true)
115111
BigDecimal('4.5', 6, exception: true)
112+
113+
# good
114+
BigDecimal(1, 2)
115+
4.to_d(6)
116+
BigDecimal(1.2, 3, exception: true)
117+
4.5.to_d(6, exception: true)
116118
----
117119
118120
== Performance/BindCall
@@ -154,16 +156,19 @@ umethod.bind_call(obj, foo, bar)
154156
|===
155157
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
156158
157-
| Pending
159+
| Disabled
158160
| Yes
159161
| Always
160162
| 1.9
161-
| -
163+
| 1.22
162164
|===
163165
164166
Identifies unnecessary use of a `block_given?` where explicit check
165167
of block argument would suffice.
166168
169+
NOTE: This cop produces code with significantly worse performance when a
170+
block is being passed to the method and as such should not be enabled.
171+
167172
=== Examples
168173
169174
[source,ruby]

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.21.1'
7+
STRING = '1.22.0'
88

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

relnotes/v1.22.0.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Bug fixes
2+
3+
* [#454](https://github.com/rubocop/rubocop-performance/issues/454): Fix false positives for `Performance/BigDecimalWithNumericArgument` when using BigDecimal 3.1+. ([@koic][])
4+
5+
### Changes
6+
7+
* [#385](https://github.com/rubocop/rubocop-performance/issues/385): Disable `Performance/BlockGivenWithExplicitBlock` by default. ([@earlopain][])
8+
* [#407](https://github.com/rubocop/rubocop-performance/issues/407): Make `Performance/DoubleStartEndWith` aware of safe navigation. ([@earlopain][])
9+
10+
[@koic]: https://github.com/koic
11+
[@earlopain]: https://github.com/earlopain

0 commit comments

Comments
 (0)