rubocop-rubomatic 1.3.0 → 1.4.0.pre.rc.1

Sign up to get free protection for your applications and to get access to all the features.
data/config/lint.yml CHANGED
@@ -1,109 +1,59 @@
1
1
  Lint/AmbiguousAssignment:
2
- Description: 'Checks for mistyped shorthand assignments.'
3
2
  Enabled: true
4
- VersionAdded: '1.7'
5
3
 
6
4
  Lint/AmbiguousBlockAssociation:
7
- Description: >-
8
- Checks for ambiguous block association with method when param passed without
9
- parentheses.
10
- StyleGuide: '#syntax'
11
5
  Enabled: true
12
- VersionAdded: '0.48'
13
- VersionChanged: '1.13'
14
6
  AllowedMethods: [ ]
15
7
  AllowedPatterns: [ ]
16
8
 
17
9
  Lint/AmbiguousOperator:
18
- Description: >-
19
- Checks for ambiguous operators in the first argument of a
20
- method invocation without parentheses.
21
- StyleGuide: '#method-invocation-parens'
22
10
  Enabled: true
23
- VersionAdded: '0.17'
24
- VersionChanged: '0.83'
25
11
 
26
12
  Lint/AmbiguousOperatorPrecedence:
27
- Description: >-
28
- Checks for expressions containing multiple binary operations with
29
- ambiguous precedence.
30
13
  Enabled: true
31
- VersionAdded: '1.21'
32
14
 
33
15
  Lint/AmbiguousRange:
34
- Description: Checks for ranges with ambiguous boundaries.
35
16
  Enabled: true
36
- VersionAdded: '1.19'
37
17
  RequireParenthesesForMethodChains: true
38
18
 
39
19
  Lint/AmbiguousRegexpLiteral:
40
- Description: >-
41
- Checks for ambiguous regexp literals in the first argument of
42
- a method invocation without parentheses.
43
20
  Enabled: true
44
- VersionAdded: '0.17'
45
- VersionChanged: '0.83'
46
21
 
47
22
  Lint/AssignmentInCondition:
48
- Description: "Don't use assignment in conditions."
49
- StyleGuide: '#safe-assignment-in-condition'
50
23
  Enabled: true
51
- VersionAdded: '0.9'
52
24
  AllowSafeAssignment: false
53
25
 
54
26
  Lint/BigDecimalNew:
55
- Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
56
27
  Enabled: true
57
- VersionAdded: '0.53'
58
28
 
59
29
  Lint/BinaryOperatorWithIdenticalOperands:
60
- Description: 'Checks for places where binary operator has identical operands.'
61
30
  Enabled: true
62
- Safe: false
63
- VersionAdded: '0.89'
64
- VersionChanged: '1.7'
65
31
 
66
32
  Lint/BooleanSymbol:
67
- Description: 'Check for `:true` and `:false` symbols.'
68
33
  Enabled: true
69
- VersionAdded: '0.50'
70
- VersionChanged: '1.22'
71
34
 
72
35
  Lint/CircularArgumentReference:
73
- Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
74
36
  Enabled: true
75
- VersionAdded: '0.33'
76
37
 
77
38
  Lint/ConstantDefinitionInBlock:
78
- Description: 'Do not define constants within a block.'
79
- StyleGuide: '#no-constant-definition-in-block'
80
39
  Enabled: true
81
- VersionAdded: '0.91'
82
- VersionChanged: '1.3'
83
40
  # `enums` for Typed Enums via T::Enum in Sorbet.
84
41
  # https://sorbet.org/docs/tenum
85
42
  AllowedMethods:
86
43
  - enums
87
44
 
88
45
  Lint/ConstantOverwrittenInRescue:
89
- Description: 'Checks for overwriting an exception with an exception result by use `rescue =>`.'
90
46
  Enabled: true
91
- VersionAdded: '1.31'
92
47
 
93
48
  Lint/ConstantResolution:
94
- Description: 'Check that constants are fully qualified with `::`.'
95
49
  Enabled: false
96
- VersionAdded: '0.86'
97
50
  # Restrict this cop to only looking at certain names
98
51
  Only: [ ]
99
52
  # Restrict this cop from only looking at certain names
100
53
  Ignore: [ ]
101
54
 
102
55
  Lint/Debugger:
103
- Description: 'Check for debugger calls.'
104
56
  Enabled: true
105
- VersionAdded: '0.14'
106
- VersionChanged: '1.10'
107
57
  DebuggerMethods:
