autotelik/datashift_journey

View on GitHub
.rubocop.yml

Summary

Maintainability
Test Coverage
AllCops:
  TargetRubyVersion: 2.2
  Include:
    - '**/Rakefile'
    - '**/config.ru'
  Exclude:
    - 'db/**/*'
    - 'config/**/*'
    - 'script/**/*'
    - '.git-hooks/**/*'
    - !ruby/regexp /old_and_unused\.rb$/
    # Bin contains standard files created when Rails is initialised and
    # therefore they should be left as is
    - 'bin/**/*'
    # Rakefile is generated when Rails is initialised and therefore should be
    # left as is
    - 'Rakefile'
    # Tools area - some one-off/pragmatic stuff in here
    - 'lib/datashift_journey/tools/*'
    # spec_helper is generated when rspec is initialised and therefore should be
    # left as is
    - 'spec/spec_helper.rb'
    - 'spec/dummy/**/*'
    - '*.gemspec'

# New rule and seems to be a ruboco bug with automatic cleanup so disabling
# turns until(pc.valid?) into  untilpc.valid? which ruby chokes on

# Looks cluttered/ugly having your first method directly after the module/class declaration
Style/EmptyLinesAroundModuleBody:
    Enabled: false
Style/EmptyLinesAroundClassBody:
    Enabled: false
Style/Lambda:
    Enabled: false
Style/RedundantParentheses:
    Enabled: false

# Rubymine disagrees and not sure how to fix Rubymine indentation right now
CaseIndentation:
    Description: Indentation of when in a case/when/[else/]end.
    Enabled: false

Metrics/AbcSize:
  # The ABC size is a calculated magnitude, so this number can be a Fixnum or
  # a Float.
  Max: 60

Metrics/PerceivedComplexity:
  Max: 15

Metrics/CyclomaticComplexity:
  Max: 10

#RSPEC SPECIFIC

# Turn these off as can totally mess with the expect{...}.to syntax
Style/BlockDelimiters:
  Exclude:
    - spec/**/*_spec.rb
Style/ClassVars:
  Exclude:
    - lib/waste_exemptions/permitted_attributes.rb
MethodCalledOnDoEndBlock:
  Exclude:
    - spec/**/*_spec.rb
Metrics/LineLength:
  Exclude:
    - spec/features/*_spec.rb
    - spec/factories/*.rb
    - spec/routing/**/*.rb

# Specs can get large and with good reason, no benefit splitting them up
Metrics/ModuleLength:
  Exclude:
    - spec/**/*_spec.rb

# The default size seems very restrictive bumping to something more usable
Metrics/ModuleLength:
  Max: 500

Metrics/MethodLength:
  Max: 30

# As a web app, as long as the team commit to using well named classes for
# controllers, collector etc it should not be necessary to add top-level class
# documentation.
Documentation:
  Enabled: false

# We shouldn't be committing code with debug statements left in (e.g. byebug or save_and_open_page),
# we don't understand the GDS rationale for disabling this check
Debugger:
  Enabled: true

LineLength:
  Description: Limit lines to 140 characters.
  Enabled: true
  Max: 140
  Exclude:
    - 'spec/factories/*.rb'
    - 'spec/features/*_spec.rb'
    - 'spec/routing/**/*_spec.rb'