Skip to content

Commit

Permalink
Cut 1.16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Feb 6, 2023
1 parent a9bdc29 commit d8712aa
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,8 @@

## master (unreleased)

## 1.16.0 (2023-02-06)

### Changes

* [#332](https://github.com/rubocop/rubocop-performance/pull/332): Register offenses for variables against regexes in `Performance/StringInclude`. ([@fatkodima][])
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
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.16'
nav:
- modules/ROOT/nav.adoc
25 changes: 14 additions & 11 deletions docs/modules/ROOT/pages/cops_performance.adoc
Expand Up @@ -754,9 +754,12 @@ chained to `select`, `find_all` or `filter` and change them to use

=== Safety

This cop is unsafe because is has known compatibility issues with `ActiveRecord` and other
frameworks. `ActiveRecord` does not implement a `detect` method and `find` has its own
meaning. Correcting `ActiveRecord` methods with this cop should be considered unsafe.
This cop is unsafe because is assumes the class implements the
`Enumerable` interface, but can't reliably detect this. This creates
known compatibility issues with `Hash`, `ActiveRecord` and other
frameworks. `Hash` and `ActiveRecord` do not implement a `detect`
method and `find` has its own meaning. Correcting `Hash` and
`ActiveRecord` methods with this cop should be considered unsafe.

=== Examples

Expand Down Expand Up @@ -2001,22 +2004,22 @@ Identifies unnecessary use of a regex where `String#include?` would suffice.

=== Safety

This cop's offenses are not safe to autocorrect if a receiver is nil.
This cop's offenses are not safe to autocorrect if a receiver is nil or a Symbol.

=== Examples

[source,ruby]
----
# bad
'abc'.match?(/ab/)
/ab/.match?('abc')
'abc' =~ /ab/
/ab/ =~ 'abc'
'abc'.match(/ab/)
/ab/.match('abc')
str.match?(/ab/)
/ab/.match?(str)
str =~ /ab/
/ab/ =~ str
str.match(/ab/)
/ab/.match(str)
# good
'abc'.include?('ab')
str.include?('ab')
----

== Performance/StringReplacement
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/performance/version.rb
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Performance
# This module holds the RuboCop Performance version information.
module Version
STRING = '1.15.2'
STRING = '1.16.0'

def self.document_version
STRING.match('\d+\.\d+').to_s
Expand Down
5 changes: 5 additions & 0 deletions relnotes/v1.16.0.md
@@ -0,0 +1,5 @@
### Changes

* [#332](https://github.com/rubocop/rubocop-performance/pull/332): Register offenses for variables against regexes in `Performance/StringInclude`. ([@fatkodima][])

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

0 comments on commit d8712aa

Please sign in to comment.