From cd674c4b7bbe80039d728b9a625f95cde0483ad5 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Sat, 17 Sep 2022 15:51:29 +0900 Subject: [PATCH] Cut 2.16.1 --- CHANGELOG.md | 2 ++ docs/antora.yml | 2 +- docs/modules/ROOT/pages/cops_rails.adoc | 15 +++++++++++++++ lib/rubocop/rails/version.rb | 2 +- relnotes/v2.16.1.md | 9 +++++++++ 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 relnotes/v2.16.1.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ffae486d1..cbc4a471a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## master (unreleased) +## 2.16.1 (2022-09-17) + ### Bug fixes * [#769](https://github.com/rubocop/rubocop-rails/issues/769): Fix a false positive for `Rails/FreezeTime` when using `travel_to` with an argument of `DateTime.new` with arguments. ([@koic][]) diff --git a/docs/antora.yml b/docs/antora.yml index 9e0ff48acb..05a04b34c1 100644 --- a/docs/antora.yml +++ b/docs/antora.yml @@ -2,6 +2,6 @@ name: rubocop-rails title: RuboCop Rails # We always provide version without patch here (e.g. 1.1), # as patch versions should not appear in the docs. -version: ~ +version: '2.16' nav: - modules/ROOT/nav.adoc diff --git a/docs/modules/ROOT/pages/cops_rails.adoc b/docs/modules/ROOT/pages/cops_rails.adoc index 4ca63d79b8..d7d0dd60c0 100644 --- a/docs/modules/ROOT/pages/cops_rails.adoc +++ b/docs/modules/ROOT/pages/cops_rails.adoc @@ -4940,6 +4940,11 @@ so we can apply many IO methods directly. This cop works best when used together with `Style/FileRead`, `Style/FileWrite` and `Rails/RootJoinChain`. +=== Safety + +This cop is unsafe for autocorrection because `Dir`'s `children`, `each_child`, `entries`, and `glob` +methods return string element, but these methods of `Pathname` return `Pathname` element. + === Examples [source,ruby] @@ -4961,6 +4966,16 @@ Rails.root.join('db', 'schema.rb').write(content) Rails.root.join('db', 'schema.rb').binwrite(content) ---- +=== Configurable attributes + +|=== +| Name | Default value | Configurable values + +| SafeAutocorrect +| `false` +| Boolean +|=== + == Rails/RootPublicPath |=== diff --git a/lib/rubocop/rails/version.rb b/lib/rubocop/rails/version.rb index 829beda4f4..910c915687 100644 --- a/lib/rubocop/rails/version.rb +++ b/lib/rubocop/rails/version.rb @@ -4,7 +4,7 @@ module RuboCop module Rails # This module holds the RuboCop Rails version information. module Version - STRING = '2.16.0' + STRING = '2.16.1' def self.document_version STRING.match('\d+\.\d+').to_s diff --git a/relnotes/v2.16.1.md b/relnotes/v2.16.1.md new file mode 100644 index 0000000000..54be48c576 --- /dev/null +++ b/relnotes/v2.16.1.md @@ -0,0 +1,9 @@ +### Bug fixes + +* [#769](https://github.com/rubocop/rubocop-rails/issues/769): Fix a false positive for `Rails/FreezeTime` when using `travel_to` with an argument of `DateTime.new` with arguments. ([@koic][]) +* [#772](https://github.com/rubocop/rubocop-rails/pull/772): Fix a false positive for `Rails/TopLevelHashWithIndifferentAccess` when using `HashWithIndifferentAccess` under namespace module. ([@koic][]) +* [#762](https://github.com/rubocop/rubocop-rails/issues/762): Fix an error for `Rails/FreezeTime` when using `travel_to` with an argument of `current` method without receiver. ([@koic][]) +* [#764](https://github.com/rubocop/rubocop-rails/issues/764): Fix an incorrect autocorrect for `Rails/FreezeTime` when using `travel_to` with an argument of the current time and proc argument. ([@koic][]) +* [#763](https://github.com/rubocop/rubocop-rails/issues/763): Mark `Rails/RootPathnameMethods` as unsafe and fix an incorrect autocorrect when using `Dir.glob`. ([@koic][]) + +[@koic]: https://github.com/koic