102 lines
2.3 KiB
YAML
102 lines
2.3 KiB
YAML
|
# Extends defaults from: https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
|
||
|
|
||
|
AllCops:
|
||
|
TargetRubyVersion: 2.5
|
||
|
Include:
|
||
|
- "**/*.gemspec"
|
||
|
- "**/*.podspec"
|
||
|
- "**/*.rake"
|
||
|
- "**/Gemfile"
|
||
|
- "**/Rakefile"
|
||
|
- "**/Capfile"
|
||
|
- "**/Guardfile"
|
||
|
Exclude:
|
||
|
- "vendor/**/*"
|
||
|
- "db/schema.rb"
|
||
|
- "bin"
|
||
|
- "coverage"
|
||
|
- "doc"
|
||
|
- "engines"
|
||
|
- "lib/assets"
|
||
|
- "lib/build"
|
||
|
- "log"
|
||
|
- "node_modules"
|
||
|
- "public"
|
||
|
- "script"
|
||
|
- "tmp"
|
||
|
- "vendor"
|
||
|
NewCops: disable
|
||
|
|
||
|
####################
|
||
|
# Layout
|
||
|
####################
|
||
|
|
||
|
Layout/LineLength:
|
||
|
Description: Checks that line length does not exceed the configured limit.
|
||
|
Max: 120
|
||
|
|
||
|
Layout/EmptyLinesAroundClassBody:
|
||
|
Description: Keeps track of empty lines around class bodies.
|
||
|
EnforcedStyle: empty_lines_except_namespace
|
||
|
|
||
|
####################
|
||
|
# Metrics
|
||
|
####################
|
||
|
|
||
|
Metrics/BlockLength:
|
||
|
Description: Avoid long blocks with many lines.
|
||
|
Max: 50
|
||
|
Exclude:
|
||
|
- '**/*.gemspec'
|
||
|
- spec/**/*_spec.rb
|
||
|
|
||
|
Metrics/ClassLength:
|
||
|
Description: Avoid classes longer than 400 lines of code.
|
||
|
Max: 400
|
||
|
|
||
|
Metrics/CyclomaticComplexity:
|
||
|
Description: >-
|
||
|
A complexity metric that is strongly correlated to the number
|
||
|
of test cases needed to validate a method.
|
||
|
Max: 15
|
||
|
|
||
|
Metrics/MethodLength:
|
||
|
Description: Avoid methods longer than 50 lines of code.
|
||
|
Max: 50
|
||
|
|
||
|
Metrics/ModuleLength:
|
||
|
Description: Avoid modules longer than 100 lines of code.
|
||
|
Max: 400
|
||
|
|
||
|
Metrics/PerceivedComplexity:
|
||
|
Description: >-
|
||
|
A complexity metric geared towards measuring complexity for a
|
||
|
human reader.
|
||
|
Max: 15
|
||
|
|
||
|
####################
|
||
|
# Style
|
||
|
####################
|
||
|
|
||
|
Style/StringLiterals:
|
||
|
Description: Checks if uses of quotes match the configured preference.
|
||
|
EnforcedStyle: single_quotes
|
||
|
|
||
|
Style/Documentation:
|
||
|
Description: Document classes and non-namespace modules.
|
||
|
Enabled: false
|
||
|
|
||
|
Style/DoubleNegation:
|
||
|
Description: Checks for uses of double negation (!!).
|
||
|
Enabled: false
|
||
|
|
||
|
Style/FrozenStringLiteralComment:
|
||
|
Description: >-
|
||
|
Add the frozen_string_literal comment to the top of files
|
||
|
to help transition to frozen string literals by default.
|
||
|
Enabled: false
|
||
|
|
||
|
Style/WordArray:
|
||
|
Description: Use %w or %W for arrays of words.
|
||
|
Enabled: false
|