require:
  - rubocop-performance
  - rubocop-rails
  - rubocop-minitest

AllCops:
  TargetRubyVersion: 2.7
  TargetRailsVersion: 6.1
  NewCops: enable

Rails:
  Enabled: true

Minitest/MultipleAssertions:
  Max: 5
  Enabled: true

Minitest/AssertPredicate:
  Enabled: false

Metrics:
  Enabled: false

Metrics/ParameterLists:
  Enabled: true
  CountKeywordArgs: false

Layout/LineLength:
  Max: 140

Rails/ApplicationJob:
  Enabled: false

Lint/AmbiguousOperatorPrecedence:
  Enabled: false

Rails/ApplicationRecord:
  Enabled: false

Rails/CreateTableWithTimestamps:
  Enabled: false

Rails/HelperInstanceVariable:
  Enabled: false

Rails/SkipsModelValidations:
  Enabled: false

Performance/ChainArrayAllocation:
  Enabled: true

Style/AutoResourceCleanup:
  Enabled: true

Style/ExpandPathArguments:
  Enabled: true
  Exclude:
    - test/**/*

Style/FrozenStringLiteralComment:
  Enabled: true
  Exclude:
    - '/**/*.rsb'

Style/OptionHash:
  Enabled: true
  SuspiciousParamNames:
    - options
    - api_options
    - opts
    - args
    - params
    - parameters
    - settings
  Exclude:
    - lib/redmine_messenger/patches/*.rb

# postgresql and mysql are supported
# autodetect does not work without database configuration
Rails/BulkChangeTable:
  Enabled: true
  Database: postgresql

Style/ReturnNil:
  Enabled: true

Style/UnlessLogicalOperators:
  Enabled: true

Style/MethodCallWithArgsParentheses:
  Enabled: true
  AllowParenthesesInMultilineCall: true
  AllowParenthesesInChaining: true
  EnforcedStyle: omit_parentheses

Style/Documentation:
  Enabled: false

Style/HashTransformKeys:
  Enabled: false

Style/HashTransformValues:
  Enabled: false

Naming/VariableNumber:
  Enabled: false
