-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
325 lines (248 loc) · 8.46 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
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
# Custom
Metrics/ClassLength:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
# Source: https://github.com/airbnb/ruby/blob/master/rubocop-airbnb/config/rubocop-lint.yml
Lint/AmbiguousBlockAssociation:
Enabled: false
Lint/AmbiguousOperator:
Description: Checks for ambiguous operators in the first argument of a method invocation
without parentheses.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#parens-as-args
Enabled: true
Lint/AmbiguousRegexpLiteral:
Description: Checks for ambiguous regexp literals in the first argument of a method
invocation without parenthesis.
Enabled: false
Lint/AssignmentInCondition:
Description: Don't use assignment in conditions.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#safe-assignment-in-condition
Enabled: true
AllowSafeAssignment: false
Lint/BigDecimalNew:
Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
Enabled: false
Lint/BooleanSymbol:
Enabled: false
Lint/CircularArgumentReference:
Description: Don't refer to the keyword argument in the default value.
Enabled: false
Lint/Debugger:
Description: Check for debugger calls.
Enabled: true
# Supports --auto-correct
Lint/DeprecatedClassMethods:
Description: Check for deprecated class method calls.
Enabled: false
Lint/DuplicateCaseCondition:
Enabled: false
Lint/DuplicateMethods:
Description: Check for duplicate methods calls.
Enabled: true
Lint/DuplicateHashKey:
Description: Check for duplicate keys in hash literals.
Enabled: true
Lint/EachWithObjectArgument:
Description: Check for immutable argument given to each_with_object.
Enabled: false
Lint/ElseLayout:
Description: Check for odd code arrangement in an else block.
Enabled: true
Lint/EmptyEnsure:
Description: Checks for empty ensure block.
Enabled: false
Lint/EmptyInterpolation:
Description: Checks for empty string interpolation.
Enabled: true
Lint/EmptyWhen:
Enabled: false
Lint/EnsureReturn:
Description: Do not use return in an ensure block.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-return-ensure
Enabled: false
Lint/ErbNewArguments:
Enabled: false
Lint/FlipFlop:
Description: Checks for flip flops
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-flip-flops
Enabled: false
Lint/FloatOutOfRange:
Description: Catches floating-point literals too large or small for Ruby to represent.
Enabled: false
Lint/FormatParameterMismatch:
Description: The number of parameters to format/sprint must match the fields.
Enabled: true
Lint/SuppressedException:
Description: Don't suppress exception.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#dont-hide-exceptions
Enabled: false
Lint/ImplicitStringConcatenation:
Description: Checks for adjacent string literals on the same line, which could better
be represented as a single string literal.
Enabled: true
Lint/IneffectiveAccessModifier:
Description: Checks for attempts to use `private` or `protected` to set the visibility
of a class method, which does not work.
Enabled: true
Lint/InheritException:
Enabled: true
# The default base class in favour of `Exception`.
EnforcedStyle: standard_error
Lint/InterpolationCheck:
Enabled: false
Lint/LiteralAsCondition:
Description: Checks of literals used in conditions.
Enabled: false
# Supports --auto-correct
Lint/LiteralInInterpolation:
Description: Avoid interpolating literals in strings
Enabled: false
AutoCorrect: false
Lint/Loop:
Description: Use Kernel#loop with break rather than begin/end/until or begin/end/while
for post-loop tests.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#loop-with-break
Enabled: false
Lint/MissingCopEnableDirective:
# Maximum number of consecutive lines the cop can be disabled for.
# 0 allows only single-line disables
# 1 would mean the maximum allowed is the following:
# # rubocop:disable SomeCop
# a = 1
# # rubocop:enable SomeCop
# .inf for any size
MaximumRangeSize: .inf
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`'
Enabled: true
Lint/MissingSuper:
Enabled: false
Lint/MultipleComparison:
Enabled: false
Lint/NestedMethodDefinition:
Description: Do not use nested method definitions.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-nested-methods
Enabled: false
Lint/NextWithoutAccumulator:
Enabled: false
Lint/NonLocalExitFromIterator:
Description: Do not use return in iterator to cause non-local exit.
Enabled: false
Lint/OrderedMagicComments:
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
Enabled: true
Lint/ParenthesesAsGroupedExpression:
Description: Checks for method calls with a space before the opening parenthesis.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#parens-no-spaces
Enabled: true
Lint/PercentStringArray:
Description: >-
Checks for unwanted commas and quotes in %w/%W literals.
Enabled: true
Lint/PercentSymbolArray:
Enabled: false
Lint/RandOne:
Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely
a mistake.
Enabled: true
Lint/RedundantWithIndex:
Enabled: false
Lint/RedundantWithObject:
Enabled: false
Lint/RegexpAsCondition:
Enabled: false
Lint/RequireParentheses:
Description: Use parentheses in the method call to avoid confusion about precedence.
Enabled: true
Lint/RescueException:
Description: Avoid rescuing the Exception class.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-blind-rescues
Enabled: true
Lint/RescueType:
Enabled: false
Lint/ReturnInVoidContext:
Enabled: false
Lint/SafeNavigationChain:
Enabled: false
Lint/SafeNavigationConsistency:
Enabled: false
Lint/ScriptPermission:
Enabled: false
Lint/ShadowedArgument:
Description: 'Avoid reassigning arguments before they were used.'
Enabled: true
Lint/ShadowedException:
Description: >-
Avoid rescuing a higher level exception
before a lower level exception.
Enabled: false
Lint/ShadowingOuterLocalVariable:
Description: Do not use the same name as outer local variable for block arguments
or block local variables.
Enabled: true
# Supports --auto-correct
Lint/RedundantStringCoercion:
Description: Checks for Object#to_s usage in string interpolation.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#no-to-s
Enabled: true
Lint/UnderscorePrefixedVariableName:
Description: Do not use prefix `_` for a variable that is used.
Enabled: false
Lint/UnifiedInteger:
Enabled: false
Lint/RedundantCopDisableDirective:
Description: >-
Checks for rubocop:disable comments that can be removed.
Note: this cop is not disabled when disabling all cops. It must be explicitly disabled.
Enabled: true
Lint/RedundantCopEnableDirective:
Description: Checks for rubocop:enable comments that can be removed.
Enabled: true
Lint/RedundantRequireStatement:
Enabled: false
Lint/RedundantSplatExpansion:
Enabled: false
Lint/UnreachableCode:
Description: Unreachable code.
Enabled: false
# Supports --auto-correct
Lint/UnusedBlockArgument:
Description: Checks for unused block arguments.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#underscore-unused-vars
Enabled: false
# Supports --auto-correct
Lint/UnusedMethodArgument:
Description: Checks for unused method arguments.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#underscore-unused-vars
Enabled: false
Lint/UriEscapeUnescape:
Enabled: false
Lint/UriRegexp:
Enabled: false
Lint/UselessAccessModifier:
Description: Checks for useless access modifiers.
Enabled: true
Lint/UselessAssignment:
Description: Checks for useless assignment to a local variable.
StyleGuide: https://github.com/rubocop-hq/ruby-style-guide#underscore-unused-vars
Enabled: true
Lint/BinaryOperatorWithIdenticalOperands:
Description: Checks for comparison of something with itself.
Enabled: true
Lint/UselessElseWithoutRescue:
Description: Checks for useless `else` in `begin..end` without `rescue`.
Enabled: true
Lint/UselessSetterCall:
Description: Checks for useless setter call to a local variable.
Enabled: true
Lint/Void:
Description: Possible use of operator/literal/variable in void context.
Enabled: false