108
58
  # Groups are available so that a specific group can be disabled in
109
59
  # a user's configuration, but are otherwise not significant.
@@ -142,15 +92,10 @@ Lint/Debugger:
142
92
  - 'spec/**/*'
143
93
 
144
94
  Lint/DeprecatedClassMethods:
145
- Description: 'Check for deprecated class method calls.'
146
95
  Enabled: true
147
- VersionAdded: '0.19'
148
96
 
149
97
  Lint/DeprecatedConstants:
150
- Description: 'Checks for deprecated constants.'
151
98
  Enabled: true
152
- VersionAdded: '1.8'
153
- VersionChanged: '1.40'
154
99
  # You can configure deprecated constants.
155
100
  # If there is an alternative method, you can set alternative value as `Alternative`.
156
101
  # And you can set the deprecated version as `DeprecatedVersion`.
@@ -185,222 +130,121 @@ Lint/DeprecatedConstants:
185
130
  DeprecatedVersion: '3.0'
186
131
 
187
132
  Lint/DeprecatedOpenSSLConstant:
188
- Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
189
133
  Enabled: true
190
- VersionAdded: '0.84'
191
134
 
192
135
  Lint/DisjunctiveAssignmentInConstructor:
193
- Description: 'In constructor, plain assignment is preferred over disjunctive.'
194
136
  Enabled: true
195
- Safe: false
196
- VersionAdded: '0.62'
197
- VersionChanged: '0.88'
198
137
 
199
138
  Lint/DuplicateBranch:
200
- Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
201
139
  Enabled: true
202
- VersionAdded: '1.3'
203
- VersionChanged: '1.7'
204
140
  IgnoreLiteralBranches: true
205
141
  IgnoreConstantBranches: true
206
142
 
207
143
  Lint/DuplicateCaseCondition:
208
- Description: 'Do not repeat values in case conditionals.'
209
144
  Enabled: true
210
- VersionAdded: '0.45'
211
145
 
212
146
  Lint/DuplicateElsifCondition:
213
- Description: 'Do not repeat conditions used in if `elsif`.'
214
147
  Enabled: true
215
- VersionAdded: '0.88'
216
148
 
217
149
  Lint/DuplicateHashKey:
218
- Description: 'Check for duplicate keys in hash literals.'
219
150
  Enabled: true
220
- VersionAdded: '0.34'
221
- VersionChanged: '0.77'
222
151
 
223
152
  Lint/DuplicateMagicComment:
224
- Description: 'Check for duplicated magic comments.'
225
153
  Enabled: true
226
- VersionAdded: '1.37'
227
154
 
228
155
  Lint/DuplicateMatchPattern:
229
- Description: Do not repeat patterns in `in` keywords.
230
156
  Enabled: true
231
- VersionAdded: '1.50'
232
157
 
233
158
  Lint/DuplicateMethods:
234
- Description: 'Check for duplicate method definitions.'
235
159
  Enabled: true
236
- VersionAdded: '0.29'
237
160
 
238
161
  Lint/DuplicateRegexpCharacterClassElement:
239
- Description: 'Checks for duplicate elements in Regexp character classes.'
240
162
  Enabled: true
241
- VersionAdded: '1.1'
242
163
 
243
164
  Lint/DuplicateRequire:
244
- Description: 'Check for duplicate `require`s and `require_relative`s.'
245
165
  Enabled: true
246
- VersionAdded: '0.90'
247
- VersionChanged: '1.28'
248
166
 
249
167
  Lint/DuplicateRescueException:
250
- Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
251
168
  Enabled: true
252
- VersionAdded: '0.89'
253
169
 
254
170
  Lint/EachWithObjectArgument:
255
- Description: 'Check for immutable argument given to each_with_object.'
256
171
  Enabled: true
257
- VersionAdded: '0.31'
258
172
 
259
173
  Lint/ElseLayout:
260
- Description: 'Check for odd code arrangement in an else block.'
261
174
  Enabled: true
262
- VersionAdded: '0.17'
263
- VersionChanged: '1.2'
264
175
 
265
176
  Lint/EmptyBlock:
266
- Description: 'Checks for blocks without a body.'
267
177
  Enabled: true
268
- VersionAdded: '1.1'
269
- VersionChanged: '1.15'
270
178
  AllowComments: true
271
179
  AllowEmptyLambdas: true
272
180
 
273
181
  Lint/EmptyClass:
274
- Description: 'Checks for classes and metaclasses without a body.'
275
182
  Enabled: true
