Skip to content

Commit 69c5abc

Browse files
committed
Cut 1.22.1
1 parent 3188974 commit 69c5abc

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
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.1 (2024-09-17)
15+
1416
### Bug fixes
1517

1618
* [#468](https://github.com/rubocop/rubocop-performance/issues/468): Fix false positives for `Performance/BigDecimalWithNumericArgument` when using float argument for `BigDecimal`. ([@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.22'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops_performance.adoc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,25 +96,31 @@ NOTE: Required Ruby version: 3.1
9696
| -
9797
|===
9898
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.
99+
Identifies places where a float argument to BigDecimal should be converted to a string.
100+
Initializing from String is faster than from Float for BigDecimal.
101+
102+
Also identifies places where an integer string argument to BigDecimal should be converted to
103+
an integer. Initializing from Integer is faster than from String for BigDecimal.
102104
103105
=== Examples
104106
105107
[source,ruby]
106108
----
107109
# bad
108-
BigDecimal('1', 2)
109-
BigDecimal('4', 6)
110+
BigDecimal(1.2, 3, exception: true)
111+
4.5.to_d(6, exception: true)
112+
113+
# good
110114
BigDecimal('1.2', 3, exception: true)
111115
BigDecimal('4.5', 6, exception: true)
112116
117+
# bad
118+
BigDecimal('1', 2)
119+
BigDecimal('4', 6)
120+
113121
# good
114122
BigDecimal(1, 2)
115123
4.to_d(6)
116-
BigDecimal(1.2, 3, exception: true)
117-
4.5.to_d(6, exception: true)
118124
----
119125
120126
== Performance/BindCall

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.22.0'
7+
STRING = '1.22.1'
88

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

relnotes/v1.22.1.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Bug fixes
2+
3+
* [#468](https://github.com/rubocop/rubocop-performance/issues/468): Fix false positives for `Performance/BigDecimalWithNumericArgument` when using float argument for `BigDecimal`. ([@koic][])
4+
5+
[@koic]: https://github.com/koic

0 commit comments

Comments
 (0)