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

Make custom cop inherit RuboCop::Cop::Base #59

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Feb 11, 2023

  1. Make custom cop inherit RuboCop::Cop::Base

    Follow rubocop/rubocop#7868.
    
    The legacy `Cop::Cop` API is soft deprecated and this PR use
    new `Cop::Base` API instead.
    
    > maintain any RuboCop extensions, as the legacy API will be removed in
    > RuboCop 2.0.
    
    https://metaredux.com/posts/2020/10/21/rubocop-1-0.html
    koic committed Feb 11, 2023
    Configuration menu
    Copy the full SHA
    7418af9 View commit details
    Browse the repository at this point in the history
  2. Suppress RuboCop offenses

    This commit suppresses the following RuboCop offenses.
    
    ```console
    Offenses:
    
    lib/rubocop/cop/i18n/gettext/decorate_string.rb:7:11: C: InternalAffairs/CopDescription:
    Description should be started with a word such as verb instead of This cop ....
            # This cop is looks for strings that appear to be sentences but are not decorated. ...
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:7:11: C: InternalAffairs/CopDescription:
    Description should be started with a word such as verb instead of This cop ....
            # This cop is looks for strings that appear to be sentences but are not decorated. ...
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:121:29: C: InternalAffairs/UndefinedConfig:
    EnforcedSentenceType is not defined in the configuration for I18n/RailsI18n/DecorateString in config/default.yml.
                case cop_config['EnforcedSentenceType'].to_s.downcase
                                ^^^^^^^^^^^^^^^^^^^^^^
    lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:131:35: C: InternalAffairs/UndefinedConfig:
    Regexp is not defined in the configuration for I18n/RailsI18n/DecorateString in config/default.yml.
                Regexp.new(cop_config['Regexp']) if cop_config['Regexp']
                                      ^^^^^^^^
    lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:131:60: C: InternalAffairs/UndefinedConfig:
    Regexp is not defined in the configuration for I18n/RailsI18n/DecorateString in config/default.yml.
                Regexp.new(cop_config['Regexp']) if cop_config['Regexp']
                                                               ^^^^^^^^
    lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb:147:44: C: InternalAffairs/UndefinedConfig:
    IgnoreExceptions is not defined in the configuration for I18n/RailsI18n/DecorateString in config/default.yml.
                return false unless cop_config['IgnoreExceptions']
                                               ^^^^^^^^^^^^^^^^^^
    rubocop-i18n.gemspec:6:1: W: [Correctable] Gemspec/RequireMFA: metadata['rubygems_mfa_required'] must be set to 'true'.
    Gem::Specification.new do |spec| ...
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    spec/spec_helper.rb:13:19: C: [Correctable] Style/RedundantConstantBase: Remove redundant ::.
      unless defined?(::TestQueue)
                      ^^
    spec/spec_helper.rb:25:23: C: [Correctable] Style/YodaCondition: Reverse the order of the operands RUBY_ENGINE == v.to_s.
        v.is_a?(Symbol) ? RUBY_ENGINE == v.to_s : v
                          ^^^^^^^^^^^^^^^^^^^^^
    
    23 files inspected, 9 offenses detected, 3 offenses autocorrectable
    ```
    
    NOTE: This commit make MFA enabled in rubocop-i18n.gemspec so releases to rubygems.org will require MFA.
    koic committed Feb 11, 2023
    Configuration menu
    Copy the full SHA
    6a3ca3b View commit details
    Browse the repository at this point in the history