-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.rubocop.yml
687 lines (687 loc) · 14.9 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
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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
Exclude:
- vendor/**/*
- db/schema.rb
- node_modules/**/*
- tmp/**/*
- lib/prod_util/*
- lib/tasks/one_offs/**/*
- lib/tasks/tests.rake
- app/migrators/**/*
- lib/google/apis/**/*
- bin/*
- '*/bin/*'
- Rakefile
- config.ru
- '*/config.ru'
- '*legacy*'
- config/initializers/monkey_patches/**/*
- db/seeds/**/*
- app/assets/**/*
- public/assets/**/*
- "spec/factories/**/*"
- "spec/fixtures/**/*"
- "*/spec/fixtures/**/*"
- '*.gem'
NewCops: enable
Bundler/OrderedGems:
Enabled: false
Gemspec/OrderedDependencies:
Enabled: false
Layout/AccessModifierIndentation:
Enabled: true
Layout/ArgumentAlignment:
Enabled: false
Layout/ArrayAlignment:
Enabled: true
Layout/AssignmentIndentation:
Enabled: true
Layout/BeginEndAlignment:
Enabled: false
Layout/BlockAlignment:
Enabled: false # Because the auto-corrector seems to mess this up some times.
Layout/BlockEndNewline:
Enabled: true
Layout/CaseIndentation:
Enabled: false # Because the auto-corrector seems to mess this up some times.
Layout/ClosingHeredocIndentation:
Enabled: true
Layout/ClosingParenthesisIndentation:
Enabled: true
Layout/CommentIndentation:
Enabled: true
Layout/DefEndAlignment:
Enabled: true
Layout/DotPosition:
Enabled: true
Layout/ElseAlignment:
Enabled: true
Layout/EmptyLineAfterGuardClause:
Enabled: true
Layout/EmptyLineAfterMagicComment:
Enabled: true
Layout/EmptyLineBetweenDefs:
Enabled: true
Layout/EmptyLines:
Enabled: true
Layout/EmptyLinesAroundAccessModifier:
Enabled: true
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/EmptyLinesAroundBeginBody:
Enabled: true
Layout/EmptyLinesAroundBlockBody:
Enabled: true
Layout/EmptyLinesAroundClassBody:
Enabled: true
Layout/EmptyLinesAroundExceptionHandlingKeywords:
Enabled: true
Layout/EmptyLinesAroundMethodBody:
Enabled: true
Layout/EmptyLinesAroundModuleBody:
Enabled: true
Layout/EndAlignment:
Enabled: true
Layout/EndOfLine:
Enabled: true
Layout/ExtraSpacing:
Enabled: true
Layout/FirstArgumentIndentation:
Enabled: true
Layout/FirstArrayElementIndentation:
Enabled: true
Layout/FirstHashElementIndentation:
Enabled: false
Layout/FirstParameterIndentation:
Enabled: true
Layout/HashAlignment:
Enabled: false
Layout/HeredocArgumentClosingParenthesis:
Enabled: true
Layout/HeredocIndentation:
Enabled: false
Layout/IndentationConsistency:
Enabled: true
Layout/IndentationWidth:
Enabled: false
Layout/InitialIndentation:
Enabled: true
Layout/LeadingCommentSpace:
Enabled: true
Layout/LeadingEmptyLines:
Enabled: true
Layout/LineLength:
AllowedPatterns:
- ^\s*#
- ^\s*([a-zA-Z]*[lL]og[a-zA-Z]*)[ (]
- ^\s*['"]
- .*#.{30,300}
- ^\s*[a-z_]:\s*".+",?[}\s]*$
Max: 200
Exclude:
- '*/spec/**/*.rb '# Nicer to have sample data on a single long line
- 'spec/**/*.rb'
Layout/LineContinuationLeadingSpace:
Enabled: true
Exclude:
- '*/spec/**/*.rb ' # Just a pain for specs that contain lots of sample data.
- 'spec/**/*.rb'
Layout/MultilineArrayBraceLayout:
Enabled: false
Layout/MultilineAssignmentLayout:
Enabled: false
Layout/MultilineBlockLayout:
Enabled: false
Layout/MultilineHashBraceLayout:
Enabled: false
Layout/MultilineMethodCallBraceLayout:
Enabled: false
Layout/MultilineMethodCallIndentation:
Enabled: false
Layout/MultilineMethodDefinitionBraceLayout:
Enabled: false
Layout/MultilineOperationIndentation:
Enabled: false
Layout/ParameterAlignment:
Enabled: false
Layout/RescueEnsureAlignment:
Enabled: false
Layout/SpaceAfterColon:
Enabled: true
Layout/SpaceAfterComma:
Enabled: true
Layout/SpaceAfterMethodName:
Enabled: true
Layout/SpaceAfterNot:
Enabled: false
Layout/SpaceAfterSemicolon:
Enabled: true
Layout/SpaceAroundBlockParameters:
Enabled: true
Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true
Layout/SpaceAroundKeyword:
Enabled: true
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Layout/SpaceAroundOperators:
Enabled: true
Layout/SpaceBeforeBlockBraces:
Enabled: false
Layout/SpaceBeforeComma:
Enabled: true
Layout/SpaceBeforeComment:
Enabled: true
Layout/SpaceBeforeFirstArg:
Enabled: true
Layout/SpaceBeforeSemicolon:
Enabled: true
Layout/SpaceInLambdaLiteral:
Enabled: false
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: true
Layout/SpaceInsideArrayPercentLiteral:
Enabled: true
Layout/SpaceInsideBlockBraces:
Enabled: true
Layout/SpaceInsideHashLiteralBraces:
Enabled: true
Layout/SpaceInsideParens:
Enabled: true
Layout/SpaceInsidePercentLiteralDelimiters:
Enabled: true
Layout/SpaceInsideRangeLiteral:
Enabled: true
Layout/SpaceInsideReferenceBrackets:
Enabled: true
Layout/SpaceInsideStringInterpolation:
EnforcedStyle: space
Layout/TrailingEmptyLines:
Enabled: true
Layout/TrailingWhitespace:
Enabled: true
Lint/AmbiguousRegexpLiteral:
Enabled: false
Lint/AmbiguousBlockAssociation:
Enabled: true
Exclude:
- '*/spec/**/*.rb' # Legit concern but it's too hard for us to solve existing problems
- 'spec/**/*.rb'
Lint/AssignmentInCondition:
Enabled: false
Lint/EmptyWhen:
Enabled: true
Lint/EmptyBlock:
Enabled: true
Exclude:
- '*/spec/**/*.rb' # Empty let blocks are useful in specs
- 'spec/**/*.rb'
Lint/Loop:
Enabled: true
Lint/NonLocalExitFromIterator:
Enabled: false
Lint/RedundantCopDisableDirective:
Enabled: true
Lint/RescueException:
Enabled: true
Lint/SuppressedException:
Enabled: true
Lint/UnusedBlockArgument:
Enabled: true
Lint/UnusedMethodArgument:
Enabled: true
Lint/Void:
Enabled: true
Exclude:
- '*/spec/**/*.rb' # Sometimes we need to call a variable to trigger the "let" action.
- 'spec/**/*.rb'
Metrics/AbcSize:
Enabled: false
Max: 60
Metrics/BlockLength:
Exclude:
- Rakefile
- '**/*.rake'
- config/routes.rb
- '*/spec/**/*.rb' # Some blocks can be really long with sample data
- 'spec/**/*.rb'
Max: 200
Metrics/BlockNesting:
Enabled: true
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Max: 60
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
Enabled: true
Max: 7
Metrics/PerceivedComplexity:
Enabled: false
Naming/AccessorMethodName:
Enabled: true
Naming/BinaryOperatorParameterName:
Enabled: true
Naming/BlockParameterName:
Enabled: true
Naming/ConstantName:
Enabled: true
Naming/FileName:
Enabled: true
Naming/HeredocDelimiterNaming:
Enabled: true
Naming/MemoizedInstanceVariableName:
Enabled: false
Naming/MethodName:
Enabled: true
Naming/MethodParameterName:
Enabled: true
Naming/PredicateName:
Enabled: false
Naming/RescuedExceptionsVariableName:
Enabled: true
Naming/VariableName:
Enabled: true
Naming/VariableNumber:
Enabled: false
Security/Eval:
Enabled: true
Security/MarshalLoad:
Enabled: true
Security/YAMLLoad:
Enabled: true
Style/AccessModifierDeclarations:
Enabled: true
Style/AccessorGrouping:
Enabled: true
Style/Alias:
Enabled: true
EnforcedStyle: prefer_alias_method
Style/AndOr:
Enabled: true
Style/ArrayCoercion:
Enabled: true
Style/ArrayJoin:
Enabled: true
Style/AsciiComments:
Enabled: false
Style/Attr:
Enabled: true
Style/AutoResourceCleanup:
Enabled: true
Style/BarePercentLiterals:
Enabled: true
Style/BeginBlock:
Enabled: true
Style/BisectedAttrAccessor:
Enabled: true
Style/BlockComments:
Enabled: true
Style/BlockDelimiters:
Enabled: true
Exclude:
- '*/spec/**/*.rb' # Curly braces are more common for spec let statements and factories
- 'spec/**/*.rb'
Style/CaseEquality:
Enabled: true
Style/CaseLikeIf:
Enabled: false
Style/CharacterLiteral:
Enabled: true
Style/ClassAndModuleChildren:
Enabled: true
Style/ClassCheck:
Enabled: true
Style/ClassMethods:
Enabled: true
Style/ClassVars:
Enabled: true
Style/CollectionMethods:
Enabled: true
Style/ColonMethodCall:
Enabled: true
Style/ColonMethodDefinition:
Enabled: true
Style/CommandLiteral:
Enabled: true
Style/CommentAnnotation:
Enabled: false
Style/CommentedKeyword:
Enabled: false
Style/ConditionalAssignment:
Enabled: true
Style/ConstantVisibility:
Enabled: false
Style/Copyright:
Enabled: false
Style/DateTime:
Enabled: true
Style/DefWithParentheses:
Enabled: true
Style/Dir:
Enabled: true
Style/DisableCopsWithinSourceCodeDirective:
Enabled: false
Style/Documentation:
Enabled: false
Style/DocumentationMethod:
Enabled: false
Style/DoubleCopDisableDirective:
Enabled: true
Style/DoubleNegation:
Enabled: true
Style/EachForSimpleLoop:
Enabled: true
Style/EachWithObject:
Enabled: true
Style/EmptyBlockParameter:
Enabled: true
Style/EmptyCaseCondition:
Enabled: true
Style/EmptyElse:
Enabled: true
AllowComments: true # When a comment is there then it means the programmer thought about the case so we can ignore it.
EnforcedStyle: empty # When a comment or nil is there it means the programmer thought about the case, so there is no need for concern
Style/EmptyLambdaParameter:
Enabled: true
Style/EmptyLiteral:
Enabled: true
Style/EmptyMethod:
Enabled: true
Style/Encoding:
Enabled: true
Style/EndBlock:
Enabled: true
Style/EvalWithLocation:
Enabled: true
Style/EvenOdd:
Enabled: true
Style/ExpandPathArguments:
Enabled: true
Style/ExplicitBlockArgument:
Enabled: true
Style/ExponentialNotation:
Enabled: true
Style/FloatDivision:
Enabled: false
Style/For:
Enabled: true
Style/FormatString:
Enabled: true
Style/FormatStringToken:
Enabled: true
Style/FrozenStringLiteralComment:
Enabled: false
Style/GlobalStdStream:
Enabled: true
Style/GlobalVars:
Enabled: false
Style/GuardClause:
Enabled: false
Style/HashAsLastArrayItem:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashLikeCase:
Enabled: true
Style/HashSyntax:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
Style/IdenticalConditionalBranches:
Enabled: true
Style/IfInsideElse:
Enabled: true
Style/IfUnlessModifier:
Enabled: false
Style/IfUnlessModifierOfIfUnless:
Enabled: true
Style/IfWithSemicolon:
Enabled: true
Style/ImplicitRuntimeError:
Enabled: false
Style/InfiniteLoop:
Enabled: true
Style/InlineComment:
Enabled: false
Style/InverseMethods:
Enabled: true
Style/IpAddresses:
Enabled: false # This is obvious and should be caught in the PR if not OK.
Style/Lambda:
Enabled: false
Style/LambdaCall:
Enabled: false
Style/LineEndConcatenation:
Enabled: true
Style/MapToHash:
Enabled: false
Style/MethodCallWithArgsParentheses:
Enabled: false
Style/MethodCallWithoutArgsParentheses:
Enabled: true
Style/MethodCalledOnDoEndBlock:
Enabled: false
Style/MethodDefParentheses:
Enabled: true
Style/MinMax:
Enabled: true
Style/MissingElse:
Enabled: false
Style/MissingRespondToMissing:
Enabled: true
Style/MixinGrouping:
Enabled: true
Style/ModuleFunction:
Enabled: true
Style/MultilineBlockChain:
Enabled: false
Style/MultilineIfModifier:
Enabled: true
Style/MultilineIfThen:
Enabled: true
Style/MultilineMemoization:
Enabled: true
Style/MultilineMethodSignature:
Enabled: true
Style/MultilineTernaryOperator:
Enabled: true
Style/MultilineWhenThen:
Enabled: true
Style/MultipleComparison:
Enabled: true
Style/MutableConstant:
Enabled: false
Style/NegatedIf:
Enabled: true
Style/NegatedUnless:
Enabled: true
Style/NegatedWhile:
Enabled: true
Style/NestedModifier:
Enabled: true
Style/NestedParenthesizedCalls:
Enabled: true
Style/NestedTernaryOperator:
Enabled: true
Style/Next:
Enabled: true
Style/NilComparison:
Enabled: true
Style/NonNilCheck:
Enabled: true
Style/Not:
Enabled: true
Style/NumericLiteralPrefix:
Enabled: true
Style/NumericLiterals:
Enabled: true
Style/NumericPredicate:
Enabled: false
Style/OneLineConditional:
Enabled: true
Style/OpenStructUse:
Enabled: false
Style/OptionHash:
Enabled: false
Style/OptionalArguments:
Enabled: true
Style/OptionalBooleanParameter:
Enabled: false
Style/OrAssignment:
Enabled: true
Style/ParallelAssignment:
Enabled: true
Style/ParenthesesAroundCondition:
Enabled: true
Style/PercentLiteralDelimiters:
Enabled: true
Style/PercentQLiterals:
Enabled: true
Style/PerlBackrefs:
Enabled: true
Style/PreferredHashMethods:
Enabled: true
Style/Proc:
Enabled: true
Style/RaiseArgs:
Enabled: true
Style/RandomWithOffset:
Enabled: true
Style/RedundantAssignment:
Enabled: true
Style/RedundantBegin:
Enabled: true
Style/RedundantCapitalW:
Enabled: true
Style/RedundantCondition:
Enabled: true
Style/RedundantConditional:
Enabled: true
Style/RedundantException:
Enabled: true
Style/RedundantFetchBlock:
Enabled: true
Style/RedundantFileExtensionInRequire:
Enabled: true
Style/RedundantFreeze:
Enabled: true
Style/RedundantInterpolation:
Enabled: true
Style/RedundantParentheses:
Enabled: true
Style/RedundantPercentQ:
Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: false
Style/RedundantRegexpEscape:
Enabled: false
Style/RedundantReturn:
Enabled: true
Style/RedundantSelf:
Enabled: false
Style/RedundantSort:
Enabled: true
Style/RedundantSortBy:
Enabled: true
Style/RegexpLiteral:
Enabled: false
Style/RescueModifier:
Enabled: true
Style/RescueStandardError:
Enabled: true
Style/ReturnNil:
Enabled: false
Style/SafeNavigation:
Enabled: true
Style/Sample:
Enabled: true
Style/SelfAssignment:
Enabled: true
Style/Semicolon:
Enabled: true
Style/Send:
Enabled: false
Style/SignalException:
Enabled: true
Style/SingleArgumentDig:
Enabled: true
Style/SingleLineBlockParams:
Enabled: true
Style/SingleLineMethods:
Enabled: false
Style/SlicingWithRange:
Enabled: true
Style/SpecialGlobalVars:
Enabled: true
Style/StabbyLambdaParentheses:
Enabled: true
Style/StderrPuts:
Enabled: true
Style/StringConcatenation:
Enabled: true
Style/StringLiterals:
Enabled: false
Style/StringLiteralsInInterpolation:
Enabled: true
Style/StringMethods:
Enabled: true
Style/Strip:
Enabled: true
Style/StructInheritance:
Enabled: true
Style/SymbolArray:
Enabled: false
Style/SymbolLiteral:
Enabled: true
Style/SymbolProc:
Enabled: true
Style/TernaryParentheses:
Enabled: false
Style/TrailingBodyOnClass:
Enabled: true
Style/TrailingBodyOnMethodDefinition:
Enabled: true
Style/TrailingBodyOnModule:
Enabled: true
Style/TrailingCommaInArguments:
Enabled: true
Style/TrailingCommaInArrayLiteral:
Enabled: true
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInBlockArgs:
Enabled: true
Style/TrailingCommaInHashLiteral:
Enabled: true
EnforcedStyleForMultiline: consistent_comma # It makes managing hashes much easier when we have commas at the end
Style/TrailingMethodEndStatement:
Enabled: true
Style/TrailingUnderscoreVariable:
Enabled: true
Style/TrivialAccessors:
Enabled: true
Style/UnlessElse:
Enabled: true
Style/UnpackFirst:
Enabled: true
Style/VariableInterpolation:
Enabled: true
Style/WhenThen:
Enabled: true
Style/WhileUntilDo:
Enabled: true
Style/WhileUntilModifier:
Enabled: true
Style/WordArray:
Enabled: true
Style/YodaCondition:
Enabled: true
Style/ZeroLengthPredicate:
Enabled: false