.rubocop.yml
AllCops:
# The oldest version of Ruby supported by this gem
TargetRubyVersion: 2.3
# Gotta catch 'em all!
NewCops: enable
# These linters are not enabled by default
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
# These help with readability
Layout/CaseIndentation:
Enabled: false
Layout/EmptyLines:
Enabled: false
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Layout/EmptyLinesAroundClassBody:
EnforcedStyle: empty_lines
Exclude:
- 'testing/rspec/spec/**/*' # Specs tend to just have little monkey patches that don't need the extra room
Layout/EmptyLinesAroundModuleBody:
Enabled: false
Layout/LineLength:
Max: 120
Naming/VariableNumber:
EnforcedStyle: snake_case
Metrics/BlockLength:
Exclude:
- 'testing/rspec/spec/**/*' # RSpec tests are inherently large blocks of code
- 'cuke_modeler.gemspec' # As is a gemspec
# If Ruby suddenly changes, that's its fault.
Style/FrozenStringLiteralComment:
Enabled: false
# Non-specific exception handling is fine
Style/RescueStandardError:
EnforcedStyle: 'implicit'
# This would result in too much intermixing of regular and percent arrays, depending on
# context, and makes nested arrays look weird
Style/SymbolArray:
Enabled: false
Style/WordArray:
Enabled: false
# Still within understanding as long as other complexity cops aren't triggering
Metrics/MethodLength:
Max: 15
# I'd rather not have to mix `{}` and `do...end` blocks for `let` statements just to keep RuboCop happy
Layout/BlockEndNewline:
Exclude:
- 'testing/rspec/spec/**/*'
Layout/MultilineBlockLayout:
Exclude:
- 'testing/rspec/spec/**/*'
Style/BlockDelimiters:
Exclude:
- 'testing/rspec/spec/**/*'
Security/Eval:
Exclude:
- 'testing/**/*' # Test code is a safe enough place to use 'eval'
Layout/HashAlignment:
EnforcedHashRocketStyle: table
# The gemspec is the source of truth for a gem. Also, enough wacky things happen in this
# project's gemfiles that we don't need more stuff going in there.
Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec
# Additionally, easily distinguishing between runtime and development dependencies is important
# when they live in the same place.
Gemspec/AddRuntimeDependency:
Enabled: false