276
- VersionAdded: '1.3'
277
183
  AllowComments: true
278
184
 
279
185
  Lint/EmptyConditionalBody:
280
- Description: 'Checks for the presence of `if`, `elsif` and `unless` branches without a body.'
281
186
  Enabled: true
282
187
  AllowComments: true
283
- VersionAdded: '0.89'
284
- VersionChanged: '1.34'
285
188
 
286
189
  Lint/EmptyEnsure:
287
- Description: 'Checks for empty ensure block.'
288
190
  Enabled: true
289
- VersionAdded: '0.10'
290
- VersionChanged: '0.48'
291
191
 
292
192
  Lint/EmptyExpression:
293
- Description: 'Checks for empty expressions.'
294
193
  Enabled: true
295
- VersionAdded: '0.45'
296
194
 
297
195
  Lint/EmptyFile:
298
- Description: 'Enforces that Ruby source files are not empty.'
299
196
  Enabled: true
300
197
  AllowComments: true
301
- VersionAdded: '0.90'
302
198
 
303
199
  Lint/EmptyInPattern:
304
- Description: 'Checks for the presence of `in` pattern branches without a body.'
305
200
  Enabled: true
306
201
  AllowComments: true
307
- VersionAdded: '1.16'
308
202
 
309
203
  Lint/EmptyInterpolation:
310
- Description: 'Checks for empty string interpolation.'
311
204
  Enabled: true
312
- VersionAdded: '0.20'
313
- VersionChanged: '0.45'
314
205
 
315
206
  Lint/EmptyWhen:
316
- Description: 'Checks for `when` branches with empty bodies.'
317
207
  Enabled: true
318
208
  AllowComments: true
319
- VersionAdded: '0.45'
320
- VersionChanged: '0.83'
321
209
 
322
210
  Lint/EnsureReturn:
323
- Description: 'Do not use return in an ensure block.'
324
- StyleGuide: '#no-return-ensure'
325
211
  Enabled: true
326
- VersionAdded: '0.9'
327
- VersionChanged: '0.83'
328
212
 
329
213
  Lint/ErbNewArguments:
330
- Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
331
214
  Enabled: true
332
- VersionAdded: '0.56'
333
215
 
334
216
  Lint/FlipFlop:
335
- Description: 'Checks for flip-flops.'
336
- StyleGuide: '#no-flip-flops'
337
217
  Enabled: true
338
- VersionAdded: '0.16'
339
218
 
340
219
  Lint/FloatComparison:
341
- Description: 'Checks for the presence of precise comparison of floating point numbers.'
342
- StyleGuide: '#float-comparison'
343
220
  Enabled: true
344
- VersionAdded: '0.89'
345
221
 
346
222
  Lint/FloatOutOfRange:
347
- Description: >-
348
- Catches floating-point literals too large or small for Ruby to
349
- represent.
350
223
  Enabled: true
351
- VersionAdded: '0.36'
352
224
 
353
225
  Lint/FormatParameterMismatch:
354
- Description: 'The number of parameters to format/sprint must match the fields.'
355
226
  Enabled: true
356
- VersionAdded: '0.33'
357
227
 
358
228
  Lint/HashCompareByIdentity:
359
- Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
360
- StyleGuide: '#identity-comparison'
361
229
  Enabled: true
362
- Safe: false
363
- VersionAdded: '0.93'
364
230
 
365
231
  Lint/HeredocMethodCallPosition:
366
- Description: >-
367
- Checks for the ordering of a method call where
368
- the receiver of the call is a HEREDOC.
369
232
  Enabled: true
370
- StyleGuide: '#heredoc-method-calls'
371
- VersionAdded: '0.68'
372
233
 
373
234
  Lint/IdentityComparison:
374
- Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
375
235
  Enabled: true
376
- StyleGuide: '#identity-comparison'
377
- VersionAdded: '0.91'
378
236
 
379
237
  Lint/ImplicitStringConcatenation:
380
- Description: >-
381
- Checks for adjacent string literals on the same line, which
382
- could better be represented as a single string literal.
383
238
  Enabled: true
384
- VersionAdded: '0.36'
385
239
 
386
240
  Lint/IncompatibleIoSelectWithFiberScheduler:
387
- Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
388
241
  Enabled: true
389
- VersionAdded: '1.21'
390
- VersionChanged: '1.24'
391
242
 
392
243
  Lint/IneffectiveAccessModifier:
393
- Description: >-
394
- Checks for attempts to use `private` or `protected` to set
395
- the visibility of a class method, which does not work.
396
244
  Enabled: true
