From abe22dedf70af4c4d007856e236a10f10919b987 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sat, 5 Mar 2022 18:55:59 +0900 Subject: [PATCH] Cut 1.13.3 --- CHANGELOG.md | 2 ++ docs/antora.yml | 2 +- docs/modules/ROOT/pages/cops_performance.adoc | 12 ++++-------- lib/rubocop/performance/version.rb | 2 +- relnotes/v1.13.3.md | 5 +++++ 5 files changed, 13 insertions(+), 10 deletions(-) create mode 100644 relnotes/v1.13.3.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 81f1af7a46..85d9c19922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master (unreleased) +## 1.13.3 (2022-03-05) + ### Bug fixes * [#285](https://github.com/rubocop/rubocop-performance/pull/285): Fix an error for `Performance/MapCompact` when using `map(&:do_something).compact.first` and there is a line break after `map.compact` and receiver. ([@ydah][]) diff --git a/docs/antora.yml b/docs/antora.yml index b844f36b65..1e87a654fa 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: 'master' +version: '1.13' nav: - modules/ROOT/nav.adoc diff --git a/docs/modules/ROOT/pages/cops_performance.adoc b/docs/modules/ROOT/pages/cops_performance.adoc index f6f50c77ba..5cb55b82a1 100644 --- a/docs/modules/ROOT/pages/cops_performance.adoc +++ b/docs/modules/ROOT/pages/cops_performance.adoc @@ -335,10 +335,9 @@ str.casecmp('ABC').zero? | - |=== -This cop is used to identify usages of -Each of these methods (`compact`, `flatten`, `map`) will generate a -new intermediate array that is promptly thrown away. Instead it is -faster to mutate when we know it's safe. +This cop is used to identify usages of `array.compact.flatten.map { |x| x.downcase }`. +Each of these methods (`compact`, `flatten`, `map`) will generate a new intermediate array +that is promptly thrown away. Instead it is faster to mutate when we know it's safe. === Examples @@ -347,11 +346,8 @@ faster to mutate when we know it's safe. # bad array = ["a", "b", "c"] array.compact.flatten.map { |x| x.downcase } ----- -[source,ruby] ----- -# good. +# good array = ["a", "b", "c"] array.compact! array.flatten! diff --git a/lib/rubocop/performance/version.rb b/lib/rubocop/performance/version.rb index 2fcc165363..cd1b0f7f64 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.13.2' + STRING = '1.13.3' def self.document_version STRING.match('\d+\.\d+').to_s diff --git a/relnotes/v1.13.3.md b/relnotes/v1.13.3.md new file mode 100644 index 0000000000..27e53dc6f2 --- /dev/null +++ b/relnotes/v1.13.3.md @@ -0,0 +1,5 @@ +### Bug fixes + +* [#285](https://github.com/rubocop/rubocop-performance/pull/285): Fix an error for `Performance/MapCompact` when using `map(&:do_something).compact.first` and there is a line break after `map.compact` and receiver. ([@ydah][]) + +[@ydah]: https://github.com/ydah