.rubocop.yml
inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
# TravisCI runs `bundle install --path=${BUNDLE_PATH:-vendor/bundle}`
# causing our bundle to be installed in `gemfiles/vendor/bundle`.
# Regardless, we have no interest in linting files in our bundle :D
- gemfiles/vendor/bundle/**/*
# Specify lowest supported ruby version. If we committed our .ruby-version
# file, we wouldn't have to specify this (https://bit.ly/2vNTsue), but we
# don't commit that file because that would interfere with testing multiple
# rubies on CI.
#
# Should be same as `ruby-version` in `.github/workflows/test.yml`
TargetRubyVersion: 2.6
# Avoid empty lines in methods, they are a sign the method is too big.
Layout/EmptyLineAfterGuardClause:
Enabled: false
# Aim for 80, but 100 is OK.
Layout/LineLength:
Max: 100
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Please use normal indentation when aligning parameters.
#
# Good:
#
# method_call(
# a,
# b
# )
#
# method_call(a,
# b
# )
#
# Bad:
#
# method_call(a,
# b)
#
# The latter is harder to maintain and uses too much horizontal space.
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Metrics/AbcSize:
Exclude:
# In an ideal world tests would be held to the same ABC metric as production
# code. In practice, time spent doing so is not nearly as valuable as
# spending the same time improving production code.
- test/**/*
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/BlockLength:
Enabled: false
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/ClassLength:
Enabled: false
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/MethodLength:
Enabled: false
# Questionable value compared to metrics like AbcSize or CyclomaticComplexity.
Metrics/ModuleLength:
Enabled: false
# Sometimes prefixing a method name with get_ or set_ is a reasonable choice.
Naming/AccessorMethodName:
Enabled: false
# Having a consistent delimiter, like EOS, improves reading speed. The delimiter
# is syntactic noise, just like a quotation mark, and inconsistent naming would
# hurt reading speed, just as inconsistent quoting would.
Naming/HeredocDelimiterNaming:
Enabled: false
# Avoid single-line method definitions.
Style/EmptyMethod:
EnforcedStyle: expanded
# Avoid annotated tokens except in desperately complicated format strings.
# In 99% of format strings they actually make it less readable.
Style/FormatStringToken:
Enabled: false
# Too subtle to lint. Guard clauses are great, use them if they help.
Style/GuardClause:
Enabled: false
# Too subtle to lint. A multi-line conditional may improve readability, even if
# a postfix conditional would satisfy `Metrics/LineLength`.
Style/IfUnlessModifier:
Enabled: false
# Too subtle to lint. Use semantic style, but prefer `}.x` over `end.x`.
Style/BlockDelimiters:
Enabled: false
# Use the nested style because it is safer. It is easier to make mistakes with
# the compact style.
Style/ClassAndModuleChildren:
EnforcedStyle: nested
Style/Documentation:
Exclude:
- 'test/**/*'
# Both `module_function` and `extend_self` are legitimate. Most importantly,
# they are different (http://bit.ly/2hSQAGm)
Style/ModuleFunction:
Enabled: false
# `x > 0` is understood by more programmers than `x.positive?`
Style/NumericPredicate:
EnforcedStyle: comparison
# Use slashes for most patterns. Use %r when it reduces backslash escaping.
Style/RegexpLiteral:
AllowInnerSlashes: false
# We use words, like `$LOAD_PATH`, because they are much less confusing that
# arcane symbols like `$:`. Unfortunately, we must then `require "English"` in
# a few places, but it's worth it so that we can read our code.
Style/SpecialGlobalVars:
EnforcedStyle: use_english_names
Style/StringLiterals:
EnforcedStyle: double_quotes