397
- VersionAdded: '0.36'
398
245
 
399
246
  Lint/InheritException:
400
- Description: 'Avoid inheriting from the `Exception` class.'
401
247
  Enabled: true
402
- VersionAdded: '0.41'
403
- VersionChanged: '1.26'
404
248
  # The default base class in favour of `Exception`.
405
249
  EnforcedStyle: standard_error
406
250
  SupportedStyles:
@@ -408,41 +252,28 @@ Lint/InheritException:
408
252
  - runtime_error
409
253
 
410
254
  Lint/InterpolationCheck:
411
- Description: 'Checks for interpolation in a single quoted string.'
412
255
  Enabled: true
413
- VersionAdded: '0.50'
414
- VersionChanged: '1.40'
256
+
257
+ Lint/ItWithoutArgumentsInBlock:
258
+ Enabled: true
415
259
 
416
260
  Lint/LambdaWithoutLiteralBlock:
417
- Description: 'Checks uses of lambda without a literal block.'
418
261
  Enabled: true
419
- VersionAdded: '1.8'
420
262
 
421
263
  Lint/LiteralAsCondition:
422
- Description: 'Checks of literals used in conditions.'
423
264
  Enabled: true
424
- VersionAdded: '0.51'
265
+
266
+ Lint/LiteralAssignmentInCondition:
267
+ Enabled: true
425
268
 
426
269
  Lint/LiteralInInterpolation:
427
- Description: 'Checks for literals used in interpolation.'
428
270
  Enabled: true
429
- VersionAdded: '0.19'
430
- VersionChanged: '0.32'
431
271
 
432
272
  Lint/Loop:
433
- Description: >-
434
- Use Kernel#loop with break rather than begin/end/until or
435
- begin/end/while for post-loop tests.
436
- StyleGuide: '#loop-with-break'
437
273
  Enabled: true
438
- VersionAdded: '0.9'
439
- VersionChanged: '1.3'
440
- Safe: false
441
274
 
442
275
  Lint/MissingCopEnableDirective:
443
- Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
444
276
  Enabled: true
445
- VersionAdded: '0.52'
446
277
  # Maximum number of consecutive lines the cop can be disabled for.
447
278
  # 0 allows only single-line disables
448
279
  # 1 would mean the maximum allowed is the following:
@@ -453,78 +284,43 @@ Lint/MissingCopEnableDirective:
453
284
  MaximumRangeSize: .inf
454
285
 
455
286
  Lint/MissingSuper:
456
- Description: >-
457
- Checks for the presence of constructors and lifecycle callbacks
458
- without calls to `super`.
459
287
  Enabled: true
460
- VersionAdded: '0.89'
461
- VersionChanged: '1.4'
462
288
 
463
289
  Lint/MixedCaseRange:
464
- Description: Checks for mixed-case character ranges since they include likely unintended
465
- characters.
466
290
  Enabled: true
467
- VersionAdded: '1.53'
468
291
 
469
292
  Lint/MixedRegexpCaptureTypes:
470
- Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
471
293
  Enabled: true
472
- VersionAdded: '0.85'
473
294
 
474
295
  Lint/MultipleComparison:
475
- Description: "Use `&&` operator to compare multiple values."
476
296
  Enabled: true
477
- VersionAdded: '0.47'
478
- VersionChanged: '1.1'
479
297
 
480
298
  Lint/NestedMethodDefinition:
481
- Description: 'Do not use nested method definitions.'
482
- StyleGuide: '#no-nested-methods'
483
299
  Enabled: true
484
300
  AllowedMethods: [ ]
485
301
  AllowedPatterns: [ ]
486
- VersionAdded: '0.32'
487
302
 
488
303
  Lint/NestedPercentLiteral:
489
- Description: 'Checks for nested percent literals.'
490
304
  Enabled: true
491
- VersionAdded: '0.52'
492
305
 
493
306
  Lint/NextWithoutAccumulator:
494
- Description: >-
495
- Do not omit the accumulator when calling `next`
496
- in a `reduce`/`inject` block.
497
307
  Enabled: true
498
- VersionAdded: '0.36'
499
308
 
500
309
  Lint/NoReturnInBeginEndBlocks:
501
- Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
502
310
  Enabled: true
503
- VersionAdded: '1.2'
504
311
 
505
312
  Lint/NonAtomicFileOperation:
506
- Description: Checks for non-atomic file operations.
507
- StyleGuide: '#atomic-file-operations'
508
313
  Enabled: true
