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 Gemspec/DateAssignment cop #9496

Merged

Commits on Feb 8, 2021

  1. Add new Gemspec/DateAssignment cop

    Follow rubocop/rubocop-rails#432.
    
    This PR adds new `Gemspec/DateAssignment` cop.
    
    This cop checks that `date =` is not used in gemspec file.
    It is set automatically when the gem is packaged.
    
    ```ruby
    # bad
    Gem::Specification.new do |spec|
      s.name = 'your_cool_gem'
      spec.date = Time.now.strftime('%Y-%m-%d')
    end
    
    # good
    Gem::Specification.new do |spec|
      s.name = 'your_cool_gem'
    end
    ```
    
    RubyGems doesn't expect the value to be set.
    https://github.com/rubygems/rubygems/blob/be08d8307eda3b61f0ec0460fe7fbcf647b526e6/lib/rubygems/specification.rb#L1679-L1681
    koic committed Feb 8, 2021
    Configuration menu
    Copy the full SHA
    5e94c53 View commit details
    Browse the repository at this point in the history