You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/.rubocop.yml

156 lines
3.2 KiB

# Extends defaults from: https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec
AllCops:
TargetRubyVersion: 2.4
Exclude:
- "vendor/**/*"
- "db/schema.rb"
- "bin"
- "coverage"
- "doc"
- "engines"
- "lib/assets"
- "lib/build"
- "log"
- "node_modules"
- "public"
- "script"
- "tmp"
- "vendor"
NewCops: disable
####################
# Layout
####################
5 years ago
Layout/LineLength:
Description: Checks that line length does not exceed the configured limit.
9 years ago
Max: 120
Layout/EmptyLinesAroundClassBody:
Description: Keeps track of empty lines around class bodies.
EnforcedStyle: empty_lines_except_namespace
4 years ago
Layout/EmptyLinesAroundModuleBody:
Description: Keeps track of empty lines around module bodies.
EnforcedStyle: empty_lines_except_namespace
####################
# Metrics
####################
5 years ago
Metrics/AbcSize:
Description: >-
A calculated magnitude based on number of assignments,
branches, and conditions.
4 years ago
Max: 35
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 100 lines of code.
Max: 100
Metrics/ModuleLength:
Description: Avoid modules longer than 400 lines of code.
Max: 400
Metrics/PerceivedComplexity:
Description: >-
A complexity metric geared towards measuring complexity for a
human reader.
Max: 15
4 years ago
####################
# Naming
####################
Naming/PredicateName:
ForbiddenPrefixes:
- is_
- have_
4 years ago
Naming/VariableNumber:
Description: Use the configured style when numbering variables.
Enabled: false
4 years ago
####################
# RSpec
####################
RSpec/AnyInstance:
Enabled: false
RSpec/ExampleLength:
Max: 30
4 years ago
# Incompatible until RSpec 3
RSpec/ImplicitExpect:
Enabled: false
RSpec/MultipleExpectations:
Max: 10
4 years ago
RSpec/MultipleMemoizedHelpers:
Max: 15
RSpec/NestedGroups:
Max: 5
####################
# Style
####################
Style/PercentLiteralDelimiters:
Description: Use `%`-literal delimiters consistently.
Enabled: false
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/GuardClause:
Enabled: false
4 years ago
Style/SymbolArray:
Description: Use %i or %I for arrays of symbols.
Enabled: false
Style/WordArray:
Description: Use %w or %W for arrays of words.
Enabled: false