From b58cdad4dd10a315a626c3c1a7b7aaf6138f7202 Mon Sep 17 00:00:00 2001 From: Viktor Fonic Date: Thu, 25 Apr 2019 13:07:19 +0700 Subject: [PATCH] [Fix #6950] Mark Rails/TimeZone as unsafe --- CHANGELOG.md | 2 ++ config/default.yml | 3 ++- manual/cops_rails.md | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c2f986b6c9..743a47babfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ ### Changes +* [#6966](https://github.com/rubocop-hq/rubocop/pull/6966): Mark Rails/TimeZone as unsafe. ([@vfonic][]) * [#5977](https://github.com/rubocop-hq/rubocop/issues/5977): Remove Performance cops. ([@koic][]) * Add auto-correction to `Naming/RescuedExceptionsVariableName`. ([@anthony-robin][]) * [#6903](https://github.com/rubocop-hq/rubocop/issues/6903): Handle variables prefixed with `_` in `Naming/RescuedExceptionsVariableName` cop. ([@anthony-robin][]) @@ -3960,3 +3961,4 @@ [@diachini]: https://github.com/diachini [@Mange]: https://github.com/Mange [@jmanian]: https://github.com/jmanian +[@vfonic]: https://github.com/vfonic diff --git a/config/default.yml b/config/default.yml index 1dd9c7cd9a1..4ec33c2393f 100644 --- a/config/default.yml +++ b/config/default.yml @@ -2424,8 +2424,9 @@ Rails/TimeZone: StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#time' Reference: 'http://danilenko.org/2012/7/6/rails_timezones' Enabled: true + Safe: false VersionAdded: '0.30' - VersionChanged: '0.33' + VersionChanged: '0.68' # 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/manual/cops_rails.md b/manual/cops_rails.md index ab3b8586f6f..bb10615f77a 100644 --- a/manual/cops_rails.md +++ b/manual/cops_rails.md @@ -2185,7 +2185,7 @@ Whitelist | `[]` | Array Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged --- | --- | --- | --- | --- -Enabled | Yes | Yes | 0.30 | 0.33 +Enabled | No | Yes | 0.30 | 0.68 This cop checks for the use of Time methods without zone.