509
- VersionAdded: '1.31'
510
314
 
511
315
  Lint/NonDeterministicRequireOrder:
512
- Description: 'Always sort arrays returned by Dir.glob when requiring files.'
513
316
  # Enabled for all ruby versions old than v3.0
514
317
  Enabled: <%= ENV['RUBY_MAJOR'].to_f < 3.0 %>
515
- VersionAdded: '0.78'
516
- Safe: false
517
318
 
518
319
  Lint/NonLocalExitFromIterator:
519
- Description: 'Do not use return in iterator to cause non-local exit.'
520
320
  Enabled: true
521
- VersionAdded: '0.30'
522
321
 
523
322
  Lint/NumberConversion:
524
- Description: 'Checks unsafe usage of number conversion methods.'
525
323
  Enabled: false
526
- VersionAdded: '0.53'
527
- VersionChanged: '1.1'
528
324
  # Add Rails' duration methods to the ignore list for `Lint/NumberConversion`
529
325
  # so that calling `to_i` on one of these does not register an offense.
530
326
  # See: https://github.com/rubocop/rubocop/issues/8950
@@ -550,101 +346,52 @@ Lint/NumberConversion:
550
346
  - DateTime
551
347
 
552
348
  Lint/NumberedParameterAssignment:
553
- Description: 'Checks for uses of numbered parameter assignment.'
554
349
  Enabled: true
555
- VersionAdded: '1.9'
556
350
 
557
351
  Lint/OrAssignmentToConstant:
558
- Description: 'Checks unintended or-assignment to constant.'
559
352
  Enabled: true
560
- Safe: false
561
- VersionAdded: '1.9'
562
353
 
563
354
  Lint/OrderedMagicComments:
564
- Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
565
355
  Enabled: true
566
- VersionAdded: '0.53'
567
- VersionChanged: '1.37'
568
356
 
569
357
  Lint/OutOfRangeRegexpRef:
570
- Description: 'Checks for out of range reference for Regexp because it always returns nil.'
571
358
  Enabled: true
572
- Safe: false
573
- VersionAdded: '0.89'
574
359
 
575
360
  Lint/ParenthesesAsGroupedExpression:
576
- Description: >-
577
- Checks for method calls with a space before the opening
578
- parenthesis.
579
- StyleGuide: '#parens-no-spaces'
580
361
  Enabled: true
581
- VersionAdded: '0.12'
582
- VersionChanged: '0.83'
583
362
 
584
363
  Lint/PercentStringArray:
585
- Description: >-
586
- Checks for unwanted commas and quotes in %w/%W literals.
587
364
  Enabled: true
588
- Safe: false
589
- VersionAdded: '0.41'
590
365
 
591
366
  Lint/PercentSymbolArray:
592
- Description: >-
593
- Checks for unwanted commas and colons in %i/%I literals.
594
367
  Enabled: true
595
- VersionAdded: '0.41'
596
368
 
597
369
  Lint/RaiseException:
598
- Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
599
- StyleGuide: '#raise-exception'
600
370
  Enabled: true
601
- Safe: false
602
- VersionAdded: '0.81'
603
- VersionChanged: '0.86'
604
371
  AllowedImplicitNamespaces:
605
372
  - 'Gem'
606
373
 
607
374
  Lint/RandOne:
608
- Description: >-
609
- Checks for `rand(1)` calls. Such calls always return `0`
610
- and most likely a mistake.
611
375
  Enabled: true
612
- VersionAdded: '0.36'
613
376
 
614
377
  Lint/RedundantCopDisableDirective:
615
- Description: >-
616
- Checks for rubocop:disable comments that can be removed.
617
- Note: this cop is not disabled when disabling all cops.
618
- It must be explicitly disabled.
619
378
  Enabled: true
620
- VersionAdded: '0.76'
621
379
 
622
380
  Lint/RedundantCopEnableDirective:
623
- Description: Checks for rubocop:enable comments that can be removed.
624
381
  Enabled: true
625
- VersionAdded: '0.76'
626
382
 
627
383
  Lint/RedundantDirGlobSort:
628
- Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
629
384
  # Enabled for all ruby versions 3+
630
385
  Enabled: <%= ENV['RUBY_MAJOR'].to_f >= 3.0 %>
631
- VersionAdded: '1.8'
632
- VersionChanged: '1.26'
633
386
 
634
387
  Lint/RedundantRegexpQuantifiers:
