plugins:
  - rubocop-rspec

AllCops:
  TargetRubyVersion: 3.0
  NewCops: disable
  SuggestExtensions: false
  Exclude:
    - tmp/**/*
    - lib/bundler/vendor/**/*
    - vendor/bundle/**/*
  DisplayCopNames: true

# Lint

# They are idiomatic
Lint/AssignmentInCondition:
  Enabled: false

Layout/EndAlignment:
  EnforcedStyleAlignWith: variable
  AutoCorrect: true

Lint/UnusedMethodArgument:
  Enabled: false

# Style

Layout/AccessModifierIndentation:
  EnforcedStyle: outdent

Style/Alias:
  EnforcedStyle: prefer_alias_method

Layout/ParameterAlignment:
  EnforcedStyle: with_fixed_indentation

Style/ClassAndModuleChildren:
  Enabled: false

Style/Documentation:
  Enabled: false

Style/MultilineBlockChain:
  Enabled: false

Layout/MultilineOperationIndentation:
  EnforcedStyle: indented

Style/PerlBackrefs:
  Enabled: false

Style/RaiseArgs:
  Enabled: false

Style/SingleLineBlockParams:
  Enabled: false

Layout/SpaceInsideBlockBraces:
  SpaceBeforeBlockParameters: false

Style/TrivialAccessors:
  Enabled: false

# We adopted raise instead of fail.
Style/SignalException:
  EnforcedStyle: only_raise

Style/StringLiterals:
  EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
  EnforcedStyle: double_quotes

# Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line.
Style/TrailingCommaInArrayLiteral:
  EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
  EnforcedStyleForMultiline: comma

Style/TrailingUnderscoreVariable:
  Enabled: false

# `String.new` is preferred style with enabled frozen string literal
Style/EmptyLiteral:
  Enabled: false

Style/Lambda:
  Enabled: false

Layout/DotPosition:
  EnforcedStyle: trailing

Style/EachWithObject:
  Enabled: false

Style/SpecialGlobalVars:
  Enabled: false

Style/TrailingCommaInArguments:
  Enabled: false

# Layout

Layout/FirstArrayElementIndentation:
  EnforcedStyle: consistent

Layout/LineLength:
  Max: 130

# Metrics

# We've chosen to use Rubocop only for style, and not for complexity or quality checks.
Metrics/BlockLength:
  Enabled: false

Metrics/ClassLength:
  Enabled: false

Metrics/ModuleLength:
  Enabled: false

Metrics/MethodLength:
  Enabled: false

Metrics/BlockNesting:
  Enabled: false

Metrics/AbcSize:
  Enabled: false

Metrics/CyclomaticComplexity:
  Enabled: false

Metrics/ParameterLists:
  Enabled: false

# It will be obvious which code is complex, Rubocop should only lint simple
# rules for us.
Metrics/PerceivedComplexity:
  Enabled: false

# RSpec

# Integration tests naturally need more than 5 lines to set up, act, and assert.
RSpec/ExampleLength:
  Max: 15

# Integration tests legitimately verify multiple things in one example.
RSpec/MultipleExpectations:
  Enabled: false
