diff --git a/CHANGELOG.md b/CHANGELOG.md index d173c261b..9cc3761b9 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 21b1815a3..186bc944d 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 08be172b3..ee84d096e 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 12755a511..fe1ebd482 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 000000000..33058bcd5 --- /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