context_io 1.0 → 1.1

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