635
- Description: Checks for redundant quantifiers in Regexps.
636
388
  Enabled: true
637
- VersionAdded: '1.53'
638
389
 
639
390
  Lint/RedundantRequireStatement:
640
- Description: 'Checks for unnecessary `require` statement.'
641
391
  Enabled: true
642
- VersionAdded: '0.76'
643
392
 
644
393
  Lint/RedundantSafeNavigation:
645
- Description: 'Checks for redundant safe navigation calls.'
646
394
  Enabled: true
647
- VersionAdded: '0.93'
648
395
  AllowedMethods:
649
396
  - instance_of?
650
397
  - kind_of?
@@ -652,84 +399,46 @@ Lint/RedundantSafeNavigation:
652
399
  - eql?
653
400
  - respond_to?
654
401
  - equal?
655
- Safe: false
656
402
 
657
403
  Lint/RedundantSplatExpansion:
658
- Description: 'Checks for splat unnecessarily being called on literals.'
659
404
  Enabled: true
660
- VersionAdded: '0.76'
661
- VersionChanged: '1.7'
662
405
  AllowPercentLiteralArrayArgument: true
663
406
 
664
407
  Lint/RedundantStringCoercion:
665
- Description: 'Checks for Object#to_s usage in string interpolation.'
666
- StyleGuide: '#no-to-s'
667
408
  Enabled: true
668
- VersionAdded: '0.19'
669
- VersionChanged: '0.77'
670
409
 
671
410
  Lint/RedundantWithIndex:
672
- Description: 'Checks for redundant `with_index`.'
673
411
  Enabled: true
674
- VersionAdded: '0.50'
675
412
 
676
413
  Lint/RedundantWithObject:
677
- Description: 'Checks for redundant `with_object`.'
678
414
  Enabled: true
679
- VersionAdded: '0.51'
680
415
 
681
416
  Lint/RefinementImportMethods:
682
- Description: 'Use `Refinement#import_methods` when using `include` or `prepend` in `refine` block.'
683
417
  Enabled: true
684
- VersionAdded: '1.27'
685
418
 
686
419
  Lint/RegexpAsCondition:
687
- Description: >-
688
- Do not use regexp literal as a condition.
689
- The regexp literal matches `$_` implicitly.
690
420
  Enabled: true
691
- VersionAdded: '0.51'
692
- VersionChanged: '0.86'
693
421
 
694
422
  Lint/RequireParentheses:
695
- Description: >-
696
- Use parentheses in the method call to avoid confusion
697
- about precedence.
698
423
  Enabled: true
699
- VersionAdded: '0.18'
700
424
 
701
425
  Lint/RequireRangeParentheses:
702
- Description: 'Checks that a range literal is enclosed in parentheses when the end of the range is at a line break.'
703
426
  Enabled: true
704
- VersionAdded: '1.32'
705
427
 
706
428
  Lint/RequireRelativeSelfPath:
707
- Description: 'Checks for uses a file requiring itself with `require_relative`.'
708
429
  Enabled: true
709
- VersionAdded: '1.22'
710
430
 
711
431
  Lint/RescueException:
712
- Description: 'Avoid rescuing the Exception class.'
713
- StyleGuide: '#no-blind-rescues'
714
432
  Enabled: true
715
- VersionAdded: '0.9'
716
- VersionChanged: '0.27'
717
433
 
718
434
  Lint/RescueType:
719
- Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
720
435
  Enabled: true
721
- VersionAdded: '0.49'
722
436
 
723
437
  Lint/ReturnInVoidContext:
724
- Description: 'Checks for return in void context.'
725
438
  Enabled: true
726
- VersionAdded: '0.50'
727
439
 
728
440
  Lint/SafeNavigationChain:
729
- Description: 'Do not chain ordinary method call after safe navigation operator.'
730
441
  Enabled: true
731
- VersionAdded: '0.47'
732
- VersionChanged: '0.77'
733
442
  AllowedMethods:
734
443
  - present?
735
444
  - blank?
@@ -739,13 +448,7 @@ Lint/SafeNavigationChain:
739
448
  - in?
740
449
 
741
450
  Lint/SafeNavigationConsistency:
742
- Description: >-
743
- Check to make sure that if safe navigation is used for a method
744
- call in an `&&` or `||` condition that safe navigation is used
745
- for all method calls on that same object.
746
451
  Enabled: true
747
- VersionAdded: '0.55'
748
- VersionChanged: '0.77'
749
452
  AllowedMethods:
750
453
  - present?
