gatemedia_rubocop 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1746 @@
1
+ # These are all the cops that are enabled in the default configuration.
2
+
3
+ #################### Layout ###############################
4
+
5
+ Layout/AccessModifierIndentation:
6
+ Description: Check indentation of private/protected visibility modifiers.
7
+ StyleGuide: '#indent-public-private-protected'
8
+ Enabled: true
9
+
10
+ Layout/AlignArray:
11
+ Description: >-
12
+ Align the elements of an array literal if they span more than
13
+ one line.
14
+ StyleGuide: '#align-multiline-arrays'
15
+ Enabled: true
16
+
17
+ Layout/AlignHash:
18
+ Description: >-
19
+ Align the elements of a hash literal if they span more than
20
+ one line.
21
+ Enabled: true
22
+
23
+ Layout/AlignParameters:
24
+ Description: >-
25
+ Align the parameters of a method call if they span more
26
+ than one line.
27
+ StyleGuide: '#no-double-indent'
28
+ Enabled: true
29
+
30
+ Layout/BlockEndNewline:
31
+ Description: 'Put end statement of multiline block on its own line.'
32
+ Enabled: true
33
+
34
+ Layout/CaseIndentation:
35
+ Description: 'Indentation of when in a case/when/[else/]end.'
36
+ StyleGuide: '#indent-when-to-case'
37
+ Enabled: true
38
+
39
+ Layout/ClosingParenthesisIndentation:
40
+ Description: 'Checks the indentation of hanging closing parentheses.'
41
+ Enabled: true
42
+
43
+ Layout/CommentIndentation:
44
+ Description: 'Indentation of comments.'
45
+ Enabled: true
46
+
47
+ Layout/DotPosition:
48
+ Description: 'Checks the position of the dot in multi-line method calls.'
49
+ StyleGuide: '#consistent-multi-line-chains'
50
+ Enabled: true
51
+
52
+ Layout/ElseAlignment:
53
+ Description: 'Align elses and elsifs correctly.'
54
+ Enabled: true
55
+
56
+ Layout/EmptyLineBetweenDefs:
57
+ Description: 'Use empty lines between defs.'
58
+ StyleGuide: '#empty-lines-between-methods'
59
+ Enabled: true
60
+
61
+ Layout/EmptyLines:
62
+ Description: "Don't use several empty lines in a row."
63
+ StyleGuide: '#two-or-more-empty-lines'
64
+ Enabled: true
65
+
66
+ Layout/EmptyLinesAroundAccessModifier:
67
+ Description: "Keep blank lines around access modifiers."
68
+ StyleGuide: '#empty-lines-around-access-modifier'
69
+ Enabled: true
70
+
71
+ Layout/EmptyLinesAroundBeginBody:
72
+ Description: "Keeps track of empty lines around begin-end bodies."
73
+ StyleGuide: '#empty-lines-around-bodies'
74
+ Enabled: true
75
+
76
+ Layout/EmptyLinesAroundBlockBody:
77
+ Description: "Keeps track of empty lines around block bodies."
78
+ StyleGuide: '#empty-lines-around-bodies'
79
+ Enabled: true
80
+
81
+ Layout/EmptyLinesAroundClassBody:
82
+ Description: "Keeps track of empty lines around class bodies."
83
+ StyleGuide: '#empty-lines-around-bodies'
84
+ Enabled: true
85
+
86
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
87
+ Description: "Keeps track of empty lines around exception handling keywords."
88
+ StyleGuide: '#empty-lines-around-bodies'
89
+ Enabled: true
90
+
91
+ Layout/EmptyLinesAroundModuleBody:
92
+ Description: "Keeps track of empty lines around module bodies."
93
+ StyleGuide: '#empty-lines-around-bodies'
94
+ Enabled: true
95
+
96
+ Layout/EmptyLinesAroundMethodBody:
97
+ Description: "Keeps track of empty lines around method bodies."
98
+ StyleGuide: '#empty-lines-around-bodies'
99
+ Enabled: true
100
+
101
+ Layout/EndOfLine:
102
+ Description: 'Use Unix-style line endings.'
103
+ StyleGuide: '#crlf'
104
+ Enabled: true
105
+
106
+ Layout/ExtraSpacing:
107
+ Description: 'Do not use unnecessary spacing.'
108
+ Enabled: true
109
+
110
+ Layout/InitialIndentation:
111
+ Description: >-
112
+ Checks the indentation of the first non-blank non-comment line in a file.
113
+ Enabled: true
114
+
115
+ Layout/FirstParameterIndentation:
116
+ Description: 'Checks the indentation of the first parameter in a method call.'
117
+ Enabled: true
118
+
119
+ Layout/IndentationConsistency:
120
+ Description: 'Keep indentation straight.'
121
+ StyleGuide: '#spaces-indentation'
122
+ Enabled: true
123
+
124
+ Layout/IndentationWidth:
125
+ Description: 'Use 2 spaces for indentation.'
126
+ StyleGuide: '#spaces-indentation'
127
+ Enabled: true
128
+
129
+ Layout/IndentArray:
130
+ Description: >-
131
+ Checks the indentation of the first element in an array
132
+ literal.
133
+ Enabled: true
134
+
135
+ Layout/IndentAssignment:
136
+ Description: >-
137
+ Checks the indentation of the first line of the
138
+ right-hand-side of a multi-line assignment.
139
+ Enabled: true
140
+
141
+ Layout/IndentHash:
142
+ Description: 'Checks the indentation of the first key in a hash literal.'
143
+ Enabled: true
144
+
145
+ Layout/IndentHeredoc:
146
+ Description: 'This cops checks the indentation of the here document bodies.'
147
+ StyleGuide: '#squiggly-heredocs'
148
+ Enabled: true
149
+
150
+ Layout/SpaceInLambdaLiteral:
151
+ Description: 'Checks for spaces in lambda literals.'
152
+ Enabled: true
153
+
154
+ Layout/LeadingCommentSpace:
155
+ Description: 'Comments should start with a space.'
156
+ StyleGuide: '#hash-space'
157
+ Enabled: true
158
+
159
+ Layout/MultilineArrayBraceLayout:
160
+ Description: >-
161
+ Checks that the closing brace in an array literal is
162
+ either on the same line as the last array element, or
163
+ a new line.
164
+ Enabled: true
165
+
166
+ Layout/MultilineBlockLayout:
167
+ Description: 'Ensures newlines after multiline block do statements.'
168
+ Enabled: true
169
+
170
+ Layout/MultilineHashBraceLayout:
171
+ Description: >-
172
+ Checks that the closing brace in a hash literal is
173
+ either on the same line as the last hash element, or
174
+ a new line.
175
+ Enabled: true
176
+
177
+ Layout/MultilineMethodCallBraceLayout:
178
+ Description: >-
179
+ Checks that the closing brace in a method call is
180
+ either on the same line as the last method argument, or
181
+ a new line.
182
+ Enabled: true
183
+
184
+ Layout/MultilineMethodCallIndentation:
185
+ Description: >-
186
+ Checks indentation of method calls with the dot operator
187
+ that span more than one line.
188
+ Enabled: true
189
+
190
+ Layout/MultilineMethodDefinitionBraceLayout:
191
+ Description: >-
192
+ Checks that the closing brace in a method definition is
193
+ either on the same line as the last method parameter, or
194
+ a new line.
195
+ Enabled: true
196
+
197
+ Layout/MultilineOperationIndentation:
198
+ Description: >-
199
+ Checks indentation of binary operations that span more than
200
+ one line.
201
+ Enabled: true
202
+
203
+ Layout/EmptyLineAfterMagicComment:
204
+ Description: 'Add an empty line after magic comments to separate them from code.'
205
+ StyleGuide: '#separate-magic-comments-from-code'
206
+ Enabled: true
207
+
208
+ Layout/RescueEnsureAlignment:
209
+ Description: 'Align rescues and ensures correctly.'
210
+ Enabled: true
211
+
212
+ Layout/SpaceBeforeFirstArg:
213
+ Description: >-
214
+ Checks that exactly one space is used between a method name
215
+ and the first argument for method calls without parentheses.
216
+ Enabled: true
217
+
218
+ Layout/SpaceAfterColon:
219
+ Description: 'Use spaces after colons.'
220
+ StyleGuide: '#spaces-operators'
221
+ Enabled: true
222
+
223
+ Layout/SpaceAfterComma:
224
+ Description: 'Use spaces after commas.'
225
+ StyleGuide: '#spaces-operators'
226
+ Enabled: true
227
+
228
+ Layout/SpaceAfterMethodName:
229
+ Description: >-
230
+ Do not put a space between a method name and the opening
231
+ parenthesis in a method definition.
232
+ StyleGuide: '#parens-no-spaces'
233
+ Enabled: true
234
+
235
+ Layout/SpaceAfterNot:
236
+ Description: Tracks redundant space after the ! operator.
237
+ StyleGuide: '#no-space-bang'
238
+ Enabled: true
239
+
240
+ Layout/SpaceAfterSemicolon:
241
+ Description: 'Use spaces after semicolons.'
242
+ StyleGuide: '#spaces-operators'
243
+ Enabled: true
244
+
245
+ Layout/SpaceBeforeBlockBraces:
246
+ Description: >-
247
+ Checks that the left block brace has or doesn't have space
248
+ before it.
249
+ Enabled: true
250
+
251
+ Layout/SpaceBeforeComma:
252
+ Description: 'No spaces before commas.'
253
+ Enabled: true
254
+
255
+ Layout/SpaceBeforeComment:
256
+ Description: >-
257
+ Checks for missing space between code and a comment on the
258
+ same line.
259
+ Enabled: true
260
+
261
+ Layout/SpaceBeforeSemicolon:
262
+ Description: 'No spaces before semicolons.'
263
+ Enabled: true
264
+
265
+ Layout/SpaceInsideBlockBraces:
266
+ Description: >-
267
+ Checks that block braces have or don't have surrounding space.
268
+ For blocks taking parameters, checks that the left brace has
269
+ or doesn't have trailing space.
270
+ Enabled: true
271
+
272
+ Layout/SpaceAroundBlockParameters:
273
+ Description: 'Checks the spacing inside and after block parameters pipes.'
274
+ Enabled: true
275
+
276
+ Layout/SpaceAroundEqualsInParameterDefault:
277
+ Description: >-
278
+ Checks that the equals signs in parameter default assignments
279
+ have or don't have surrounding space depending on
280
+ configuration.
281
+ StyleGuide: '#spaces-around-equals'
282
+ Enabled: true
283
+
284
+ Layout/SpaceAroundKeyword:
285
+ Description: 'Use a space around keywords if appropriate.'
286
+ Enabled: true
287
+
288
+ Layout/SpaceAroundOperators:
289
+ Description: 'Use a single space around operators.'
290
+ StyleGuide: '#spaces-operators'
291
+ Enabled: true
292
+
293
+ Layout/SpaceInsideArrayPercentLiteral:
294
+ Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
295
+ Enabled: true
296
+
297
+ Layout/SpaceInsidePercentLiteralDelimiters:
298
+ Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
299
+ Enabled: true
300
+
301
+ Layout/SpaceInsideBrackets:
302
+ Description: 'No spaces after [ or before ].'
303
+ StyleGuide: '#no-spaces-braces'
304
+ Enabled: true
305
+
306
+ Layout/SpaceInsideHashLiteralBraces:
307
+ Description: "Use spaces inside hash literal braces - or don't."
308
+ StyleGuide: '#spaces-operators'
309
+ Enabled: true
310
+
311
+ Layout/SpaceInsideParens:
312
+ Description: 'No spaces after ( or before ).'
313
+ StyleGuide: '#no-spaces-braces'
314
+ Enabled: true
315
+
316
+ Layout/SpaceInsideRangeLiteral:
317
+ Description: 'No spaces inside range literals.'
318
+ StyleGuide: '#no-space-inside-range-literals'
319
+ Enabled: true
320
+
321
+ Layout/SpaceInsideStringInterpolation:
322
+ Description: 'Checks for padding/surrounding spaces inside string interpolation.'
323
+ StyleGuide: '#string-interpolation'
324
+ Enabled: true
325
+
326
+ Layout/Tab:
327
+ Description: 'No hard tabs.'
328
+ StyleGuide: '#spaces-indentation'
329
+ Enabled: true
330
+
331
+ Layout/TrailingBlankLines:
332
+ Description: 'Checks trailing blank lines and final newline.'
333
+ StyleGuide: '#newline-eof'
334
+ Enabled: true
335
+
336
+ Layout/TrailingWhitespace:
337
+ Description: 'Avoid trailing whitespace.'
338
+ StyleGuide: '#no-trailing-whitespace'
339
+ Enabled: true
340
+
341
+ #################### Style ###############################
342
+
343
+ Style/AccessorMethodName:
344
+ Description: Check the naming of accessor methods for get_/set_.
345
+ StyleGuide: '#accessor_mutator_method_names'
346
+ Enabled: true
347
+
348
+ Style/Alias:
349
+ Description: 'Use alias instead of alias_method.'
350
+ StyleGuide: '#alias-method'
351
+ Enabled: true
352
+
353
+ Style/AndOr:
354
+ Description: 'Use &&/|| instead of and/or.'
355
+ StyleGuide: '#no-and-or-or'
356
+ Enabled: true
357
+
358
+ Style/ArrayJoin:
359
+ Description: 'Use Array#join instead of Array#*.'
360
+ StyleGuide: '#array-join'
361
+ Enabled: true
362
+
363
+ Style/AsciiComments:
364
+ Description: 'Use only ascii symbols in comments.'
365
+ StyleGuide: '#english-comments'
366
+ Enabled: true
367
+
368
+ Style/AsciiIdentifiers:
369
+ Description: 'Use only ascii symbols in identifiers.'
370
+ StyleGuide: '#english-identifiers'
371
+ Enabled: true
372
+
373
+ Style/Attr:
374
+ Description: 'Checks for uses of Module#attr.'
375
+ StyleGuide: '#attr'
376
+ Enabled: true
377
+
378
+ Style/BeginBlock:
379
+ Description: 'Avoid the use of BEGIN blocks.'
380
+ StyleGuide: '#no-BEGIN-blocks'
381
+ Enabled: true
382
+
383
+ Style/BarePercentLiterals:
384
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
385
+ StyleGuide: '#percent-q-shorthand'
386
+ Enabled: true
387
+
388
+ Style/BlockComments:
389
+ Description: 'Do not use block comments.'
390
+ StyleGuide: '#no-block-comments'
391
+ Enabled: true
392
+
393
+ Style/BlockDelimiters:
394
+ Description: >-
395
+ Avoid using {...} for multi-line blocks (multiline chaining is
396
+ always ugly).
397
+ Prefer {...} over do...end for single-line blocks.
398
+ StyleGuide: '#single-line-blocks'
399
+ Enabled: true
400
+
401
+ Style/BracesAroundHashParameters:
402
+ Description: 'Enforce braces style around hash parameters.'
403
+ Enabled: true
404
+
405
+ Style/CaseEquality:
406
+ Description: 'Avoid explicit use of the case equality operator(===).'
407
+ StyleGuide: '#no-case-equality'
408
+ Enabled: true
409
+
410
+ Style/CharacterLiteral:
411
+ Description: 'Checks for uses of character literals.'
412
+ StyleGuide: '#no-character-literals'
413
+ Enabled: true
414
+
415
+ Style/ClassAndModuleCamelCase:
416
+ Description: 'Use CamelCase for classes and modules.'
417
+ StyleGuide: '#camelcase-classes'
418
+ Enabled: true
419
+
420
+ Style/ClassAndModuleChildren:
421
+ Description: 'Checks style of children classes and modules.'
422
+ Enabled: true
423
+
424
+ Style/ClassCheck:
425
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
426
+ Enabled: true
427
+
428
+ Style/ClassMethods:
429
+ Description: 'Use self when defining module/class methods.'
430
+ StyleGuide: '#def-self-class-methods'
431
+ Enabled: true
432
+
433
+ Style/ClassVars:
434
+ Description: 'Avoid the use of class variables.'
435
+ StyleGuide: '#no-class-vars'
436
+ Enabled: true
437
+
438
+ Style/ColonMethodCall:
439
+ Description: 'Do not use :: for method call.'
440
+ StyleGuide: '#double-colons'
441
+ Enabled: true
442
+
443
+ Style/CommandLiteral:
444
+ Description: 'Use `` or %x around command literals.'
445
+ StyleGuide: '#percent-x'
446
+ Enabled: true
447
+
448
+ Style/CommentAnnotation:
449
+ Description: >-
450
+ Checks formatting of special comments
451
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
452
+ StyleGuide: '#annotate-keywords'
453
+ Enabled: true
454
+
455
+ Style/ConditionalAssignment:
456
+ Description: >-
457
+ Use the return value of `if` and `case` statements for
458
+ assignment to a variable and variable comparison instead
459
+ of assigning that variable inside of each branch.
460
+ Enabled: true
461
+
462
+ Style/ConstantName:
463
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
464
+ StyleGuide: '#screaming-snake-case'
465
+ Enabled: true
466
+
467
+ Style/DefWithParentheses:
468
+ Description: 'Use def with parentheses when there are arguments.'
469
+ StyleGuide: '#method-parens'
470
+ Enabled: true
471
+
472
+ Style/DoubleNegation:
473
+ Description: 'Checks for uses of double negation (!!).'
474
+ StyleGuide: '#no-bang-bang'
475
+ Enabled: true
476
+
477
+ Style/EachForSimpleLoop:
478
+ Description: >-
479
+ Use `Integer#times` for a simple loop which iterates a fixed
480
+ number of times.
481
+ Enabled: true
482
+
483
+ Style/EachWithObject:
484
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
485
+ Enabled: true
486
+
487
+ Style/EmptyElse:
488
+ Description: 'Avoid empty else-clauses.'
489
+ Enabled: true
490
+
491
+ Style/EmptyCaseCondition:
492
+ Description: 'Avoid empty condition in case statements.'
493
+ Enabled: true
494
+
495
+ Style/EmptyLiteral:
496
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
497
+ StyleGuide: '#literal-array-hash'
498
+ Enabled: true
499
+
500
+ Style/EmptyMethod:
501
+ Description: 'Checks the formatting of empty method definitions.'
502
+ StyleGuide: '#no-single-line-methods'
503
+ Enabled: true
504
+
505
+ Style/EndBlock:
506
+ Description: 'Avoid the use of END blocks.'
507
+ StyleGuide: '#no-END-blocks'
508
+ Enabled: true
509
+
510
+ Style/EvenOdd:
511
+ Description: 'Favor the use of Integer#even? && Integer#odd?'
512
+ StyleGuide: '#predicate-methods'
513
+ Enabled: true
514
+
515
+ Style/FileName:
516
+ Description: 'Use snake_case for source file names.'
517
+ StyleGuide: '#snake-case-files'
518
+ Enabled: true
519
+
520
+ Style/FrozenStringLiteralComment:
521
+ Description: >-
522
+ Add the frozen_string_literal comment to the top of files
523
+ to help transition from Ruby 2.3.0 to Ruby 3.0.
524
+ Enabled: true
525
+
526
+ Style/FlipFlop:
527
+ Description: 'Checks for flip flops'
528
+ StyleGuide: '#no-flip-flops'
529
+ Enabled: true
530
+
531
+ Style/For:
532
+ Description: 'Checks use of for or each in multiline loops.'
533
+ StyleGuide: '#no-for-loops'
534
+ Enabled: true
535
+
536
+ Style/FormatString:
537
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
538
+ StyleGuide: '#sprintf'
539
+ Enabled: true
540
+
541
+ Style/FormatStringToken:
542
+ Description: 'Use a consistent style for format string tokens.'
543
+ Enabled: true
544
+
545
+ Style/GlobalVars:
546
+ Description: 'Do not introduce global variables.'
547
+ StyleGuide: '#instance-vars'
548
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
549
+ Enabled: true
550
+
551
+ Style/GuardClause:
552
+ Description: 'Check for conditionals that can be replaced with guard clauses'
553
+ StyleGuide: '#no-nested-conditionals'
554
+ Enabled: true
555
+
556
+ Style/HashSyntax:
557
+ Description: >-
558
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
559
+ { :a => 1, :b => 2 }.
560
+ StyleGuide: '#hash-literals'
561
+ Enabled: true
562
+
563
+ Style/IfInsideElse:
564
+ Description: 'Finds if nodes inside else, which can be converted to elsif.'
565
+ Enabled: true
566
+
567
+ Style/IfUnlessModifier:
568
+ Description: >-
569
+ Favor modifier if/unless usage when you have a
570
+ single-line body.
571
+ StyleGuide: '#if-as-a-modifier'
572
+ Enabled: true
573
+
574
+ Style/IfUnlessModifierOfIfUnless:
575
+ Description: >-
576
+ Avoid modifier if/unless usage on conditionals.
577
+ Enabled: true
578
+
579
+ Style/IfWithSemicolon:
580
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
581
+ StyleGuide: '#no-semicolon-ifs'
582
+ Enabled: true
583
+
584
+ Style/IdenticalConditionalBranches:
585
+ Description: >-
586
+ Checks that conditional statements do not have an identical
587
+ line at the end of each branch, which can validly be moved
588
+ out of the conditional.
589
+ Enabled: true
590
+
591
+ Style/InfiniteLoop:
592
+ Description: 'Use Kernel#loop for infinite loops.'
593
+ StyleGuide: '#infinite-loop'
594
+ Enabled: true
595
+
596
+ Style/InverseMethods:
597
+ Description: >-
598
+ Use the inverse method instead of `!.method`
599
+ if an inverse method is defined.
600
+ Enabled: true
601
+
602
+ Style/Lambda:
603
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
604
+ StyleGuide: '#lambda-multi-line'
605
+ Enabled: true
606
+
607
+ Style/LambdaCall:
608
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
609
+ StyleGuide: '#proc-call'
610
+ Enabled: true
611
+
612
+ Style/LineEndConcatenation:
613
+ Description: >-
614
+ Use \ instead of + or << to concatenate two string literals at
615
+ line end.
616
+ Enabled: true
617
+
618
+ Style/MethodCallWithoutArgsParentheses:
619
+ Description: 'Do not use parentheses for method calls with no arguments.'
620
+ StyleGuide: '#method-invocation-parens'
621
+ Enabled: true
622
+
623
+ Style/MethodDefParentheses:
624
+ Description: >-
625
+ Checks if the method definitions have or don't have
626
+ parentheses.
627
+ StyleGuide: '#method-parens'
628
+ Enabled: true
629
+
630
+ Style/MethodName:
631
+ Description: 'Use the configured style when naming methods.'
632
+ StyleGuide: '#snake-case-symbols-methods-vars'
633
+ Enabled: true
634
+
635
+ Style/MethodMissing:
636
+ Description: 'Avoid using `method_missing`.'
637
+ StyleGuide: '#no-method-missing'
638
+ Enabled: true
639
+
640
+ Style/MixinGrouping:
641
+ Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
642
+ StyleGuide: '#mixin-grouping'
643
+ Enabled: true
644
+
645
+ Style/ModuleFunction:
646
+ Description: 'Checks for usage of `extend self` in modules.'
647
+ StyleGuide: '#module-function'
648
+ Enabled: true
649
+
650
+ Style/MultilineBlockChain:
651
+ Description: 'Avoid multi-line chains of blocks.'
652
+ StyleGuide: '#single-line-blocks'
653
+ Enabled: true
654
+
655
+ Style/MultilineIfThen:
656
+ Description: 'Do not use then for multi-line if/unless.'
657
+ StyleGuide: '#no-then'
658
+ Enabled: true
659
+
660
+ Style/MultilineIfModifier:
661
+ Description: 'Only use if/unless modifiers on single line statements.'
662
+ StyleGuide: '#no-multiline-if-modifiers'
663
+ Enabled: true
664
+
665
+ Style/MultilineMemoization:
666
+ Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
667
+ Enabled: true
668
+
669
+ Style/MultilineTernaryOperator:
670
+ Description: >-
671
+ Avoid multi-line ?: (the ternary operator);
672
+ use if/unless instead.
673
+ StyleGuide: '#no-multiline-ternary'
674
+ Enabled: true
675
+
676
+ Style/MultipleComparison:
677
+ Description: >-
678
+ Avoid comparing a variable with multiple items in a conditional,
679
+ use Array#include? instead.
680
+ Enabled: true
681
+
682
+ Style/MutableConstant:
683
+ Description: 'Do not assign mutable objects to constants.'
684
+ Enabled: true
685
+
686
+ Style/NegatedIf:
687
+ Description: >-
688
+ Favor unless over if for negative conditions
689
+ (or control flow or).
690
+ StyleGuide: '#unless-for-negatives'
691
+ Enabled: true
692
+
693
+ Style/NegatedWhile:
694
+ Description: 'Favor until over while for negative conditions.'
695
+ StyleGuide: '#until-for-negatives'
696
+ Enabled: true
697
+
698
+ Style/NestedModifier:
699
+ Description: 'Avoid using nested modifiers.'
700
+ StyleGuide: '#no-nested-modifiers'
701
+ Enabled: true
702
+
703
+ Style/NestedParenthesizedCalls:
704
+ Description: >-
705
+ Parenthesize method calls which are nested inside the
706
+ argument list of another parenthesized method call.
707
+ Enabled: true
708
+
709
+ Style/NestedTernaryOperator:
710
+ Description: 'Use one expression per branch in a ternary operator.'
711
+ StyleGuide: '#no-nested-ternary'
712
+ Enabled: true
713
+
714
+ Style/Next:
715
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
716
+ StyleGuide: '#no-nested-conditionals'
717
+ Enabled: true
718
+
719
+ Style/NilComparison:
720
+ Description: 'Prefer x.nil? to x == nil.'
721
+ StyleGuide: '#predicate-methods'
722
+ Enabled: true
723
+
724
+ Style/NonNilCheck:
725
+ Description: 'Checks for redundant nil checks.'
726
+ StyleGuide: '#no-non-nil-checks'
727
+ Enabled: true
728
+
729
+ Style/Not:
730
+ Description: 'Use ! instead of not.'
731
+ StyleGuide: '#bang-not-not'
732
+ Enabled: true
733
+
734
+ Style/NumericLiterals:
735
+ Description: >-
736
+ Add underscores to large numeric literals to improve their
737
+ readability.
738
+ StyleGuide: '#underscores-in-numerics'
739
+ Enabled: true
740
+
741
+ Style/NumericLiteralPrefix:
742
+ Description: 'Use smallcase prefixes for numeric literals.'
743
+ StyleGuide: '#numeric-literal-prefixes'
744
+ Enabled: true
745
+
746
+ Style/NumericPredicate:
747
+ Description: >-
748
+ Checks for the use of predicate- or comparison methods for
749
+ numeric comparisons.
750
+ StyleGuide: '#predicate-methods'
751
+ # This will change to a new method call which isn't guaranteed to be on the
752
+ # object. Switching these methods has to be done with knowledge of the types
753
+ # of the variables which rubocop doesn't have.
754
+ AutoCorrect: false
755
+ Enabled: true
756
+
757
+ Style/OneLineConditional:
758
+ Description: >-
759
+ Favor the ternary operator(?:) over
760
+ if/then/else/end constructs.
761
+ StyleGuide: '#ternary-operator'
762
+ Enabled: true
763
+
764
+ Style/OpMethod:
765
+ Description: 'When defining binary operators, name the argument other.'
766
+ StyleGuide: '#other-arg'
767
+ Enabled: true
768
+
769
+ Style/OptionalArguments:
770
+ Description: >-
771
+ Checks for optional arguments that do not appear at the end
772
+ of the argument list
773
+ StyleGuide: '#optional-arguments'
774
+ Enabled: true
775
+
776
+ Style/ParallelAssignment:
777
+ Description: >-
778
+ Check for simple usages of parallel assignment.
779
+ It will only warn when the number of variables
780
+ matches on both sides of the assignment.
781
+ StyleGuide: '#parallel-assignment'
782
+ Enabled: true
783
+
784
+ Style/ParenthesesAroundCondition:
785
+ Description: >-
786
+ Don't use parentheses around the condition of an
787
+ if/unless/while.
788
+ StyleGuide: '#no-parens-around-condition'
789
+ Enabled: true
790
+
791
+ Style/PercentLiteralDelimiters:
792
+ Description: 'Use `%`-literal delimiters consistently'
793
+ StyleGuide: '#percent-literal-braces'
794
+ Enabled: true
795
+
796
+ Style/PercentQLiterals:
797
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
798
+ Enabled: true
799
+
800
+ Style/PerlBackrefs:
801
+ Description: 'Avoid Perl-style regex back references.'
802
+ StyleGuide: '#no-perl-regexp-last-matchers'
803
+ Enabled: true
804
+
805
+ Style/PredicateName:
806
+ Description: 'Check the names of predicate methods.'
807
+ StyleGuide: '#bool-methods-qmark'
808
+ Enabled: true
809
+
810
+ Style/PreferredHashMethods:
811
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
812
+ StyleGuide: '#hash-key'
813
+ Enabled: true
814
+
815
+ Style/Proc:
816
+ Description: 'Use proc instead of Proc.new.'
817
+ StyleGuide: '#proc'
818
+ Enabled: true
819
+
820
+ Style/RaiseArgs:
821
+ Description: 'Checks the arguments passed to raise/fail.'
822
+ StyleGuide: '#exception-class-messages'
823
+ Enabled: true
824
+
825
+ Style/RedundantBegin:
826
+ Description: "Don't use begin blocks when they are not needed."
827
+ StyleGuide: '#begin-implicit'
828
+ Enabled: true
829
+
830
+ Style/RedundantException:
831
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
832
+ StyleGuide: '#no-explicit-runtimeerror'
833
+ Enabled: true
834
+
835
+ Style/RedundantFreeze:
836
+ Description: "Checks usages of Object#freeze on immutable objects."
837
+ Enabled: true
838
+
839
+ Style/RedundantParentheses:
840
+ Description: "Checks for parentheses that seem not to serve any purpose."
841
+ Enabled: true
842
+
843
+ Style/RedundantReturn:
844
+ Description: "Don't use return where it's not required."
845
+ StyleGuide: '#no-explicit-return'
846
+ Enabled: true
847
+
848
+ Style/RedundantSelf:
849
+ Description: "Don't use self where it's not needed."
850
+ StyleGuide: '#no-self-unless-required'
851
+ Enabled: true
852
+
853
+ Style/RegexpLiteral:
854
+ Description: 'Use / or %r around regular expressions.'
855
+ StyleGuide: '#percent-r'
856
+ Enabled: true
857
+
858
+ Style/RescueModifier:
859
+ Description: 'Avoid using rescue in its modifier form.'
860
+ StyleGuide: '#no-rescue-modifiers'
861
+ Enabled: true
862
+
863
+ Style/SafeNavigation:
864
+ Description: >-
865
+ This cop transforms usages of a method call safeguarded by
866
+ a check for the existance of the object to
867
+ safe navigation (`&.`).
868
+ Enabled: true
869
+
870
+ Style/SelfAssignment:
871
+ Description: >-
872
+ Checks for places where self-assignment shorthand should have
873
+ been used.
874
+ StyleGuide: '#self-assignment'
875
+ Enabled: true
876
+
877
+ Style/Semicolon:
878
+ Description: "Don't use semicolons to terminate expressions."
879
+ StyleGuide: '#no-semicolon'
880
+ Enabled: true
881
+
882
+ Style/SignalException:
883
+ Description: 'Checks for proper usage of fail and raise.'
884
+ StyleGuide: '#prefer-raise-over-fail'
885
+ Enabled: true
886
+
887
+ Style/SingleLineMethods:
888
+ Description: 'Avoid single-line methods.'
889
+ StyleGuide: '#no-single-line-methods'
890
+ Enabled: true
891
+
892
+ Style/SpecialGlobalVars:
893
+ Description: 'Avoid Perl-style global variables.'
894
+ StyleGuide: '#no-cryptic-perlisms'
895
+ Enabled: true
896
+
897
+ Style/StabbyLambdaParentheses:
898
+ Description: 'Check for the usage of parentheses around stabby lambda arguments.'
899
+ StyleGuide: '#stabby-lambda-with-args'
900
+ Enabled: true
901
+
902
+ Style/StringLiterals:
903
+ Description: 'Checks if uses of quotes match the configured preference.'
904
+ StyleGuide: '#consistent-string-literals'
905
+ Enabled: true
906
+
907
+ Style/StringLiteralsInInterpolation:
908
+ Description: >-
909
+ Checks if uses of quotes inside expressions in interpolated
910
+ strings match the configured preference.
911
+ Enabled: true
912
+
913
+ Style/StructInheritance:
914
+ Description: 'Checks for inheritance from Struct.new.'
915
+ StyleGuide: '#no-extend-struct-new'
916
+ Enabled: true
917
+
918
+ Style/SymbolArray:
919
+ Description: 'Use %i or %I for arrays of symbols.'
920
+ StyleGuide: '#percent-i'
921
+ Enabled: true
922
+
923
+ Style/SymbolLiteral:
924
+ Description: 'Use plain symbols instead of string symbols when possible.'
925
+ Enabled: true
926
+
927
+ Style/SymbolProc:
928
+ Description: 'Use symbols as procs instead of blocks when possible.'
929
+ Enabled: true
930
+
931
+ Style/TernaryParentheses:
932
+ Description: 'Checks for use of parentheses around ternary conditions.'
933
+ Enabled: true
934
+
935
+ Style/TrailingCommaInArguments:
936
+ Description: 'Checks for trailing comma in argument lists.'
937
+ StyleGuide: '#no-trailing-params-comma'
938
+ Enabled: true
939
+
940
+ Style/TrailingCommaInLiteral:
941
+ Description: 'Checks for trailing comma in array and hash literals.'
942
+ StyleGuide: '#no-trailing-array-commas'
943
+ Enabled: true
944
+
945
+ Style/TrivialAccessors:
946
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
947
+ StyleGuide: '#attr_family'
948
+ Enabled: true
949
+
950
+ Style/UnlessElse:
951
+ Description: >-
952
+ Do not use unless with else. Rewrite these with the positive
953
+ case first.
954
+ StyleGuide: '#no-else-with-unless'
955
+ Enabled: true
956
+
957
+ Style/UnneededCapitalW:
958
+ Description: 'Checks for %W when interpolation is not needed.'
959
+ Enabled: true
960
+
961
+ Style/UnneededInterpolation:
962
+ Description: 'Checks for strings that are just an interpolated expression.'
963
+ Enabled: true
964
+
965
+ Style/UnneededPercentQ:
966
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
967
+ StyleGuide: '#percent-q'
968
+ Enabled: true
969
+
970
+ Style/TrailingUnderscoreVariable:
971
+ Description: >-
972
+ Checks for the usage of unneeded trailing underscores at the
973
+ end of parallel variable assignment.
974
+ AllowNamedUnderscoreVariables: true
975
+ Enabled: true
976
+
977
+ Style/VariableInterpolation:
978
+ Description: >-
979
+ Don't interpolate global, instance and class variables
980
+ directly in strings.
981
+ StyleGuide: '#curlies-interpolate'
982
+ Enabled: true
983
+
984
+ Style/VariableName:
985
+ Description: 'Use the configured style when naming variables.'
986
+ StyleGuide: '#snake-case-symbols-methods-vars'
987
+ Enabled: true
988
+
989
+ Style/VariableNumber:
990
+ Description: 'Use the configured style when numbering variables.'
991
+ Enabled: true
992
+
993
+ Style/WhenThen:
994
+ Description: 'Use when x then ... for one-line cases.'
995
+ StyleGuide: '#one-line-cases'
996
+ Enabled: true
997
+
998
+ Style/WhileUntilDo:
999
+ Description: 'Checks for redundant do after while or until.'
1000
+ StyleGuide: '#no-multiline-while-do'
1001
+ Enabled: true
1002
+
1003
+ Style/WhileUntilModifier:
1004
+ Description: >-
1005
+ Favor modifier while/until usage when you have a
1006
+ single-line body.
1007
+ StyleGuide: '#while-as-a-modifier'
1008
+ Enabled: true
1009
+
1010
+ Style/WordArray:
1011
+ Description: 'Use %w or %W for arrays of words.'
1012
+ StyleGuide: '#percent-w'
1013
+ Enabled: true
1014
+
1015
+ Style/YodaCondition:
1016
+ Description: 'Do not use literals as the first operand of a comparison.'
1017
+ Reference: 'https://en.wikipedia.org/wiki/Yoda_conditions'
1018
+ Enabled: true
1019
+
1020
+ Style/ZeroLengthPredicate:
1021
+ Description: 'Use #empty? when testing for objects of length 0.'
1022
+ Enabled: true
1023
+
1024
+ #################### Metrics ###############################
1025
+
1026
+ Metrics/AbcSize:
1027
+ Description: >-
1028
+ A calculated magnitude based on number of assignments,
1029
+ branches, and conditions.
1030
+ Reference: 'http://c2.com/cgi/wiki?AbcMetric'
1031
+ Enabled: true
1032
+
1033
+ Metrics/BlockNesting:
1034
+ Description: 'Avoid excessive block nesting'
1035
+ StyleGuide: '#three-is-the-number-thou-shalt-count'
1036
+ Enabled: true
1037
+
1038
+ Metrics/ClassLength:
1039
+ Description: 'Avoid classes longer than 100 lines of code.'
1040
+ Enabled: true
1041
+
1042
+ Metrics/ModuleLength:
1043
+ Description: 'Avoid modules longer than 100 lines of code.'
1044
+ Enabled: true
1045
+
1046
+ Metrics/CyclomaticComplexity:
1047
+ Description: >-
1048
+ A complexity metric that is strongly correlated to the number
1049
+ of test cases needed to validate a method.
1050
+ Enabled: true
1051
+
1052
+ Metrics/LineLength:
1053
+ Description: 'Limit lines to 80 characters.'
1054
+ StyleGuide: '#80-character-limits'
1055
+ Enabled: true
1056
+
1057
+ Metrics/MethodLength:
1058
+ Description: 'Avoid methods longer than 10 lines of code.'
1059
+ StyleGuide: '#short-methods'
1060
+ Enabled: true
1061
+
1062
+ Metrics/BlockLength:
1063
+ Description: 'Avoid long blocks with many lines.'
1064
+ Enabled: true
1065
+
1066
+ Metrics/ParameterLists:
1067
+ Description: 'Avoid parameter lists longer than three or four parameters.'
1068
+ StyleGuide: '#too-many-params'
1069
+ Enabled: true
1070
+
1071
+ Metrics/PerceivedComplexity:
1072
+ Description: >-
1073
+ A complexity metric geared towards measuring complexity for a
1074
+ human reader.
1075
+ Enabled: true
1076
+
1077
+ #################### Lint ##################################
1078
+ ### Warnings
1079
+
1080
+ Lint/AmbiguousBlockAssociation:
1081
+ Description: >-
1082
+ Checks for ambiguous block association with method when param passed without
1083
+ parentheses.
1084
+ StyleGuide: '#syntax'
1085
+ Enabled: true
1086
+
1087
+ Lint/AmbiguousOperator:
1088
+ Description: >-
1089
+ Checks for ambiguous operators in the first argument of a
1090
+ method invocation without parentheses.
1091
+ StyleGuide: '#method-invocation-parens'
1092
+ Enabled: true
1093
+
1094
+ Lint/AmbiguousRegexpLiteral:
1095
+ Description: >-
1096
+ Checks for ambiguous regexp literals in the first argument of
1097
+ a method invocation without parentheses.
1098
+ Enabled: true
1099
+
1100
+ Lint/AssignmentInCondition:
1101
+ Description: "Don't use assignment in conditions."
1102
+ StyleGuide: '#safe-assignment-in-condition'
1103
+ Enabled: true
1104
+
1105
+ Lint/BlockAlignment:
1106
+ Description: 'Align block ends correctly.'
1107
+ Enabled: true
1108
+
1109
+ Lint/CircularArgumentReference:
1110
+ Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
1111
+ Enabled: true
1112
+
1113
+ Lint/ConditionPosition:
1114
+ Description: >-
1115
+ Checks for condition placed in a confusing position relative to
1116
+ the keyword.
1117
+ StyleGuide: '#same-line-condition'
1118
+ Enabled: true
1119
+
1120
+ Lint/Debugger:
1121
+ Description: 'Check for debugger calls.'
1122
+ Enabled: true
1123
+
1124
+ Lint/DefEndAlignment:
1125
+ Description: 'Align ends corresponding to defs correctly.'
1126
+ Enabled: true
1127
+
1128
+ Lint/DeprecatedClassMethods:
1129
+ Description: 'Check for deprecated class method calls.'
1130
+ Enabled: true
1131
+
1132
+ Lint/DuplicateCaseCondition:
1133
+ Description: 'Do not repeat values in case conditionals.'
1134
+ Enabled: true
1135
+
1136
+ Lint/DuplicateMethods:
1137
+ Description: 'Check for duplicate method definitions.'
1138
+ Enabled: true
1139
+
1140
+ Lint/DuplicatedKey:
1141
+ Description: 'Check for duplicate keys in hash literals.'
1142
+ Enabled: true
1143
+
1144
+ Lint/EachWithObjectArgument:
1145
+ Description: 'Check for immutable argument given to each_with_object.'
1146
+ Enabled: true
1147
+
1148
+ Lint/ElseLayout:
1149
+ Description: 'Check for odd code arrangement in an else block.'
1150
+ Enabled: true
1151
+
1152
+ Lint/EmptyEnsure:
1153
+ Description: 'Checks for empty ensure block.'
1154
+ Enabled: true
1155
+ AutoCorrect: false
1156
+
1157
+ Lint/EmptyExpression:
1158
+ Description: 'Checks for empty expressions.'
1159
+ Enabled: true
1160
+
1161
+ Lint/EmptyInterpolation:
1162
+ Description: 'Checks for empty string interpolation.'
1163
+ Enabled: true
1164
+
1165
+ Lint/EmptyWhen:
1166
+ Description: 'Checks for `when` branches with empty bodies.'
1167
+ Enabled: true
1168
+
1169
+ Lint/EndAlignment:
1170
+ Description: 'Align ends correctly.'
1171
+ Enabled: true
1172
+
1173
+ Lint/EndInMethod:
1174
+ Description: 'END blocks should not be placed inside method definitions.'
1175
+ Enabled: true
1176
+
1177
+ Lint/EnsureReturn:
1178
+ Description: 'Do not use return in an ensure block.'
1179
+ StyleGuide: '#no-return-ensure'
1180
+ Enabled: true
1181
+
1182
+ Lint/FloatOutOfRange:
1183
+ Description: >-
1184
+ Catches floating-point literals too large or small for Ruby to
1185
+ represent.
1186
+ Enabled: true
1187
+
1188
+ Lint/FormatParameterMismatch:
1189
+ Description: 'The number of parameters to format/sprint must match the fields.'
1190
+ Enabled: true
1191
+
1192
+ Lint/HandleExceptions:
1193
+ Description: "Don't suppress exception."
1194
+ StyleGuide: '#dont-hide-exceptions'
1195
+ Enabled: true
1196
+
1197
+ Lint/ImplicitStringConcatenation:
1198
+ Description: >-
1199
+ Checks for adjacent string literals on the same line, which
1200
+ could better be represented as a single string literal.
1201
+ Enabled: true
1202
+
1203
+ Lint/IneffectiveAccessModifier:
1204
+ Description: >-
1205
+ Checks for attempts to use `private` or `protected` to set
1206
+ the visibility of a class method, which does not work.
1207
+ Enabled: true
1208
+
1209
+ Lint/InheritException:
1210
+ Description: 'Avoid inheriting from the `Exception` class.'
1211
+ Enabled: true
1212
+
1213
+ Lint/InvalidCharacterLiteral:
1214
+ Description: >-
1215
+ Checks for invalid character literals with a non-escaped
1216
+ whitespace character.
1217
+ Enabled: true
1218
+
1219
+ Lint/LiteralInCondition:
1220
+ Description: 'Checks of literals used in conditions.'
1221
+ Enabled: true
1222
+
1223
+ Lint/LiteralInInterpolation:
1224
+ Description: 'Checks for literals used in interpolation.'
1225
+ Enabled: true
1226
+
1227
+ Lint/Loop:
1228
+ Description: >-
1229
+ Use Kernel#loop with break rather than begin/end/until or
1230
+ begin/end/while for post-loop tests.
1231
+ StyleGuide: '#loop-with-break'
1232
+ Enabled: true
1233
+
1234
+ Lint/MultipleCompare:
1235
+ Description: "Use `&&` operator to compare multiple value."
1236
+ Enabled: true
1237
+
1238
+ Lint/NestedMethodDefinition:
1239
+ Description: 'Do not use nested method definitions.'
1240
+ StyleGuide: '#no-nested-methods'
1241
+ Enabled: true
1242
+
1243
+ Lint/NextWithoutAccumulator:
1244
+ Description: >-
1245
+ Do not omit the accumulator when calling `next`
1246
+ in a `reduce`/`inject` block.
1247
+ Enabled: true
1248
+
1249
+ Lint/NonLocalExitFromIterator:
1250
+ Description: 'Do not use return in iterator to cause non-local exit.'
1251
+ Enabled: true
1252
+
1253
+ Lint/ParenthesesAsGroupedExpression:
1254
+ Description: >-
1255
+ Checks for method calls with a space before the opening
1256
+ parenthesis.
1257
+ StyleGuide: '#parens-no-spaces'
1258
+ Enabled: true
1259
+
1260
+ Lint/PercentStringArray:
1261
+ Description: >-
1262
+ Checks for unwanted commas and quotes in %w/%W literals.
1263
+ Enabled: true
1264
+
1265
+ Lint/PercentSymbolArray:
1266
+ Description: >-
1267
+ Checks for unwanted commas and colons in %i/%I literals.
1268
+ Enabled: true
1269
+
1270
+ Lint/RandOne:
1271
+ Description: >-
1272
+ Checks for `rand(1)` calls. Such calls always return `0`
1273
+ and most likely a mistake.
1274
+ Enabled: true
1275
+
1276
+ Lint/RequireParentheses:
1277
+ Description: >-
1278
+ Use parentheses in the method call to avoid confusion
1279
+ about precedence.
1280
+ Enabled: true
1281
+
1282
+ Lint/RescueException:
1283
+ Description: 'Avoid rescuing the Exception class.'
1284
+ StyleGuide: '#no-blind-rescues'
1285
+ Enabled: true
1286
+
1287
+ Lint/RescueType:
1288
+ Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
1289
+ Enabled: true
1290
+
1291
+ Lint/SafeNavigationChain:
1292
+ Description: 'Do not chain ordinary method call after safe navigation operator.'
1293
+ Enabled: true
1294
+
1295
+ Lint/ScriptPermission:
1296
+ Description: 'Grant script file execute permission.'
1297
+ Enabled: true
1298
+
1299
+ Lint/ShadowedException:
1300
+ Description: >-
1301
+ Avoid rescuing a higher level exception
1302
+ before a lower level exception.
1303
+ Enabled: true
1304
+
1305
+ Lint/ShadowingOuterLocalVariable:
1306
+ Description: >-
1307
+ Do not use the same name as outer local variable
1308
+ for block arguments or block local variables.
1309
+ Enabled: true
1310
+
1311
+ Lint/StringConversionInInterpolation:
1312
+ Description: 'Checks for Object#to_s usage in string interpolation.'
1313
+ StyleGuide: '#no-to-s'
1314
+ Enabled: true
1315
+
1316
+ Lint/UnderscorePrefixedVariableName:
1317
+ Description: 'Do not use prefix `_` for a variable that is used.'
1318
+ Enabled: true
1319
+
1320
+ Lint/UnifiedInteger:
1321
+ Description: 'Use Integer instead of Fixnum or Bignum'
1322
+ Enabled: true
1323
+
1324
+ Lint/UnneededDisable:
1325
+ Description: >-
1326
+ Checks for rubocop:disable comments that can be removed.
1327
+ Note: this cop is not disabled when disabling all cops.
1328
+ It must be explicitly disabled.
1329
+ Enabled: true
1330
+
1331
+ Lint/UnneededSplatExpansion:
1332
+ Description: 'Checks for splat unnecessarily being called on literals'
1333
+ Enabled: true
1334
+
1335
+ Lint/UnusedBlockArgument:
1336
+ Description: 'Checks for unused block arguments.'
1337
+ StyleGuide: '#underscore-unused-vars'
1338
+ Enabled: true
1339
+
1340
+ Lint/UnusedMethodArgument:
1341
+ Description: 'Checks for unused method arguments.'
1342
+ StyleGuide: '#underscore-unused-vars'
1343
+ Enabled: true
1344
+
1345
+ Lint/UnreachableCode:
1346
+ Description: 'Unreachable code.'
1347
+ Enabled: true
1348
+
1349
+ Lint/UselessAccessModifier:
1350
+ Description: 'Checks for useless access modifiers.'
1351
+ Enabled: true
1352
+ ContextCreatingMethods: []
1353
+ MethodCreatingMethods: []
1354
+
1355
+ Lint/UselessAssignment:
1356
+ Description: 'Checks for useless assignment to a local variable.'
1357
+ StyleGuide: '#underscore-unused-vars'
1358
+ Enabled: true
1359
+
1360
+ Lint/UselessComparison:
1361
+ Description: 'Checks for comparison of something with itself.'
1362
+ Enabled: true
1363
+
1364
+ Lint/UselessElseWithoutRescue:
1365
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
1366
+ Enabled: true
1367
+
1368
+ Lint/UselessSetterCall:
1369
+ Description: 'Checks for useless setter call to a local variable.'
1370
+ Enabled: true
1371
+
1372
+ Lint/Void:
1373
+ Description: 'Possible use of operator/literal/variable in void context.'
1374
+ Enabled: true
1375
+
1376
+ #################### Performance ###########################
1377
+
1378
+ Performance/Caller:
1379
+ Description: >-
1380
+ Use `caller(n..n)` instead of `caller`.
1381
+ Enabled: true
1382
+
1383
+ Performance/Casecmp:
1384
+ Description: >-
1385
+ Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
1386
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
1387
+ Enabled: true
1388
+
1389
+ Performance/CaseWhenSplat:
1390
+ Description: >-
1391
+ Place `when` conditions that use splat at the end
1392
+ of the list of `when` branches.
1393
+ Enabled: true
1394
+
1395
+ Performance/Count:
1396
+ Description: >-
1397
+ Use `count` instead of `select...size`, `reject...size`,
1398
+ `select...count`, `reject...count`, `select...length`,
1399
+ and `reject...length`.
1400
+ # This cop has known compatibility issues with `ActiveRecord` and other
1401
+ # frameworks. ActiveRecord's `count` ignores the block that is passed to it.
1402
+ # For more information, see the documentation in the cop itself.
1403
+ # If you understand the known risk, you can disable `SafeMode`.
1404
+ SafeMode: true
1405
+ Enabled: true
1406
+
1407
+ Performance/Detect:
1408
+ Description: >-
1409
+ Use `detect` instead of `select.first`, `find_all.first`,
1410
+ `select.last`, and `find_all.last`.
1411
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
1412
+ # This cop has known compatibility issues with `ActiveRecord` and other
1413
+ # frameworks. `ActiveRecord` does not implement a `detect` method and `find`
1414
+ # has its own meaning. Correcting `ActiveRecord` methods with this cop
1415
+ # should be considered unsafe.
1416
+ SafeMode: true
1417
+ Enabled: true
1418
+
1419
+ Performance/DoubleStartEndWith:
1420
+ Description: >-
1421
+ Use `str.{start,end}_with?(x, ..., y, ...)`
1422
+ instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
1423
+ Enabled: true
1424
+
1425
+ Performance/EndWith:
1426
+ Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
1427
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1428
+ # This will change to a new method call which isn't guaranteed to be on the
1429
+ # object. Switching these methods has to be done with knowledge of the types
1430
+ # of the variables which rubocop doesn't have.
1431
+ AutoCorrect: false
1432
+ Enabled: true
1433
+
1434
+ Performance/FixedSize:
1435
+ Description: 'Do not compute the size of statically sized objects except in constants'
1436
+ Enabled: true
1437
+
1438
+ Performance/FlatMap:
1439
+ Description: >-
1440
+ Use `Enumerable#flat_map`
1441
+ instead of `Enumerable#map...Array#flatten(1)`
1442
+ or `Enumberable#collect..Array#flatten(1)`
1443
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
1444
+ Enabled: true
1445
+ EnabledForFlattenWithoutParams: false
1446
+ # If enabled, this cop will warn about usages of
1447
+ # `flatten` being called without any parameters.
1448
+ # This can be dangerous since `flat_map` will only flatten 1 level, and
1449
+ # `flatten` without any parameters can flatten multiple levels.
1450
+
1451
+ Performance/HashEachMethods:
1452
+ Description: >-
1453
+ Use `Hash#each_key` and `Hash#each_value` instead of
1454
+ `Hash#keys.each` and `Hash#values.each`.
1455
+ StyleGuide: '#hash-each'
1456
+ Enabled: true
1457
+ AutoCorrect: false
1458
+
1459
+ Performance/LstripRstrip:
1460
+ Description: 'Use `strip` instead of `lstrip.rstrip`.'
1461
+ Enabled: true
1462
+
1463
+ Performance/RangeInclude:
1464
+ Description: 'Use `Range#cover?` instead of `Range#include?`.'
1465
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
1466
+ Enabled: true
1467
+
1468
+ Performance/RedundantBlockCall:
1469
+ Description: 'Use `yield` instead of `block.call`.'
1470
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-vs-yield-code'
1471
+ Enabled: true
1472
+
1473
+ Performance/RedundantMatch:
1474
+ Description: >-
1475
+ Use `=~` instead of `String#match` or `Regexp#match` in a context where the
1476
+ returned `MatchData` is not needed.
1477
+ Enabled: true
1478
+
1479
+ Performance/RedundantMerge:
1480
+ Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
1481
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
1482
+ Enabled: true
1483
+
1484
+ Performance/RedundantSortBy:
1485
+ Description: 'Use `sort` instead of `sort_by { |x| x }`.'
1486
+ Enabled: true
1487
+
1488
+ Performance/RegexpMatch:
1489
+ Description: >-
1490
+ Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
1491
+ `Regexp#===`, or `=~` when `MatchData` is not used.
1492
+ Enabled: true
1493
+
1494
+ Performance/ReverseEach:
1495
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
1496
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
1497
+ Enabled: true
1498
+
1499
+ Performance/Sample:
1500
+ Description: >-
1501
+ Use `sample` instead of `shuffle.first`,
1502
+ `shuffle.last`, and `shuffle[Integer]`.
1503
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
1504
+ Enabled: true
1505
+
1506
+ Performance/Size:
1507
+ Description: >-
1508
+ Use `size` instead of `count` for counting
1509
+ the number of elements in `Array` and `Hash`.
1510
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
1511
+ Enabled: true
1512
+
1513
+ Performance/CompareWithBlock:
1514
+ Description: 'Use `sort_by(&:foo)` instead of `sort_by { |a, b| a.foo <=> b.foo }`.'
1515
+ Enabled: true
1516
+
1517
+ Performance/StartWith:
1518
+ Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
1519
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
1520
+ # This will change to a new method call which isn't guaranteed to be on the
1521
+ # object. Switching these methods has to be done with knowledge of the types
1522
+ # of the variables which rubocop doesn't have.
1523
+ AutoCorrect: false
1524
+ Enabled: true
1525
+
1526
+ Performance/StringReplacement:
1527
+ Description: >-
1528
+ Use `tr` instead of `gsub` when you are replacing the same
1529
+ number of characters. Use `delete` instead of `gsub` when
1530
+ you are deleting characters.
1531
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
1532
+ Enabled: true
1533
+
1534
+ Performance/TimesMap:
1535
+ Description: 'Checks for .times.map calls.'
1536
+ Enabled: true
1537
+
1538
+ #################### Rails #################################
1539
+
1540
+ Rails/ActionFilter:
1541
+ Description: 'Enforces consistent use of action filter methods.'
1542
+ Enabled: true
1543
+
1544
+ Rails/ApplicationJob:
1545
+ Description: 'Check that jobs subclass ApplicationJob.'
1546
+ Enabled: true
1547
+
1548
+ Rails/ApplicationRecord:
1549
+ Description: 'Check that models subclass ApplicationRecord.'
1550
+ Enabled: true
1551
+
1552
+ Rails/ActiveSupportAliases:
1553
+ Description: >-
1554
+ Avoid ActiveSupport aliases of standard ruby methods:
1555
+ `String#starts_with?`, `String#ends_with?`,
1556
+ `Array#append`, `Array#prepend`.
1557
+ Enabled: true
1558
+
1559
+ Rails/Blank:
1560
+ Description: 'Enforce using `blank?` and `present?`.'
1561
+ Enabled: true
1562
+ # Convert checks for `nil` or `empty?` to `blank?`
1563
+ NilOrEmpty: true
1564
+ # Convert usages of not `present?` to `blank?`
1565
+ NotPresent: true
1566
+ # Convert usages of `unless` `present?` to `if` `blank?`
1567
+ UnlessPresent: true
1568
+
1569
+ Rails/Date:
1570
+ Description: >-
1571
+ Checks the correct usage of date aware methods,
1572
+ such as Date.today, Date.current etc.
1573
+ Enabled: true
1574
+
1575
+ Rails/Delegate:
1576
+ Description: 'Prefer delegate method for delegations.'
1577
+ Enabled: true
1578
+
1579
+ Rails/DelegateAllowBlank:
1580
+ Description: 'Do not use allow_blank as an option to delegate.'
1581
+ Enabled: true
1582
+
1583
+ Rails/DynamicFindBy:
1584
+ Description: 'Use `find_by` instead of dynamic `find_by_*`.'
1585
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
1586
+ Enabled: true
1587
+
1588
+ Rails/EnumUniqueness:
1589
+ Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
1590
+ Enabled: true
1591
+
1592
+ Rails/Exit:
1593
+ Description: >-
1594
+ Favor `fail`, `break`, `return`, etc. over `exit` in
1595
+ application or library code outside of Rake files to avoid
1596
+ exits during unit testing or running in production.
1597
+ Enabled: true
1598
+
1599
+ Rails/FilePath:
1600
+ Description: 'Use `Rails.root.join` for file path joining.'
1601
+ Enabled: true
1602
+
1603
+ Rails/FindBy:
1604
+ Description: 'Prefer find_by over where.first.'
1605
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find_by'
1606
+ Enabled: true
1607
+
1608
+ Rails/FindEach:
1609
+ Description: 'Prefer all.find_each over all.find.'
1610
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#find-each'
1611
+ Enabled: true
1612
+
1613
+ Rails/HasAndBelongsToMany:
1614
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
1615
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
1616
+ Enabled: true
1617
+
1618
+ Rails/HttpPositionalArguments:
1619
+ Description: 'Use keyword arguments instead of positional arguments in http method calls.'
1620
+ Enabled: true
1621
+ Include:
1622
+ - 'spec/**/*'
1623
+ - 'test/**/*'
1624
+
1625
+ Rails/NotNullColumn:
1626
+ Description: 'Do not add a NOT NULL column without a default value'
1627
+ Enabled: true
1628
+
1629
+ Rails/Output:
1630
+ Description: 'Checks for calls to puts, print, etc.'
1631
+ Enabled: true
1632
+
1633
+ Rails/OutputSafety:
1634
+ Description: 'The use of `html_safe` or `raw` may be a security risk.'
1635
+ Enabled: true
1636
+
1637
+ Rails/PluralizationGrammar:
1638
+ Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
1639
+ Enabled: true
1640
+
1641
+ Rails/Present:
1642
+ Description: 'Enforce using `blank?` and `present?`.'
1643
+ Enabled: true
1644
+ NotNilAndNotEmpty: true
1645
+ # Convert checks for not `nil` and not `empty?` to `present?`
1646
+ NotBlank: true
1647
+ # Convert usages of not `blank?` to `present?`
1648
+ UnlessBlank: true
1649
+ # Convert usages of `unless` `blank?` to `if` `present?`
1650
+
1651
+ Rails/ReadWriteAttribute:
1652
+ Description: >-
1653
+ Checks for read_attribute(:attr) and
1654
+ write_attribute(:attr, val).
1655
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#read-attribute'
1656
+ Enabled: true
1657
+
1658
+ Rails/RelativeDateConstant:
1659
+ Description: 'Do not assign relative date to constants.'
1660
+ Enabled: true
1661
+
1662
+ Rails/RequestReferer:
1663
+ Description: 'Use consistent syntax for request.referer.'
1664
+ Enabled: true
1665
+
1666
+ Rails/ReversibleMigration:
1667
+ Description: 'Checks whether the change method of the migration file is reversible.'
1668
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#reversible-migration'
1669
+ Reference: 'http://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
1670
+ Enabled: true
1671
+
1672
+ Rails/SafeNavigation:
1673
+ Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
1674
+ Enabled: true
1675
+
1676
+ Rails/ScopeArgs:
1677
+ Description: 'Checks the arguments of ActiveRecord scopes.'
1678
+ Enabled: true
1679
+
1680
+ Rails/TimeZone:
1681
+ Description: 'Checks the correct usage of time zone aware methods.'
1682
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
1683
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
1684
+ Enabled: true
1685
+
1686
+ Rails/UniqBeforePluck:
1687
+ Description: 'Prefer the use of uniq or distinct before pluck.'
1688
+ Enabled: true
1689
+
1690
+ Rails/SkipsModelValidations:
1691
+ Description: >-
1692
+ Use methods that skips model validations with caution.
1693
+ See reference for more information.
1694
+ Reference: 'http://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
1695
+ Enabled: true
1696
+
1697
+ Rails/Validation:
1698
+ Description: 'Use validates :attribute, hash of validations.'
1699
+ Enabled: true
1700
+
1701
+ #################### Security ##############################
1702
+
1703
+ Security/Eval:
1704
+ Description: 'The use of eval represents a serious security risk.'
1705
+ Enabled: true
1706
+
1707
+ Security/JSONLoad:
1708
+ Description: >-
1709
+ Prefer usage of `JSON.parse` over `JSON.load` due to potential
1710
+ security issues. See reference for more information.
1711
+ Reference: 'http://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
1712
+ Enabled: true
1713
+ # Autocorrect here will change to a method that may cause crashes depending
1714
+ # on the value of the argument.
1715
+ AutoCorrect: false
1716
+
1717
+ Security/MarshalLoad:
1718
+ Description: >-
1719
+ Avoid using of `Marshal.load` or `Marshal.restore` due to potential
1720
+ security issues. See reference for more information.
1721
+ Reference: 'http://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
1722
+ Enabled: true
1723
+
1724
+ Security/YAMLLoad:
1725
+ Description: >-
1726
+ Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
1727
+ security issues. See reference for more information.
1728
+ Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
1729
+ Enabled: true
1730
+
1731
+ #################### Bundler ###############################
1732
+
1733
+ Bundler/DuplicatedGem:
1734
+ Description: 'Checks for duplicate gem entries in Gemfile.'
1735
+ Enabled: true
1736
+ Include:
1737
+ - '**/Gemfile'
1738
+ - '**/gems.rb'
1739
+
1740
+ Bundler/OrderedGems:
1741
+ Description: >-
1742
+ Gems within groups in the Gemfile should be alphabetically sorted.
1743
+ Enabled: true
1744
+ Include:
1745
+ - '**/Gemfile'
1746
+ - '**/gems.rb'