Skip to content

Commit

Permalink
Cut 1.15.2
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Dec 25, 2022
1 parent 2e411c9 commit d48e8a5
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master (unreleased)

## 1.15.2 (2022-12-25)

### Bug fixes

* [#313](https://github.com/rubocop/rubocop-performance/issues/313): Fix a false negative for `Performance/RedundantStringChars` when using `str.chars.last` without argument. ([@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.15'
nav:
- modules/ROOT/nav.adoc
7 changes: 5 additions & 2 deletions docs/modules/ROOT/pages/cops_performance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,7 @@ Checks for redundant `String#chars`.
# bad
str.chars[0..2]
str.chars.slice(0..2)
str.chars.last
# good
str[0..2].chars
Expand All @@ -1550,6 +1551,7 @@ str.chars.first(2)
# good
str[0]
str[0...2].chars
str[-1]
# bad
str.chars.take(2)
Expand All @@ -1563,9 +1565,8 @@ str.length
str.size
str.empty?
# For example, if the receiver is a blank string, it will be incompatible.
# For example, if the receiver is an empty string, it will be incompatible.
# If a negative value is specified for the receiver, `nil` is returned.
str.chars.last # Incompatible with `str[-1]`.
str.chars.last(2) # Incompatible with `str[-2..-1].chars`.
str.chars.drop(2) # Incompatible with `str[2..-1].chars`.
----
Expand Down Expand Up @@ -2055,6 +2056,8 @@ Identifies places where `gsub` can be replaced by `tr` or `delete`.

== Performance/Sum

NOTE: Required Ruby version: 2.4

|===
| Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed

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.15.1'
STRING = '1.15.2'

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

* [#313](https://github.com/rubocop/rubocop-performance/issues/313): Fix a false negative for `Performance/RedundantStringChars` when using `str.chars.last` without argument. ([@koic][])
* [#321](https://github.com/rubocop/rubocop-performance/pull/321): Fix a false positive for `Performance/Sum` when using `TargetRubyVersion` is 2.3 or lower. ([@koic][])
* [#314](https://github.com/rubocop/rubocop-performance/issues/314): Fix `Performance/RegexpMatch` to handle `::Regexp`. ([@fatkodima][])

### Changes

* [#318](https://github.com/rubocop/rubocop-performance/issues/318): Extend `Performance/StringInclude` to handle `!~`. ([@fatkodima][])

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

0 comments on commit d48e8a5

Please sign in to comment.