bigcommerce/gruf

View on GitHub
.rubocop.yml

Summary

Maintainability
Test Coverage
####################################################################################################
# AllCops Configurations
####################################################################################################

AllCops:
  TargetRubyVersion: 3.0
  SuggestExtensions: false
  NewCops: enable
  Exclude:
    - .bundle/**/*
    - bin/**/*
    - vendor/**/*
    - tmp/**/*
    - log/**/*
    - spec/support/**/*
    - spec/factories/**/*
    - spec/fixtures/**/*
    - spec/pb/**/*
    - spec/demo_server
require:
  - rubocop-performance
  - rubocop-rspec
  - rubocop-thread_safety

####################################################################################################
# Layout Configurations
####################################################################################################

Layout/EndAlignment:
  Enabled: false

Layout/LineLength:
  Max: 120

####################################################################################################
# Lint Configurations
####################################################################################################

# Rubocop is opinionated here, which makes compositional base classes/interfaces with keyword arguments problematic.
# Disabling this allows base class stub methods to have keyword args.
Lint/UnusedMethodArgument:
  AllowUnusedKeywordArguments: true

####################################################################################################
# Metrics Configurations
####################################################################################################

Metrics/AbcSize:
  Max: 147

Metrics/BlockLength:
  Enabled: false

Metrics/ClassLength:
  Max: 406

Metrics/CyclomaticComplexity:
  Max: 12

Metrics/MethodLength:
  Max: 88

Metrics/ModuleLength:
  Max: 1000

Metrics/ParameterLists:
  Max: 9
  MaxOptionalParameters: 5

Metrics/PerceivedComplexity:
  Max: 12

Style/ArgumentsForwarding:
  Enabled: false

####################################################################################################
# Naming Configurations
####################################################################################################

Naming/PredicateName:
  Enabled: false

####################################################################################################
# RSpec Configurations
####################################################################################################

RSpec/AnyInstance:
  Enabled: false

RSpec/ContextWording:
  inherit_mode:
    merge:
      - Prefixes
  Prefixes:
    - and

RSpec/DescribeClass:
  Exclude:
    - spec/gruf/functional/**/*

RSpec/ExampleLength:
  Max: 50

RSpec/IndexedLet:
  Enabled: false

RSpec/IteratedExpectation:
  Exclude:
    - spec/gruf/functional/**/*

RSpec/MessageSpies:
  EnforcedStyle: receive

RSpec/MultipleExpectations:
  Max: 30

RSpec/MultipleMemoizedHelpers:
  Enabled: false

RSpec/NamedSubject:
  Enabled: false

RSpec/NestedGroups:
  Enabled: false

RSpec/StubbedMock:
  Enabled: false

# This does not work with RPC messages
RSpec/VerifiedDoubles:
  Enabled: false

####################################################################################################
# Style Configurations
####################################################################################################

# We prefer the leading constant declaration for easier refactoring
Style/RedundantConstantBase:
  Enabled: false

####################################################################################################
# ThreadSafety Configurations
####################################################################################################

# We're fine with this
ThreadSafety/NewThread:
  Enabled: false