Skip to content

Commit

Permalink
Suppress RuboCop offenses
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
koic committed Feb 11, 2023
1 parent 7418af9 commit 6a3ca3b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .rubocop.yml
Expand Up @@ -6,6 +6,10 @@ AllCops:
TargetRubyVersion: 2.5
NewCops: enable

# rubocop-i18n does not have config/default.
InternalAffairs/UndefinedConfig:
Enabled: false

Metrics/BlockLength:
Exclude:
# Exclude the spec directory because the rspec DSL results in long blocks
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/i18n/gettext/decorate_string.rb
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Cop
module I18n
module GetText
# This cop is looks for strings that appear to be sentences but are not decorated.
# Looks for strings that appear to be sentences but are not decorated.
# Sentences are determined by the STRING_REGEXP. (Upper case character, at least one space,
# and sentence punctuation at the end)
#
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/cop/i18n/rails_i18n/decorate_string.rb
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Cop
module I18n
module RailsI18n
# This cop is looks for strings that appear to be sentences but are not decorated.
# Looks for strings that appear to be sentences but are not decorated.
# Sentences are determined by the SENTENCE_REGEXP. (Upper case character, at least one space,
# and sentence punctuation at the end)
#
Expand Down
4 changes: 4 additions & 0 deletions rubocop-i18n.gemspec
Expand Up @@ -23,6 +23,10 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.5.8'

spec.metadata = {
'rubygems_mfa_required' => 'true'
}

spec.add_development_dependency 'bundler', '>= 1.17.3'
spec.add_development_dependency 'pry', '~> 0.13.1'
spec.add_development_dependency 'rake', '>= 12.3.3'
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Expand Up @@ -10,7 +10,7 @@
# to individual examples or groups you care about by tagging them with
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
# get run.
unless defined?(::TestQueue)
unless defined?(TestQueue)
# See. https://github.com/tmm1/test-queue/issues/60#issuecomment-281948929
config.filter_run :focus
config.run_all_when_everything_filtered = true
Expand All @@ -22,7 +22,7 @@
Kernel.srand config.seed

broken_filter = lambda do |v|
v.is_a?(Symbol) ? RUBY_ENGINE == v.to_s : v
v.is_a?(Symbol) ? v.to_s == RUBY_ENGINE : v
end
config.filter_run_excluding broken: broken_filter

Expand Down

0 comments on commit 6a3ca3b

Please sign in to comment.