This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.yml
371 lines (273 loc) · 8.55 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
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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
require:
- rubocop-rspec
- rubocop-performance
AllCops:
DisabledByDefault: true
DisplayCopNames: true
DisplayStyleGuide: true
Exclude:
- 'app/assets/**/*'
- '**/node_modules/**/*'
- 'yarn*'
- 'loader*'
- 'webpack*'
- 'gems/**/*'
- 'vendor/**/*'
# ------------------------------------ Bundler -------------------------------------------
Bundler/DuplicatedGem:
Enabled: true
# ------------------------------------ /Bundler ------------------------------------------
# ------------------------------------ Rspec/FactoryBot ----------------------------------
FactoryBot/AttributeDefinedStatically:
Description: 'Check for deprecated factory attribute assignments.'
Enabled: true
# ------------------------------------ /Rspec/FactoryBot ---------------------------------
# ------------------------------------ Lints ---------------------------------------------
Layout/BlockAlignment:
Enabled: true
Lint/CircularArgumentReference:
Enabled: true
Lint/Debugger:
Description: 'Check for `debugger` or `binding.pry` statements left in.'
Enabled: true
Exclude:
- bin/scripts/datacheck.rb
- spec/support/capybara.rb # Optional debugging tool not hit in regular codepaths
Lint/DeprecatedClassMethods:
Description: 'Check for deprecated class method calls.'
Enabled: true
Lint/DuplicateHashKey:
Description: 'Check for duplicate keys in hash literals.'
Enabled: true
Lint/DuplicateMethods:
Description: 'Check for duplicate method definitions.'
Enabled: true
Lint/EachWithObjectArgument:
Description: 'Check for immutable argument given to each_with_object.'
Enabled: true
Lint/ElseLayout:
Description: 'Check for odd code arrangement in an else block.'
Enabled: true
Lint/EmptyEnsure:
Description: 'Checks for empty ensure block.'
Enabled: true
Lint/EmptyInterpolation:
Description: 'Checks for empty string interpolation.'
Enabled: true
Style/EndBlock:
Description: 'END blocks should not be placed inside method definitions.'
Enabled: true
Lint/EnsureReturn:
Description: 'Do not use return in an ensure block.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
Enabled: true
Lint/FlipFlop:
Enabled: true
Lint/FloatOutOfRange:
Description: >-
Catches floating-point literals too large or small for Ruby to
represent.
Enabled: true
Lint/FormatParameterMismatch:
Description: 'The number of parameters to format/sprint must match the fields.'
Enabled: true
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/InheritException:
Description: 'Avoid inheriting from the `Exception` class.'
Enabled: true
Lint/LiteralInInterpolation:
Description: 'Checks for literals used in interpolation.'
Enabled: true
Lint/Loop:
Enabled: true
Lint/NestedMethodDefinition:
Description: 'Do not use nested method definitions.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
Enabled: true
Lint/NextWithoutAccumulator:
Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` block.
Enabled: true
Lint/PercentStringArray:
Description: "Checks for unwanted commas and quotes in %w/%W literals."
Enabled: true
Lint/PercentSymbolArray:
Description: "Checks for unwanted commas and colons in %i/%I literals."
Enabled: true
Lint/RandOne:
Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely a mistake.
Enabled: true
Lint/RescueException:
Description: 'Avoid rescuing the Exception class.'
StyleGuide: 'https://github.com/github/rubocop-github/blob/master/STYLEGUIDE.md#exceptions'
Enabled: true
Lint/ShadowedException:
Description: Avoid rescuing a higher level exception before a lower level exception.
Enabled: true
Lint/RedundantStringCoercion:
Enabled: true
Lint/UnderscorePrefixedVariableName:
Enabled: true
Lint/RedundantSplatExpansion:
Enabled: true
Layout/IndentationConsistency:
Description: Checks for inconsistent indentation.
Enabled: true
StyleGuide: 'https://rubystyle.guide#spaces-indentation'
EnforcedStyle: indented_internal_methods
Lint/UnreachableCode:
Description: 'Unreachable code.'
Enabled: true
Exclude:
- spec/lib/ut/cache_backed_mutex_spec.rb # Not truly unreachable
Lint/UnusedMethodArgument:
Description: 'Checks for unused method arguments.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
Enabled: true
Exclude:
- app/smart/**/*.rb # Smart does this by design w/ example resources
- app/decorators/**/*.rb # to_json(*args) shouldn't trigger this
Lint/BinaryOperatorWithIdenticalOperands:
Description: 'This cop checks for places where binary operator has identical operands.'
Enabled: false
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:
Enabled: true
# ------------------------------------ /Lints -------------------------------------------
# ------------------------------------ Style --------------------------------------------
Style/ArrayJoin:
Enabled: true
Naming/AsciiIdentifiers:
Enabled: true
Style/BeginBlock:
Enabled: true
Style/BlockComments:
Enabled: true
Layout/BlockEndNewline:
Enabled: true
Style/CaseEquality:
Enabled: true
Style/CharacterLiteral:
Enabled: true
Naming/ClassAndModuleCamelCase:
Enabled: true
Style/ClassMethods:
Enabled: true
Style/DefWithParentheses:
Enabled: true
Layout/EndOfLine:
Enabled: true
Naming/FileName:
Enabled: true
ExpectMatchingDefinition: false
IgnoreExecutableScripts: true
Style/For:
Enabled: true
Style/FrozenStringLiteralComment:
Enabled: true
Layout/InitialIndentation:
Enabled: true
Style/LambdaCall:
Enabled: true
Style/MethodCallWithoutArgsParentheses:
Enabled: true
Style/MethodDefParentheses:
Enabled: true
Naming/MethodName:
Enabled: true
EnforcedStyle: snake_case
Exclude:
- spec/support/fresh_eyes_shared_code.rb #TesterA/TesterB makes sense
Style/MultilineIfThen:
Enabled: true
Style/NilComparison:
Enabled: true
Style/Not:
Enabled: true
Style/OneLineConditional:
Enabled: true
Style/RedundantSortBy:
Enabled: true
Style/Sample:
Enabled: true
Layout/SpaceAfterColon:
Enabled: true
Layout/SpaceAfterComma:
Enabled: true
Layout/SpaceAfterMethodName:
Enabled: true
Layout/SpaceAfterNot:
Enabled: true
Layout/SpaceAfterSemicolon:
Enabled: true
Layout/SpaceAroundBlockParameters:
Enabled: true
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
Layout/SpaceInsideArrayPercentLiteral:
Enabled: true
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: true
Layout/SpaceInsideReferenceBrackets:
Enabled: true
Layout/SpaceInsideParens:
Enabled: true
Layout/SpaceInsideRangeLiteral:
Enabled: true
Style/StabbyLambdaParentheses:
Enabled: true
Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes
Style/Strip:
Enabled: true
Style/StructInheritance:
Description: 'Checks for inheritance from Struct.new.'
StyleGuide: '#no-extend-struct-new'
Enabled: true
Layout/IndentationStyle:
Enabled: true
Layout/TrailingEmptyLines:
Enabled: true
EnforcedStyle: final_newline
Layout/TrailingWhitespace:
Enabled: true
Layout/ConditionPosition:
Description: Checks for condition placed in a confusing position relative to the keyword.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
Enabled: true
Layout/DefEndAlignment:
Description: "Makes sure def/ends line up"
Enabled: true
# ------------------------------------ /Style --------------------------------------------
# ------------------------------------ Performance -----------------------------------------
Performance/Count:
Enabled: true
Performance/Detect:
Enabled: true
Performance/DoubleStartEndWith:
Enabled: true
Performance/EndWith:
Enabled: true
Performance/FlatMap:
Enabled: true
Performance/RedundantMerge:
Enabled: true
MaxKeyValuePairs: 1
Performance/ReverseEach:
Enabled: true
Performance/Size:
Enabled: true
Performance/StartWith:
Enabled: true
# ------------------------------------ /Performance -----------------------------------------
# ------------------------------------ Security ---------------------------------------------
Security/Eval:
Enabled: true
# ------------------------------------ /Security --------------------------------------------