mvz/happymapper

View on GitHub
.rubocop.yml

Summary

Maintainability
Test Coverage
inherit_from: .rubocop_todo.yml

inherit_mode:
  merge:
    - Exclude

require:
  - rubocop-packaging
  - rubocop-performance
  - rubocop-rspec

AllCops:
  NewCops: enable
  TargetRubyVersion: 3.0

# Put development dependencies in the gemspec so rubygems.org knows about them
Gemspec/DevelopmentDependencies:
  EnforcedStyle: gemspec

# Spaces in strings with line continuations go at the beginning of the line.
Layout/LineContinuationLeadingSpace:
  EnforcedStyle: leading

# Be lenient with line length
Layout/LineLength:
  Max: 92

# Assume the programmer knows how bracketed block syntax works
Lint/AmbiguousBlockAssociation:
  Enabled: false

# Assume the programmer knows precendence rules
Lint/AmbiguousOperatorPrecedence:
  Enabled: false

Metrics/BlockLength:
  Exclude:
    - 'spec/**/*_spec.rb'  # Blocks can be any length in spec files
    - '*.gemspec'  # Gem spec blocks can be any size

# TODO: Update code so these maxima can be lowered
Metrics/ParameterLists:
  Max: 6
  MaxOptionalParameters: 4

Naming/PredicateName:
  AllowedMethods:
    - 'has_one'
    - 'has_many'
    - 'has_xml_content'

# regression specs do not describe classes
RSpec/DescribeClass:
  Exclude:
    - 'spec/regressions/*.rb'

RSpec/SpecFilePathFormat:
  CustomTransform:
    HappyMapper: 'happymapper'

# Do not commit to use of interpolation
Style/StringLiterals:
  EnforcedStyle: double_quotes

# Make quoting outside and inside interpolation consistent
Style/StringLiteralsInInterpolation:
  EnforcedStyle: double_quotes

# Use older RuboCop default
Style/PercentLiteralDelimiters:
  PreferredDelimiters:
    '%w': ()

# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
  EnforcedStyle: comparison