-
Notifications
You must be signed in to change notification settings - Fork 6
/
.default.yml
175 lines (138 loc) · 3.57 KB
/
.default.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
require:
- rubocop-performance
- rubocop-rails
- rubocop-rake
- rubocop-rspec
AllCops:
NewCops: enable
Exclude:
- 'bin/**/*'
- 'config/**/*'
- 'config.ru'
- 'db/**/*'
- 'vendor/**/*'
#### Bundler ####
Bundler/OrderedGems:
Enabled: false
#### Layout ####
Layout/DotPosition:
EnforcedStyle: trailing
Layout/ExtraSpacing:
AllowForAlignment: true
# We are disabling this cop to prevent analysis from tripping on the many pre-existing
# offenses in our repos. Devs can rely on themselves and each other to maintain
# sane line lengths going forward, and fix offending lines as needed.
Layout/LineLength:
Enabled: false
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
#### Lint ####
Lint/AmbiguousBlockAssociation:
Exclude:
# https://github.com/rubocop/rubocop/issues/4222#issuecomment-290655562
- 'spec/**/*'
#### Metrics ####
Metrics/BlockLength:
CountComments: false # count full line comments?
Max: 25
AllowedMethods:
# By default, exclude the `#refine` method, as it tends to have larger
# associated blocks.
- refine
Exclude:
# Specs by nature tend to have lengthy, nested blocks
- '*.gemspec'
- 'spec/**/*'
Metrics/ClassLength:
CountAsOne:
- array
- hash
- heredoc
Metrics/MethodLength:
CountAsOne:
- array
- hash
- heredoc
#### Performance ####
Performance/TimesMap:
# Disabling. Using `Array.new` with a block is marginally more performant, but
# `n.times.map` is much more readable. The former can be used when n is large.
# https://stackoverflow.com/questions/41518896/why-does-rubocop-suggest-replacing-times-map-with-array-new
Enabled: false
#### Rails ####
Rails/SkipsModelValidations:
# We are leaving this cop enabled as a warning.
# Failures can be approved as needed during code review.
Enabled: true
#### RSpec ####
# See also the list of RSpec statements that we exempt from the block
# length cop, under Metrics/BlockLength above
RSpec/DescribeClass:
Exclude:
- 'spec/lib/tasks/**/*'
RSpec/DescribedClass:
SkipBlocks: true
RSpec/ExampleLength:
Enabled: false
# Marked as unsafe due to ongoing issues with awkward wording.
# See: https://github.com/rubocop/rubocop-rspec/issues/1179
RSpec/ExampleWording:
SafeAutoCorrect: false
RSpec/ExpectChange:
EnforcedStyle: block
RSpec/ImplicitSubject:
EnforcedStyle: single_statement_only
RSpec/MessageChain:
Enabled: false
RSpec/MultipleExpectations:
Enabled: false
RSpec/MultipleMemoizedHelpers:
Enabled: false
RSpec/NestedGroups:
Enabled: false
#### Style ####
Style/Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Exclude:
- 'spec/**/*'
Style/IfUnlessModifier:
Enabled: false
Style/MethodCallWithArgsParentheses:
Description: 'Use parentheses for method calls with arguments.'
Enabled: true
AllowedMethods:
# Ignore Ruby keyword methods:
# https://rubystyle.guide/#methods-that-have-keyword-status-in-ruby
- require
- yield
# https://rubystyle.guide/#exceptions
- raise
# Ignore logging methods, as they are considered part of an internal DSL
# https://rubystyle.guide/#methods-that-are-part-of-an-internal-dsl
- debug
- info
- warn
- error
- fatal
# Ignore Rails DSL methods
- has_many
- has_one
- order
- redirect_to
- render
- reset_callbacks
- set_callback
- skip_callback
Exclude:
- 'spec/**/*'
- 'Gemfile'
- 'db/**/*'
- '*.gemspec'
Style/MixinUsage:
Exclude:
- bin/*
Style/RescueStandardError:
Enabled: false
Style/SymbolArray:
MinSize: 4