Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails/TimeZone cop should allow Time.parse against a fixed string which includes a timezone specifier. #440

Closed
urkle opened this issue Feb 12, 2021 · 0 comments · Fixed by #441
Labels
enhancement New feature or request

Comments

@urkle
Copy link

urkle commented Feb 12, 2021

Is your feature request related to a problem? Please describe.

Often in our tests we have this construct

Time.parse('2020-01-05T12:30:00Z')

Where we are specifically putting fixed value strings in the parse which ALWAYS have a timezone specifier (in this case it is Z meaning UTC)

Describe the solution you'd like

The cop should allow this scenario (when using the full ISO8601 format with the timezone specifier)

Describe alternatives you've considered

Simply disabling the cop fully for our specs.

@koic koic transferred this issue from rubocop/rubocop Feb 12, 2021
@koic koic added the enhancement New feature or request label Feb 16, 2021
koic added a commit to koic/rubocop-rails that referenced this issue Feb 20, 2021
Fixes rubocop#440.

This PR makes `Rails/TimeZone` aware of timezone specifier.
koic added a commit to koic/rubocop-rails that referenced this issue Feb 20, 2021
Fixes rubocop#440.

This PR makes `Rails/TimeZone` aware of timezone specifier.
@koic koic closed this as completed in #441 Feb 21, 2021
koic added a commit that referenced this issue Feb 21, 2021
…one_specifier

[Fix #440] Make `Rails/TimeZone` aware of timezone specifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants