Skip to content
Snippets Groups Projects
.rubocop.yml 6.28 KiB
# Can be removed once all rules are addressed or moved to this file as documented overrides
inherit_from: .rubocop_todo.yml

# Used for merging with exclude lists with .rubocop_todo.yml
inherit_mode:
  merge:
    - Exclude

require:
  - rubocop-rails
  - rubocop-rspec
  - rubocop-performance
  - rubocop-capybara
  - ./lib/linter/rubocop_middle_dot

AllCops:
  TargetRubyVersion: 3.0 # Set to minimum supported version of CI
  DisplayCopNames: true
  DisplayStyleGuide: true
  ExtraDetails: true
  UseCache: true
  CacheRootDirectory: tmp
  NewCops: enable # Opt-in to newly added rules
  Exclude:
    - db/schema.rb
    - 'bin/*'
    - 'node_modules/**/*'
    - 'Vagrantfile'
    - 'vendor/**/*'
    - 'lib/json_ld/*' # Generated files
    - 'lib/templates/**/*'

# Reason: Prefer Hashes without extreme indentation
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutfirsthashelementindentation
Layout/FirstHashElementIndentation:
  EnforcedStyle: consistent

# Reason: Currently disabled in .rubocop_todo.yml
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutlinelength
Layout/LineLength:
  Max: 320 # Default of 120 causes a duplicate entry in generated todo file

# Reason:
# https://docs.rubocop.org/rubocop/cops_lint.html#lintuselessaccessmodifier
Lint/UselessAccessModifier:
  ContextCreatingMethods:
    - class_methods

## Disable most Metrics/*Length cops
# Reason: those are often triggered and force significant refactors when this happend
#         but the team feel they are not really improving the code quality.

# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength
Metrics/BlockLength:
  Enabled: false

# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
Metrics/ClassLength:
  Enabled: false

# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength
Metrics/MethodLength:
  Enabled: false

# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmodulelength
Metrics/ModuleLength:
  Enabled: false

## End Disable Metrics/*Length cops