Skip to content
Extraits de code Groupes Projets
.rubocop.yml 5,10 Kio
AllCops:
  Exclude:
    - "bin/**/*"
    - "db/schema.rb"

Rails:
  Enabled: true

# Disable for rails 4
Rails/HttpPositionalArguments:
  Enabled: false

# Commonly used screens these days easily fit more than 80 characters.
Metrics/LineLength:
  Max: 120

# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength: 
  Max: 20

# The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
Metrics/ClassLength:
  Max: 1500
Metrics/ModuleLength:
  Max: 1500
  
# Raise AbcSize from 15 to 20
Metrics/AbcSize:
  Max: 20

# Some blocks are longer.
Metrics/BlockLength:
  ExcludedMethods:
    - "namespace"
    - "create_table"
  Exclude:
    - "config/**/*.rb"
    - "spec/**/*.rb"

# No space makes the method definition shorter and differentiates
# from a regular assignment.
Layout/SpaceAroundEqualsInParameterDefault:
  EnforcedStyle: no_space

# Single quotes being faster is hardly measurable and only affects parse time.
# Enforcing double quotes reduces the times where you need to change them
# when introducing an interpolation. Use single quotes only if their semantics
# are needed.
Style/StringLiterals:
  EnforcedStyle: double_quotes

# We do not need to support Ruby 1.9, so this is good to use.
Style/SymbolArray:
  Enabled: true

# Most readable form.
Layout/AlignHash:
  EnforcedHashRocketStyle: table
  EnforcedColonStyle: table

# Mixing the styles looks just silly.
Style/HashSyntax:
 EnforcedStyle: ruby19_no_mixed_keys

# has_key? and has_value? are far more readable than key? and value?
Style/PreferredHashMethods:
  Enabled: false

# String#% is by far the least verbose and only object oriented variant.