require: ezcater_rubocop
require: rubocop-rspec

AllCops:
  DisplayCopNames: true

# This is a useful cop but produces some false positives and can break code:
# https://github.com/rubocop-hq/rubocop-rspec/issues/655
FactoryBot/DynamicAttributeDefinedStatically:
  Enabled: false

Layout/DotPosition:
  EnforcedStyle: trailing

Metrics/AbcSize:
  Enabled: false

Metrics/BlockLength:
  Exclude:
  - "*.gemspec"
  - "spec/**/*.rb"
  - "lib/tasks/**/*.rake"
  - "config/environments/*.rb"

Metrics/CyclomaticComplexity:
  Enabled: false

Metrics/LineLength:
  Max: 120
  Exclude:
  - "Gemfile"

Metrics/MethodLength:
  Enabled: true
  CountComments: false
  Max: 25

Metrics/PerceivedComplexity:
  Enabled: false

# Disable this cop until configuration options are available (>= 0.58.0)
Naming/MemoizedInstanceVariableName:
  Enabled: false

Naming/UncommunicativeMethodParamName:
  AllowedNames:
  - e
  - ex
  - id

Rails:
  Enabled: false

RSpec/ContextWording:
  Enabled: false

RSpec/DescribeClass:
  Exclude:
  - "spec/requests/**/*.rb"
  - "spec/features/**/*.rb"
  - "spec/routing/**/*.rb"
  - "spec/views/**/*.rb"
  - "spec/system/**/*.rb"
  - "spec/integrations/**/*.rb"

RSpec/ExampleLength:
  Max: 25

RSpec/LetSetup:
  Enabled: false

RSpec/MultipleExpectations:
  Max: 5

RSpec/NestedGroups:
  Max: 5

RSpec/Rails/HttpStatus:
  EnforcedStyle: symbolic

Style/EmptyLiteral:
  Enabled: false

Style/FrozenStringLiteralComment:
  Enabled: true
  EnforcedStyle: when_needed

Style/GuardClause:
  Enabled: false

Style/Documentation:
  Enabled: false

Style/IfUnlessModifier:
  Enabled: false

# This cop does not yet support a style to prevent underscores
Style/NumericLiterals:
  Enabled: false

Style/PercentLiteralDelimiters:
  PreferredDelimiters:
    default: '()'
    '%i': '()'
    '%I': '()'
    '%r': '{}'
    '%w': '()'
    '%W': '()'

Style/RaiseArgs:
  EnforcedStyle: compact

Style/RegexpLiteral:
  Enabled: true
  EnforcedStyle: slashes
  AllowInnerSlashes: true

Style/SingleLineBlockParams:
  Enabled: false

Style/StderrPuts:
  Exclude:
    - "bin/yarn"

Style/StringLiterals:
  EnforcedStyle: double_quotes

Style/TrailingCommaInArrayLiteral:
  EnforcedStyleForMultiline: consistent_comma

Style/TrailingCommaInHashLiteral:
  EnforcedStyleForMultiline: consistent_comma