-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
102 lines (83 loc) · 2.5 KB
/
.rubocop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# This is the default configuration file. Enabling and disabling is configured
# in separate files. This file adds all other parameters apart from Enabled.
require:
- rubocop-performance
- rubocop-rspec
inherit_from:
- enabled.yml
- disabled.yml
AllCops:
NewCops: enable
Exclude:
- 'db/**/*'
# Default formatter will be used if no -f/--format option is given.
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
# 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.
SuggestExtensions: false
TargetRubyVersion: 2.7
RSpec/ExampleLength:
Description: Checks for long examples.
Enabled: true
Max: 25
RSpec/MultipleExpectations:
Description: Checks if examples contain too many `expect` calls.
Enabled: true
Max: 10
RSpec/MultipleMemoizedHelpers:
Description: Checks if example groups contain too many `let` and `subject` calls.
Enabled: true
AllowSubject: true
Max: 10
RSpec/NestedGroups:
Description: Checks for nested example groups.
Enabled: true
Max: 7
RSpec/MessageSpies:
Description: Checks that message expectations are set using spies.
Enabled: true
EnforcedStyle: receive
Style/Semicolon:
# Allow ; to separate several expressions on the same line.
AllowAsExpressionSeparator: true
Style/StringLiterals:
ConsistentQuotesInMultiline: true
##################### Metrics ##################################
Metrics/AbcSize:
# The ABC size is a calculated magnitude, so this number can be a Fixnum or
# a Float.
CountRepeatedAttributes: false
Max: 30
Metrics/ClassLength:
CountComments: false # count full line comments?
Max: 200
Metrics/ModuleLength:
CountComments: false # count full line comments?
Max: 200
# Avoid complex methods.
Metrics/CyclomaticComplexity:
Max: 10
Layout/LineLength:
Max: 120
Metrics/MethodLength:
CountComments: false # count full line comments?
Max: 25
Metrics/PerceivedComplexity:
Max: 8
Metrics/BlockLength:
CountComments: false
Max: 100
Exclude:
- 'Rakefile'
- '**/*.rake'
- 'spec/**/*.rb'
- 'db/**/*.rb'