751
454
  - blank?
@@ -754,112 +457,66 @@ Lint/SafeNavigationConsistency:
754
457
  - try!
755
458
 
756
459
  Lint/SafeNavigationWithEmpty:
757
- Description: 'Avoid `foo&.empty?` in conditionals.'
758
460
  Enabled: true
759
- VersionAdded: '0.62'
760
- VersionChanged: '0.87'
761
461
 
762
462
  Lint/ScriptPermission:
763
- Description: 'Grant script file execute permission.'
764
463
  Enabled: true
765
- VersionAdded: '0.49'
766
- VersionChanged: '0.50'
767
464
 
768
465
  Lint/SelfAssignment:
769
- Description: 'Checks for self-assignments.'
770
466
  Enabled: true
771
- VersionAdded: '0.89'
772
467
 
773
468
  Lint/SendWithMixinArgument:
774
- Description: 'Checks for `send` method when using mixin.'
775
469
  Enabled: true
776
- VersionAdded: '0.75'
777
470
 
778
471
  Lint/ShadowedArgument:
779
- Description: 'Avoid reassigning arguments before they were used.'
780
472
  Enabled: true
781
- VersionAdded: '0.52'
782
473
  IgnoreImplicitReferences: false
783
474
 
784
475
  Lint/ShadowedException:
785
- Description: >-
786
- Avoid rescuing a higher level exception
787
- before a lower level exception.
788
476
  Enabled: true
789
- VersionAdded: '0.41'
790
477
 
791
478
  Lint/ShadowingOuterLocalVariable:
792
- Description: >-
793
- Do not use the same name as outer local variable
794
- for block arguments or block local variables.
795
479
  Enabled: true
796
- VersionAdded: '0.9'
797
480
 
798
481
  Lint/StructNewOverride:
799
- Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
800
482
  Enabled: true
801
- VersionAdded: '0.81'
802
483
 
803
484
  Lint/SuppressedException:
804
- Description: "Don't suppress exceptions."
805
- StyleGuide: '#dont-hide-exceptions'
806
485
  Enabled: true
807
486
  AllowComments: true
808
487
  AllowNil: true
809
- VersionAdded: '0.9'
810
- VersionChanged: '1.12'
811
488
 
812
489
  Lint/SymbolConversion:
813
- Description: 'Checks for unnecessary symbol conversions.'
814
490
  Enabled: true
815
- VersionAdded: '1.9'
816
- VersionChanged: '1.16'
817
491
  EnforcedStyle: consistent
818
492
  SupportedStyles:
819
493
  - strict
820
494
  - consistent
821
495
 
822
496
  Lint/Syntax:
823
- Description: 'Checks for syntax errors.'
824
497
  Enabled: true
825
- VersionAdded: '0.9'
826
498
 
827
499
  Lint/ToEnumArguments:
828
- Description: 'Ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
829
500
  Enabled: true
830
- VersionAdded: '1.1'
831
501
 
832
502
  Lint/ToJSON:
833
- Description: 'Ensure #to_json includes an optional argument.'
834
503
  Enabled: true
835
- VersionAdded: '0.66'
836
504
 
837
505
  Lint/TopLevelReturnWithArgument:
838
- Description: 'Detects top level return statements with argument.'
839
506
  Enabled: true
840
- VersionAdded: '0.89'
841
507
 
842
508
  Lint/TrailingCommaInAttributeDeclaration:
843
- Description: 'Checks for trailing commas in attribute declarations.'
844
509
  Enabled: true
845
- VersionAdded: '0.90'
846
510
 
847
511
  Lint/TripleQuotes:
848
- Description: 'Checks for useless triple quote constructs.'
849
512
  Enabled: true
850
- VersionAdded: '1.9'
851
513
 
852
514
  Lint/UnderscorePrefixedVariableName:
853
- Description: 'Do not use prefix `_` for a variable that is used.'
854
515
  Enabled: true
855
- VersionAdded: '0.21'
856
516
  AllowKeywordBlockArguments: false
857
517
 
858
518
  Lint/UnexpectedBlockArity:
859
- Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
860
519
  Enabled: true
861
- Safe: false
862
- VersionAdded: '1.5'
863
520
  Methods:
864
521
  chunk_while: 2
865
522
  each_with_index: 2
@@ -873,118 +530,64 @@ Lint/UnexpectedBlockArity:
873
530
  sort: 2
874
531
 
875
532
  Lint/UnifiedInteger:
876
- Description: 'Use Integer instead of Fixnum or Bignum.'
877
533
  Enabled: true
