Skip to content

Commit f79ecaa

Browse files
committed
Cut 1.20.0
1 parent 5ec8988 commit f79ecaa

File tree

5 files changed

+32
-6
lines changed

5 files changed

+32
-6
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.20.0 (2023-12-16)
15+
1416
### New features
1517

1618
* [#384](https://github.com/rubocop/rubocop-performance/issues/384): Support optimized `String#dup` for `Performance/UnfreezeString` when Ruby 3.3+. ([@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.20'
66
nav:
77
- modules/ROOT/nav.adoc

docs/modules/ROOT/pages/cops_performance.adoc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,8 +544,7 @@ passed to the `count` call.
544544
=== Safety
545545

546546
This cop is unsafe because it has known compatibility issues with `ActiveRecord` and other
547-
frameworks. ActiveRecord's `count` ignores the block that is passed to it.
548-
`ActiveRecord` will ignore the block that is passed to `count`.
547+
frameworks. Before Rails 5.1, `ActiveRecord` will ignore the block that is passed to `count`.
549548
Other methods, such as `select`, will convert the association to an
550549
array and then run the block on the array. A simple work around to
551550
make `count` work with a block is to call `to_a.count {...}`.
@@ -2075,11 +2074,13 @@ and the following examples are parts of it.
20752074
send('do_something')
20762075
attr_accessor 'do_something'
20772076
instance_variable_get('@ivar')
2077+
const_get("string_#{interpolation}")
20782078
20792079
# good
20802080
send(:do_something)
20812081
attr_accessor :do_something
20822082
instance_variable_get(:@ivar)
2083+
const_get(:"string_#{interpolation}")
20832084
----
20842085

20852086
== Performance/StringInclude
@@ -2111,6 +2112,7 @@ str =~ /ab/
21112112
/ab/ =~ str
21122113
str.match(/ab/)
21132114
/ab/.match(str)
2115+
/ab/ === str
21142116
21152117
# good
21162118
str.include?('ab')
@@ -2328,8 +2330,8 @@ if you expect `ASCII-8BIT` encoding, disable this cop.
23282330
[source,ruby]
23292331
----
23302332
# bad
2331-
''.dup
2332-
"something".dup
2333+
''.dup # when Ruby 3.2 or lower
2334+
"something".dup # when Ruby 3.2 or lower
23332335
String.new
23342336
String.new('')
23352337
String.new('something')

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.19.1'
7+
STRING = '1.20.0'
88

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

relnotes/v1.20.0.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
### New features
2+
3+
* [#384](https://github.com/rubocop/rubocop-performance/issues/384): Support optimized `String#dup` for `Performance/UnfreezeString` when Ruby 3.3+. ([@koic][])
4+
5+
### Bug fixes
6+
7+
* [#374](https://github.com/rubocop/rubocop-performance/issues/374): Fix an error for `Performance/MapMethodChain` when using `map` method chain without receiver. ([@koic][])
8+
* [#386](https://github.com/rubocop/rubocop-performance/issues/386): Fix a false negative for `Performance/StringIdentifierArgument` when using string interpolation. ([@earlopain][])
9+
* [#419](https://github.com/rubocop/rubocop-performance/pull/419): Make `Performance/Count`, `Performance/FixedSize`, `Performance/FlatMap`, `Performance/InefficientHashSearch`, `Performance/RangeInclude`, `Performance/RedundantSortBlock`, `Performance/ReverseFirst`, `Performance/SelectMap`, `Performance/Size`, `Performance/SortReverse`, and `Performance/TimesMap` cops aware of safe navigation operator. ([@koic][])
10+
* [#390](https://github.com/rubocop/rubocop-performance/issues/390): Fix a false negative for `Performance/ReverseEach` when safe navigation is between `reverse` and `each`. ([@fatkodima][])
11+
* [#401](https://github.com/rubocop/rubocop-performance/issues/401): Make `Performance/Sum` aware of safe navigation operator. ([@koic][])
12+
13+
### Changes
14+
15+
* [#389](https://github.com/rubocop/rubocop-performance/issues/389): Improve `Performance/MapCompact` to handle more safe navigation calls. ([@fatkodima][])
16+
* [#395](https://github.com/rubocop/rubocop-performance/issues/395): Enhance `Performance/StringInclude` to handle `===` method. ([@fatkodima][])
17+
* [#388](https://github.com/rubocop/rubocop-performance/pull/388): Require RuboCop 1.30+ as runtime dependency. ([@koic][])
18+
* [#380](https://github.com/rubocop/rubocop-performance/pull/380): Require RuboCop AST 1.30.0+. ([@koic][])
19+
20+
[@koic]: https://github.com/koic
21+
[@earlopain]: https://github.com/earlopain
22+
[@fatkodima]: https://github.com/fatkodima

0 commit comments

Comments
 (0)