Skip to content

Commit

Permalink
Cut 1.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Sep 16, 2024
1 parent d26b441 commit bf5f64f
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 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.0 (2024-09-16)

### Bug fixes

* [#454](https://github.com/rubocop/rubocop-performance/issues/454): Fix false positives for `Performance/BigDecimalWithNumericArgument` when using BigDecimal 3.1+. ([@koic][])
Expand Down
2 changes: 1 addition & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Performance/BlockGivenWithExplicitBlock:
# https://github.com/rubocop/rubocop-performance/issues/385
Enabled: false
VersionAdded: '1.9'
VersionChanged: <<next>>
VersionChanged: '1.22'

Performance/Caller:
Description: >-
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
27 changes: 16 additions & 11 deletions docs/modules/ROOT/pages/cops_performance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ array.take(3)
== Performance/BigDecimalWithNumericArgument
NOTE: Required Ruby version: 3.1
|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
Expand All @@ -94,25 +96,25 @@ array.take(3)
| -
|===
Identifies places where numeric argument to BigDecimal should be
converted to string. Initializing from String is faster
than from Numeric for BigDecimal.
Identifies places where string argument to `BigDecimal` should be
converted to numeric. Initializing from Integer is faster
than from String for BigDecimal.
=== Examples
[source,ruby]
----
# bad
BigDecimal(1, 2)
4.to_d(6)
BigDecimal(1.2, 3, exception: true)
4.5.to_d(6, exception: true)
# good
BigDecimal('1', 2)
BigDecimal('4', 6)
BigDecimal('1.2', 3, exception: true)
BigDecimal('4.5', 6, exception: true)
# 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 Expand Up @@ -154,16 +156,19 @@ umethod.bind_call(obj, foo, bar)
|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed
| Pending
| Disabled
| Yes
| Always
| 1.9
| -
| 1.22
|===
Identifies unnecessary use of a `block_given?` where explicit check
of block argument would suffice.
NOTE: This cop produces code with significantly worse performance when a
block is being passed to the method and as such should not be enabled.
=== Examples
[source,ruby]
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.21.1'
STRING = '1.22.0'

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

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

### Changes

* [#385](https://github.com/rubocop/rubocop-performance/issues/385): Disable `Performance/BlockGivenWithExplicitBlock` by default. ([@earlopain][])
* [#407](https://github.com/rubocop/rubocop-performance/issues/407): Make `Performance/DoubleStartEndWith` aware of safe navigation. ([@earlopain][])

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

0 comments on commit bf5f64f

Please sign in to comment.