878
- VersionAdded: '0.43'
879
534
 
880
535
  Lint/UnmodifiedReduceAccumulator:
881
- Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
882
536
  Enabled: true
883
- VersionAdded: '1.1'
884
- VersionChanged: '1.5'
885
537
 
886
538
  Lint/UnreachableCode:
887
- Description: 'Unreachable code.'
888
539
  Enabled: true
889
- VersionAdded: '0.9'
890
540
 
891
541
  Lint/UnreachableLoop:
892
- Description: 'Checks for loops that will have at most one iteration.'
893
542
  Enabled: true
894
- VersionAdded: '0.89'
895
- VersionChanged: '1.7'
896
543
  AllowedPatterns:
897
544
  # RSpec uses `times` in its message expectations
898
545
  # eg. `exactly(2).times`
899
546
  - !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
900
547
 
901
548
  Lint/UnusedBlockArgument:
902
- Description: 'Checks for unused block arguments.'
903
- StyleGuide: '#underscore-unused-vars'
904
549
  Enabled: true
905
- VersionAdded: '0.21'
906
- VersionChanged: '0.22'
907
550
  IgnoreEmptyBlocks: true
908
551
  AllowUnusedKeywordArguments: false
909
552
 
910
553
  Lint/UnusedMethodArgument:
911
- Description: 'Checks for unused method arguments.'
912
- StyleGuide: '#underscore-unused-vars'
913
554
  Enabled: true
914
- VersionAdded: '0.21'
915
- VersionChanged: '0.81'
916
555
  AllowUnusedKeywordArguments: false
917
556
  IgnoreEmptyMethods: true
918
557
  IgnoreNotImplementedMethods: true
919
558
 
920
559
  Lint/UriEscapeUnescape:
921
- Description: >-
922
- `URI.escape` method is obsolete and should not be used. Instead, use
923
- `CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component`
924
- depending on your specific use case.
925
- Also `URI.unescape` method is obsolete and should not be used. Instead, use
926
- `CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
927
- depending on your specific use case.
928
560
  Enabled: true
929
- VersionAdded: '0.50'
930
561
 
931
562
  Lint/UriRegexp:
932
- Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.'
933
563
  Enabled: true
934
- VersionAdded: '0.50'
935
564
 
936
565
  Lint/UselessAccessModifier:
937
- Description: 'Checks for useless access modifiers.'
938
566
  Enabled: true
939
- VersionAdded: '0.20'
940
- VersionChanged: '0.83'
941
567
  ContextCreatingMethods: [ ]
942
568
  MethodCreatingMethods: [ ]
943
569
 
944
570
  Lint/UselessAssignment:
945
- Description: 'Checks for useless assignment to a local variable.'
946
- StyleGuide: '#underscore-unused-vars'
947
571
  Enabled: true
948
- VersionAdded: '0.11'
949
572
 
950
573
  Lint/UselessElseWithoutRescue:
951
- Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
952
574
  Enabled: true
953
- VersionAdded: '0.17'
954
- VersionChanged: '1.31'
955
575
 
956
576
  Lint/UselessMethodDefinition:
957
- Description: 'Checks for useless method definitions.'
958
577
  Enabled: true
959
- VersionAdded: '0.90'
960
- VersionChanged: '0.91'
961
- Safe: false
962
578
 
963
579
  Lint/UselessRescue:
964
- Description: 'Checks for useless `rescue`s, which only reraise rescued exceptions.'
965
580
  Enabled: true
966
- VersionAdded: '1.43'
967
581
 
968
582
  Lint/UselessRuby2Keywords:
969
- Description: 'Finds unnecessary uses of `ruby2_keywords`.'
970
583
  Enabled: true
971
- VersionAdded: '1.23'
972
584
 
973
585
  Lint/UselessSetterCall:
974
- Description: 'Checks for useless setter call to a local variable.'
975
586
  Enabled: true
976
- VersionAdded: '0.13'
977
- VersionChanged: '1.2'
978
- Safe: false
979
587
 
980
588
  Lint/UselessTimes:
981
- Description: 'Checks for useless `Integer#times` calls.'
982
589
  Enabled: true
983
- VersionAdded: '0.91'
984
- Safe: false
985
590
 
986
591
  Lint/Void:
987
- Description: 'Possible use of operator/literal/variable in void context.'
988
592
  Enabled: true
989
- VersionAdded: '0.9'
990
593
  CheckForMethodsWithNoSideEffects: false