Skip to content

Commit

Permalink
[Fix rubocop#432] Exclude gemspec file by default for `Rails/TimeZone…
Browse files Browse the repository at this point in the history
…` cop

Fixes rubocop#432.

This PR excludes gemspec file by default for `Rails/TimeZone` cop.
  • Loading branch information
koic committed Feb 9, 2021
1 parent d6868a6 commit 217db49
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

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

## 2.9.1 (2020-12-16)

Expand Down
4 changes: 3 additions & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -687,13 +687,15 @@ Rails/TimeZone:
Enabled: true
Safe: false
VersionAdded: '0.30'
VersionChanged: '0.68'
VersionChanged: '2.10'
# 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
SupportedStyles:
- strict
- flexible
Exclude:
- '**/*.gemspec'

Rails/UniqBeforePluck:
Description: 'Prefer the use of uniq or distinct before pluck.'
Expand Down
6 changes: 5 additions & 1 deletion docs/modules/ROOT/pages/cops_rails.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4133,7 +4133,7 @@ SQL
| No
| Yes (Unsafe)
| 0.30
| 0.68
| 2.10
|===

This cop checks for the use of Time methods without zone.
Expand Down Expand Up @@ -4195,6 +4195,10 @@ Time.at(timestamp).in_time_zone
| EnforcedStyle
| `flexible`
| `strict`, `flexible`

| Exclude
| `**/*.gemspec`
| Array
|===

=== References
Expand Down

0 comments on commit 217db49

Please sign in to comment.