|
- inherit_from: .rubocop_todo.yml
-
- require:
- - rubocop-packaging
-
- AllCops:
- NewCops: disable
- # Keep this inline with the lowest ruby-* version in circleci/config.yml and
- # the version in the gemspec
- TargetRubyVersion: 2.6
- # Cop names are not displayed in offense messages by default. Change behavior
- # by overriding DisplayCopNames, or by giving the `-D/--display-cop-names`
- # option.
- DisplayCopNames: true
- # Style guide URLs are not displayed in offense messages by default. Change
- # behavior by overriding `DisplayStyleGuide`, or by giving the
- # `-S/--display-style-guide` option.
- DisplayStyleGuide: true
- Exclude:
- - 'bin/*'
- - 'tmp/**/*'
- - 'vendor/**/*'
- - 'temp_app/**/*'
- - 'cck/features/**/*'
-
- Layout/EndOfLine:
- EnforcedStyle: lf
-
- # Disabling this cop until the minimum Ruby version is >= 2.3 as squiggly
- # heredocs '<<~' were introduced then. The files below are the current ones
- # with offenses
- Layout/HeredocIndentation:
- Exclude:
- - 'features/lib/support/feature_factory.rb'
- - 'lib/cucumber/cli/options.rb'
- - 'lib/cucumber/cli/profile_loader.rb'
- - 'spec/cucumber/cli/configuration_spec.rb'
- - 'spec/cucumber/cli/profile_loader_spec.rb'
- - 'spec/cucumber/formatter/pretty_spec.rb'
-
- # Reviewed: Formatters put trailing spaces after things like 'Feature: '
- # In pretty_spec.rb, progress_spec.rb offences look false,
- # as the trailing spaces are in multiline string literals
- Layout/TrailingWhitespace:
- Exclude:
- - 'spec/cucumber/formatter/pretty_spec.rb'
- - 'spec/cucumber/formatter/progress_spec.rb'
-
- # Reviewed: please see PR-1022 for details on why this cop is disabled:
- # https://github.com/cucumber/cucumber-ruby/pull/1022
- Lint/AmbiguousOperator:
- Enabled: false
-
- # We exclude proto_world for documentation (rdoc) purpose
- Lint/UselessMethodDefinition:
- Enabled: true
- Exclude:
- - 'lib/cucumber/glue/proto_world.rb'
-
- Metrics/AbcSize:
- Max: 45
-
- Metrics/BlockLength:
- CountComments: false
- Exclude:
- - './cucumber.gemspec'
- - './spec/**/*'
- - 'cck/spec/**/*'
-
- Metrics/ClassLength:
- Max: 375
- Exclude:
- - 'lib/cucumber/cli/options.rb'
-
- Metrics/CyclomaticComplexity:
- Max: 12
-
- # A line length of 200 covers most violations in the repo while still being
- # a more up to date length given today's screen sizes
- Layout/LineLength:
- Max: 200
-
- Metrics/ModuleLength:
- Max: 150
- Exclude:
- - './spec/**/*'
- - 'cck/spec/**/*'
-
- Metrics/MethodLength:
- Max: 30
-
- Metrics/PerceivedComplexity:
- Max: 13
-
- # Rubocop doesn't like method names in other languages but as Cucumber supports
- # languages, this cop needs to be disabled.
- Naming/AsciiIdentifiers:
- Enabled: false
-
- # For the most part, the project is solid on naming. There are though, a few
- # cases where the cop doesn't need to catch.
- Naming/MethodName:
- EnforcedStyle: snake_case
- Enabled: true
- Exclude:
- - 'examples/i18n/ar/lib/calculator.rb'
- - 'examples/i18n/he/lib/calculator.rb'
- - 'examples/i18n/he/lib/calculator.rb'
- - 'examples/i18n/tr/lib/hesap_makinesi.rb'
- - 'lib/cucumber/glue/dsl.rb'
-
- # In most cases, being descriptive with parameter names helps a reader understand
- # what the variable is for. In some cases, shorter names are sufficient.
- Naming/MethodParameterName:
- AllowedNames: _, e, n, v, id, io, gh, pr
-
- # Reviewed: these offenses look false as the variables are in cyrillic
- Naming/VariableName:
- Exclude:
- - 'examples/i18n/ru/features/step_definitions/calculator_steps.rb'
- - 'examples/i18n/uk/features/step_definitions/calculator_steps.rb'
- - 'examples/i18n/uz/features/step_definitions/calculator_steps.rb'
-
- # Rubocop doesn't handle some international words well for this cop
- Naming/VariableNumber:
- EnforcedStyle: normalcase
- Exclude:
- - 'examples/i18n/**/*'
-
- # This cop throws errors when parsing a lot of the repo's code, possibly due
- # to splat issues?
- Style/AccessModifierDeclarations:
- Enabled: false
-
- Style/ClassAndModuleChildren:
- Enabled: false
-
- Style/ClassEqualityComparison:
- Enabled: true
-
- Style/Documentation:
- Enabled: false
-
- Style/FormatStringToken:
- EnforcedStyle: annotated
-
- Style/FloatDivision:
- Enabled: false
-
- Style/StderrPuts:
- Enabled: false
-
- Style/RegexpLiteral:
- EnforcedStyle: slashes
- AllowInnerSlashes: true
-
- Style/YodaCondition:
- Enabled: true
|