rom-rb/rom-rails

View on GitHub
.rubocop.yml

Summary

Maintainability
Test Coverage
# FIXME: Lower by refactoring biggest offenders
Metrics/AbcSize:
  Max: 26

# FIXME: Lower by refactoring biggest offenders
Metrics/CyclomaticComplexity:
  Max: 8

# FIXME: No clue how to fix that one line…
Metrics/LineLength:
  Max: 100
  Exclude:
    - lib/rom/rails/configuration.rb

# FIXME: Lower by refactoring biggest offenders
Metrics/MethodLength:
  Max: 22

# FIXME: Lower by refactoring biggest offenders
Metrics/PerceivedComplexity:
  Max: 10

# Don’t check temp and Rails-generated files
AllCops:
  TargetRubyVersion: 2.3.1
  Exclude:
    - spec/dummy/Rakefile
    - spec/dummy/config/**/*
    - spec/dummy/db/schema.rb
    - spec/dummy/db/seeds.rb
    - tmp/**/*
    - vendor/**/*

Layout/AlignArguments:
  EnforcedStyle: with_fixed_indentation

# The enforced style doesn’t match Vim’s defaults
Layout/AlignParameters:
  Enabled: false


# UTF-8 is perfectly fine in comments
Style/AsciiComments:
  Enabled: false

Style/BlockDelimiters:
  EnforcedStyle: semantic
  FunctionalMethods:
    - let
    - let!
    - subject
    - watch
    - before

Style/BracesAroundHashParameters:
  Enabled: true
  EnforcedStyle: context_dependent

# Allow compact style for specs
Style/ClassAndModuleChildren:
  Exclude:
    - spec/**/*_spec.rb

# Documentation checked by Inch CI
Style/Documentation:
  Enabled: false

# This is a shim file for those who require 'rom-rails'
Naming/FileName:
  Exclude:
    - lib/rom-rails.rb

# Early returns have their vices
Style/GuardClause:
  Enabled: false

# Need to be skipped for >-> usage
Style/Lambda:
  Enabled: false

# Multiline block chains are ok
Style/MultilineBlockChain:
  Enabled: false

# Multiline operation chains are indented
Layout/MultilineOperationIndentation:
  EnforcedStyle: indented

# Model::Validator uses Model::ValidationError for this
Style/RaiseArgs:
  Exclude:
    - lib/rom/model.rb

# Don’t introduce semantic fail/raise distinction
Style/SignalException:
  EnforcedStyle: only_raise

# Need to be skipped for >-> usage
Layout/SpaceAroundOperators:
  Enabled: false

# Accept both single and double quotes
Style/StringLiterals:
  Enabled: false

# Allow def self.foo; @foo; end
Style/TrivialAccessors:
  Enabled: false

# Allow logical `or`/`and` in conditionals
Style/AndOr:
  EnforcedStyle: conditionals

# Fails to register points where we otherwise _use_ the block
Performance/RedundantBlockCall:
  Enabled: false

Style/FrozenStringLiteralComment:
  Enabled: false

Style/PercentLiteralDelimiters:
  Enabled: false

Lint/AmbiguousBlockAssociation:
  Enabled: false

Metrics/BlockLength:
  Enabled: false

Layout/SpaceInsideHashLiteralBraces:
  Enabled: false

Style/BlockDelimiters:
  Enabled: false


Layout/SpaceInsideArrayLiteralBrackets:
  Enabled: false

Style/IfUnlessModifier:
  Enabled: false

Layout/AccessModifierIndentation:
  Enabled: false

Style/SymbolArray:
  Enabled: false

Style/SafeNavigation:
  Enabled: false

Lint/HandleExceptions:
  Enabled: false