Skip to content

Commit b3766c9

Browse files
authored
Merge pull request #439 from koic/exclude_gemspec_by_default_for_rails_time_zone
[Fix #432] Exclude gemspec file by default for `Rails/TimeZone` cop
2 parents b0a022f + 217db49 commit b3766c9

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
* [#409](https://github.com/rubocop-hq/rubocop-rails/pull/409): Deconstruct "table.column" in `Rails/WhereNot`. ([@mobilutz][])
1212
* [#416](https://github.com/rubocop-hq/rubocop-rails/pull/416): Make `Rails/HasManyOrHasOneDependent` accept combination of association extension and `with_options`. ([@ohbarye][])
13+
* [#432](https://github.com/rubocop-hq/rubocop-rails/issues/432): Exclude gemspec file by default for `Rails/TimeZone` cop. ([@koic][])
1314

1415
## 2.9.1 (2020-12-16)
1516

config/default.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -687,13 +687,15 @@ Rails/TimeZone:
687687
Enabled: true
688688
Safe: false
689689
VersionAdded: '0.30'
690-
VersionChanged: '0.68'
690+
VersionChanged: '2.10'
691691
# The value `strict` means that `Time` should be used with `zone`.
692692
# The value `flexible` allows usage of `in_time_zone` instead of `zone`.
693693
EnforcedStyle: flexible
694694
SupportedStyles:
695695
- strict
696696
- flexible
697+
Exclude:
698+
- '**/*.gemspec'
697699

698700
Rails/UniqBeforePluck:
699701
Description: 'Prefer the use of uniq or distinct before pluck.'

docs/modules/ROOT/pages/cops_rails.adoc

+5-1
Original file line numberDiff line numberDiff line change
@@ -4133,7 +4133,7 @@ SQL
41334133
| No
41344134
| Yes (Unsafe)
41354135
| 0.30
4136-
| 0.68
4136+
| 2.10
41374137
|===
41384138

41394139
This cop checks for the use of Time methods without zone.
@@ -4195,6 +4195,10 @@ Time.at(timestamp).in_time_zone
41954195
| EnforcedStyle
41964196
| `flexible`
41974197
| `strict`, `flexible`
4198+
4199+
| Exclude
4200+
| `**/*.gemspec`
4201+
| Array
41984202
|===
41994203

42004204
=== References

0 commit comments

Comments
 (0)