Skip to content

Commit

Permalink
Cut 1.22.1
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Sep 17, 2024
1 parent 3188974 commit 69c5abc
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

## master (unreleased)

## 1.22.1 (2024-09-17)

### Bug fixes

* [#468](https://github.com/rubocop/rubocop-performance/issues/468): Fix false positives for `Performance/BigDecimalWithNumericArgument` when using float argument for `BigDecimal`. ([@koic][])
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: rubocop-performance
title: RuboCop Performance
# We always provide version without patch here (e.g. 1.1),
# as patch versions should not appear in the docs.
version: ~
version: '1.22'
nav:
- modules/ROOT/nav.adoc
20 changes: 13 additions & 7 deletions docs/modules/ROOT/pages/cops_performance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,31 @@ NOTE: Required Ruby version: 3.1
| -
|===
Identifies places where string argument to `BigDecimal` should be
converted to numeric. Initializing from Integer is faster
than from String for BigDecimal.
Identifies places where a float argument to BigDecimal should be converted to a string.
Initializing from String is faster than from Float for BigDecimal.
Also identifies places where an integer string argument to BigDecimal should be converted to
an integer. Initializing from Integer is faster than from String for BigDecimal.
=== Examples
[source,ruby]
----
# bad
BigDecimal('1', 2)
BigDecimal('4', 6)
BigDecimal(1.2, 3, exception: true)
4.5.to_d(6, exception: true)
# good
BigDecimal('1.2', 3, exception: true)
BigDecimal('4.5', 6, exception: true)
# bad
BigDecimal('1', 2)
BigDecimal('4', 6)
# good
BigDecimal(1, 2)
4.to_d(6)
BigDecimal(1.2, 3, exception: true)
4.5.to_d(6, exception: true)
----
== Performance/BindCall
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/performance/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Performance
# This module holds the RuboCop Performance version information.
module Version
STRING = '1.22.0'
STRING = '1.22.1'

def self.document_version
STRING.match('\d+\.\d+').to_s
Expand Down
5 changes: 5 additions & 0 deletions relnotes/v1.22.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Bug fixes

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

[@koic]: https://github.com/koic

0 comments on commit 69c5abc

Please sign in to comment.