From 82c068fc1580304aa53a4c81aa83ddc5245b27f3 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Tue, 12 Oct 2021 09:44:35 +0900 Subject: [PATCH] Mark `Rails/TimeZone` as unsafe auto-correction from unsafe Follow up to https://github.com/rubocop/rubocop-rails/pull/575#discussion_r726487516 This PR marks `Rails/TimeZone` as unsafe auto-correction from unsafe. --- .../change_mark_rails_time_zone_as_unsafe_auto_correction.md | 1 + config/default.yml | 4 ++-- docs/modules/ROOT/pages/cops_rails.adoc | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog/change_mark_rails_time_zone_as_unsafe_auto_correction.md diff --git a/changelog/change_mark_rails_time_zone_as_unsafe_auto_correction.md b/changelog/change_mark_rails_time_zone_as_unsafe_auto_correction.md new file mode 100644 index 0000000000..9bbd913000 --- /dev/null +++ b/changelog/change_mark_rails_time_zone_as_unsafe_auto_correction.md @@ -0,0 +1 @@ +* [#576](https://github.com/rubocop/rubocop-rails/pull/576): Mark `Rails/TimeZone` as unsafe auto-correction from unsafe. ([@koic][]) diff --git a/config/default.yml b/config/default.yml index b20840459e..5c595e905b 100644 --- a/config/default.yml +++ b/config/default.yml @@ -789,9 +789,9 @@ Rails/TimeZone: StyleGuide: 'https://rails.rubystyle.guide#time' Reference: 'http://danilenko.org/2012/7/6/rails_timezones' Enabled: true - Safe: false + SafeAutoCorrect: false VersionAdded: '0.30' - VersionChanged: '2.10' + VersionChanged: '2.13' # The value `strict` means that `Time` should be used with `zone`. # The value `flexible` allows usage of `in_time_zone` instead of `zone`. EnforcedStyle: flexible diff --git a/docs/modules/ROOT/pages/cops_rails.adoc b/docs/modules/ROOT/pages/cops_rails.adoc index 26b0448e0a..5169aa4da6 100644 --- a/docs/modules/ROOT/pages/cops_rails.adoc +++ b/docs/modules/ROOT/pages/cops_rails.adoc @@ -4600,10 +4600,10 @@ SQL | Enabled by default | Safe | Supports autocorrection | Version Added | Version Changed | Enabled -| No +| Yes | Yes (Unsafe) | 0.30 -| 2.10 +| 2.13 |=== This cop checks for the use of Time methods without zone.