.rubocop.yml
require:
- rubocop-performance
- rubocop-rspec
- rubocop-rubycw
AllCops:
Exclude:
- '.git/**/*'
- 'bin/**/*'
- 'coverage/**/*'
- 'doc/**/*'
- 'tmp/**/*'
- 'vendor/**/*'
# Default formatter will be used if no `-f/--format` option is given.
DefaultFormatter: progress
# Cop names are displayed in offense messages by default. Change behavior
# by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
# option.
DisplayCopNames: true
# Style guide URLs are not displayed in offense messages by default. Change
# behavior by overriding `DisplayStyleGuide`, or by giving the
# `-S/--display-style-guide` option.
DisplayStyleGuide: true
# When specifying style guide URLs, any paths and/or fragments will be
# evaluated relative to the base URL.
StyleGuideBaseURL: https://rubystyle.guide
# Extra details are not displayed in offense messages by default. Change
# behavior by overriding ExtraDetails, or by giving the
# `-E/--extra-details` option.
ExtraDetails: true
# Additional cops that do not reference a style guide rule may be enabled by
# default. Change behavior by overriding `StyleGuideCopsOnly`, or by giving
# the `--only-guide-cops` option.
StyleGuideCopsOnly: false
# All cops except the ones configured `Enabled: false` in this file are enabled by default.
# Change this behavior by overriding either `DisabledByDefault` or `EnabledByDefault`.
# When `DisabledByDefault` is `true`, all cops in the default configuration
# are disabled, and only cops in user configuration are enabled. This makes
# cops opt-in instead of opt-out. Note that when `DisabledByDefault` is `true`,
# cops in user configuration will be enabled even if they don't set the
# Enabled parameter.
# When `EnabledByDefault` is `true`, all cops, even those configured `Enabled: false`
# in this file are enabled by default. Cops can still be disabled in user configuration.
# Note that it is invalid to set both EnabledByDefault and DisabledByDefault
# to true in the same configuration.
EnabledByDefault: false
DisabledByDefault: false
# New cops introduced between major versions are set to a special pending status
# and are not enabled by default with warning message.
# Change this behavior by overriding either `NewCops: enable` or `NewCops: disable`.
# When `NewCops` is `enable`, pending cops are enabled in bulk. Can be overridden by
# the `--enable-pending-cops` command-line option.
# When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
# the `--disable-pending-cops` command-line option.
NewCops: enable
# Enables the result cache if `true`. Can be overridden by the `--cache` command
# line option.
UseCache: true
# Threshold for how many files can be stored in the result cache before some
# of the files are automatically removed.
MaxFilesInCache: 20000
# The cache will be stored in "rubocop_cache" under this directory. If
# CacheRootDirectory is ~ (nil), which it is by default, the root will be
# taken from the environment variable `$XDG_CACHE_HOME` if it is set, or if
# `$XDG_CACHE_HOME` is not set, it will be `$HOME/.cache/`.
# The CacheRootDirectory can be overwritten by passing the `--cache-root` command
# line option or by setting `$RUBOCOP_CACHE_ROOT` environment variable.
CacheRootDirectory: ~
# It is possible for a malicious user to know the location of RuboCop's cache
# directory by looking at CacheRootDirectory, and create a symlink in its
# place that could cause RuboCop to overwrite unintended files, or read
# malicious input. If you are certain that your cache location is secure from
# this kind of attack, and wish to use a symlinked cache location, set this
# value to "true".
AllowSymlinksInCacheRootDirectory: false
# What MRI version of the Ruby interpreter is the inspected code intended to
# run on? (If there is more than one, set this to the lowest version.)
# If a value is specified for TargetRubyVersion then it is used. Acceptable
# values are specified as a float (i.e. 3.0); the teeny version of Ruby
# should not be included. If the project specifies a Ruby version in the
# .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
# try to determine the desired version of Ruby by inspecting the
# .tool-versions file first, then .ruby-version, followed by the Gemfile.lock
# or gems.locked file. (Although the Ruby version is specified in the Gemfile
# or gems.rb file, RuboCop reads the final value from the lock file.) If the
# Ruby version is still unresolved, RuboCop will use the oldest officially
# supported Ruby version (currently Ruby 2.5).
TargetRubyVersion: ~
## Layout ##
Layout/ClassStructure:
Enabled: true
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table
Layout/SpaceInsideArrayPercentLiteral:
Enabled: false
## Metrics ##
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
## RSpec ##
RSpec/DescribedClass:
EnforcedStyle: explicit
RSpec/ExampleLength:
Enabled: false
RSpec/ExpectInHook:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
RSpec/PredicateMatcher:
Strict: false
EnforcedStyle: inflected
## Style ##
Style/AccessModifierDeclarations:
EnforcedStyle: inline
Style/Documentation:
Enabled: false
Style/EmptyCaseCondition:
Enabled: false
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma