require:
  - rubocop-rspec

AllCops:
  NewCops: enable
  TargetRubyVersion: 3.1
  Exclude:
    - 'bin/**/*'
    - 'db/**/*'
    - 'config/**/*'
    - 'script/**/*'
    - 'vendor/**/*'  # Exclude vendor directory to avoid conflicts with Jekyll's RuboCop config
  SuggestExtensions: false

# Layout
Layout/ParameterAlignment:
  EnforcedStyle: with_fixed_indentation

Layout/CaseIndentation:
  EnforcedStyle: end

Layout/FirstHashElementIndentation:
  Enabled: false

Layout/MultilineMethodCallIndentation:
  EnforcedStyle: indented

Layout/MultilineOperationIndentation:
  EnforcedStyle: indented

Layout/SpaceInsideHashLiteralBraces:
  Enabled: false

Layout/HashAlignment:
  Enabled: true
  EnforcedLastArgumentHashStyle: always_ignore

Layout/EndAlignment:
  EnforcedStyleAlignWith: variable

Layout/LineLength:
  Enabled: false

# Style
Style/AsciiComments:
  Enabled: false

Style/CollectionMethods:
  Enabled: true
  PreferredMethods:
    inject: 'inject'

Style/Documentation:
  Enabled: false

Style/BlockDelimiters:
  Exclude:
    - spec/**/*_spec.rb

Style/GuardClause:
  Enabled: false

Style/IfUnlessModifier:
  Enabled: false

Style/Lambda:
  Enabled: false

Style/RaiseArgs:
  Enabled: false

Style/SignalException:
  Enabled: false

Style/SingleLineBlockParams:
  Enabled: false

Style/FormatString:
  Enabled: false

Style/WordArray:
  Enabled: false

Style/RedundantSelf:
  Enabled: false

Style/TrivialAccessors:
  AllowPredicates: true

Style/RedundantReturn:
  Description: 'Do not use return in an ensure block.'
  StyleGuide: '#no-return-ensure'
  Enabled: true

# Metrics
Metrics/PerceivedComplexity:
  Max: 30

Metrics/CyclomaticComplexity:
  Max: 30

Metrics/AbcSize:
  Max: 75

Metrics/ClassLength:
  Max: 300

Metrics/ModuleLength:
  Max: 200

Metrics/MethodLength:
  Max: 50

# RSpec
RSpec/ExampleLength:
  Max: 100

RSpec/MultipleExpectations:
  Max: 10

RSpec/NestedGroups:
  Max: 4

RSpec/DescribeClass:
  Enabled: false

RSpec/MessageSpies:
  EnforcedStyle: receive

# Disable obnoxious RSpec rules
RSpec/InstanceVariable:
  Enabled: false

RSpec/ExampleWording:
  Enabled: false

RSpec/EmptyLineAfterExample:
  Enabled: false

RSpec/BeEq:
  Enabled: false

RSpec/NotToNot:
  Enabled: false

RSpec/RepeatedExample:
  Enabled: false

RSpec/RepeatedDescription:
  Enabled: false

RSpec/HookArgument:
  Enabled: false

RSpec/DescribedClass:
  Enabled: false

RSpec/EmptyLineAfterHook:
  Enabled: false

# Disable other obnoxious rules
Style/FrozenStringLiteralComment:
  Enabled: false

Style/StringLiterals:
  Enabled: false

Style/ExpandPathArguments:
  Enabled: false

Style/MixinUsage:
  Enabled: false

Style/BlockComments:
  Enabled: false

Style/MagicCommentFormat:
  Enabled: false

Layout/EmptyLineAfterMagicComment:
  Enabled: false

Style/RedundantLineContinuation:
  Enabled: false

Style/HashSyntax:
  Enabled: false

Style/OptionalBooleanParameter:
  Enabled: false

Style/Semicolon:
  Enabled: false

Style/OrAssignment:
  Enabled: false

Style/PercentLiteralDelimiters:
  Enabled: false

Style/RedundantCapitalW:
  Enabled: false

Layout/ArgumentAlignment:
  Enabled: false

Layout/EmptyComment:
  Enabled: false

# Disable naming rules
Naming/VariableName:
  Enabled: false

Naming/FileName:
  Enabled: false

Naming/MethodName:
  Enabled: false
