From ad65d4e77975ed6d55dbeb62118c9b0c79bdbad7 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Mon, 8 Jan 2024 15:36:55 +0900 Subject: [PATCH] Cut 1.20.2 --- CHANGELOG.md | 2 ++ docs/antora.yml | 2 +- docs/modules/ROOT/pages/cops_performance.adoc | 9 +++++++-- lib/rubocop/performance/version.rb | 2 +- relnotes/v1.20.2.md | 5 +++++ 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 relnotes/v1.20.2.md diff --git a/CHANGELOG.md b/CHANGELOG.md index d173c261b3..9cc3761b93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ ## master (unreleased) +## 1.20.2 (2024-01-08) + ### Bug fixes * [#425](https://github.com/rubocop/rubocop-performance/issues/425): Fix a false positive for `Performance/StringIdentifierArgument` when using string interpolation with methods that don't support symbols with `::` inside them. ([@earlopain][]) diff --git a/docs/antora.yml b/docs/antora.yml index 21b1815a34..186bc944d1 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -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.20' nav: - modules/ROOT/nav.adoc diff --git a/docs/modules/ROOT/pages/cops_performance.adoc b/docs/modules/ROOT/pages/cops_performance.adoc index 08be172b31..ee84d096e3 100644 --- a/docs/modules/ROOT/pages/cops_performance.adoc +++ b/docs/modules/ROOT/pages/cops_performance.adoc @@ -2080,13 +2080,18 @@ and the following examples are parts of it. send('do_something') attr_accessor 'do_something' instance_variable_get('@ivar') -const_get("string_#{interpolation}") +respond_to?("string_#{interpolation}") # good send(:do_something) attr_accessor :do_something instance_variable_get(:@ivar) -const_get(:"string_#{interpolation}") +respond_to?(:"string_#{interpolation}") + +# good - these methods don't support namespaced symbols +const_get("#{module_path}::Base") +const_source_location("#{module_path}::Base") +const_defined?("#{module_path}::Base") ---- == Performance/StringInclude diff --git a/lib/rubocop/performance/version.rb b/lib/rubocop/performance/version.rb index 12755a5119..fe1ebd482e 100644 --- a/lib/rubocop/performance/version.rb +++ b/lib/rubocop/performance/version.rb @@ -4,7 +4,7 @@ module RuboCop module Performance # This module holds the RuboCop Performance version information. module Version - STRING = '1.20.1' + STRING = '1.20.2' def self.document_version STRING.match('\d+\.\d+').to_s diff --git a/relnotes/v1.20.2.md b/relnotes/v1.20.2.md new file mode 100644 index 0000000000..33058bcd5f --- /dev/null +++ b/relnotes/v1.20.2.md @@ -0,0 +1,5 @@ +### Bug fixes + +* [#425](https://github.com/rubocop/rubocop-performance/issues/425): Fix a false positive for `Performance/StringIdentifierArgument` when using string interpolation with methods that don't support symbols with `::` inside them. ([@earlopain][]) + +[@earlopain]: https://github.com/earlopain