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

Add new Rails/RelativeDateGrammar cop #1106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 7, 2023

  1. Add new Rails/RelativeDateGrammar cop

    This PR adds new `Rails/RelativeDateGrammar` cop.
    
    It checks whether the word orders of relative dates
    are grammatically easy to understand.
    This check includes detecting undefined methods on Date(Time) objects.
    
    ```ruby
    # bad
    tomorrow = Time.current.since(1.day)
    
    # good
    tomorrow = 1.day.since(Time.current)
    ```
    aeroastro committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    873ad73 View commit details
    Browse the repository at this point in the history