chefstyle 1.1.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 423500f6eb097e6b1d618a9af1f2709e2185c61bb2ad1f98d2c2796827d14f0e
4
- data.tar.gz: 915a023dceef60d5e35e783cc6415751f1008ba55bb0e10a8b92620e2ac2f13d
3
+ metadata.gz: 066e8ac793f64512443174f9e09c8919b03bbe9559a16a041e8d986f95de3278
4
+ data.tar.gz: 72e56fd44dac3fd344959b2920611ead077ff18b2517b6b2fedd545375041190
5
5
  SHA512:
6
- metadata.gz: f5db0b4e3239e1243fd6947f0b99198a28984552cce90d4ba36c1a58b712390a65b5047966d67fdf5f8a7bf5052d20b6febde5b12851e2e8c30ccf947717c9c7
7
- data.tar.gz: 16c99a1b36cb3d3347120e242cf2719b1276f25bfa52ff07ece52f561ba5a351f9eb5f8e635a313a4a63dda55b4847ef330f815217ba116c095242a7cadb3c09
6
+ metadata.gz: ef9db45e45112086e38e265ceb5c745010c18265b4b12e0096b38112ad91dca303cf9f469e2f8fdb60d73659ead6eb2a59591a440554a59a6b4f9b4494d1c9f8
7
+ data.tar.gz: ebd7a40b197ec5f97f19b5ed4f57af9e74254fb05641cda8734719c43e9b89aaf2a3fab937d118be2f1808a43f0c77f2151548808be9d0dba45e94e7bc8cacf9
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
- # -*- encoding: utf-8 -*-
3
-
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), %w{.. lib})
2
+ # frozen_string_literal: true
3
+ $LOAD_PATH.unshift File.join(__dir__, %w{.. lib})
5
4
 
6
5
  require "chefstyle"
7
6
 
@@ -1,5 +1,5 @@
1
- # coding: utf-8
2
- lib = File.expand_path("../lib", __FILE__)
1
+ # frozen_string_literal: true
2
+ lib = File.expand_path("lib", __dir__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require "chefstyle/version"
5
5
 
@@ -18,8 +18,5 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = %w{chefstyle}
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler"
22
- spec.add_development_dependency "rake", ">= 12.0"
23
- spec.add_development_dependency "rspec"
24
21
  spec.add_dependency("rubocop", Chefstyle::RUBOCOP_VERSION)
25
22
  end
@@ -482,11 +482,15 @@ Style/WhileUntilModifier:
482
482
  Style/WordArray:
483
483
  Enabled: true
484
484
 
485
+ # we are ruby > 2.0 only so we can remove encoding comments for utf-8
486
+ Style/Encoding:
487
+ Enabled: true
488
+
485
489
  #
486
490
  # Disabled Style
487
491
  #
488
492
 
489
- # FIXME: we need to enable this
493
+ # reduces memory usage, but isn't a simple autocorrect so we need to do this one project at a time
490
494
  Style/FrozenStringLiteralComment:
491
495
  Enabled: false
492
496
 
@@ -529,10 +533,6 @@ Style/FormatString:
529
533
  Style/IfUnlessModifier:
530
534
  Enabled: false
531
535
 
532
- # we are ruby > 2.0 only so can disable the Encoding cop
533
- Style/Encoding:
534
- Enabled: false
535
-
536
536
  # Dan is -1 on this one: https://github.com/chef/chef/pull/4526#issuecomment-179950045
537
537
  Layout/IndentFirstHashElement:
538
538
  Enabled: false
@@ -554,7 +554,7 @@ Style/RescueModifier:
554
554
  Style/AsciiComments:
555
555
  Enabled: false
556
556
 
557
- # Parens around ternaries often make them more readable and reduces cognitive load over operator precidence
557
+ # Parens around ternaries often make them more readable and reduces cognitive load over operator precedence
558
558
  Style/TernaryParentheses:
559
559
  Enabled: false
560
560
 
@@ -631,4 +631,60 @@ Style/CommentedKeyword:
631
631
 
632
632
  # make sure we catch this Ruby 3.0 breaking change now
633
633
  Lint/DeprecatedOpenSSLConstant:
634
- Enabled: true
634
+ Enabled: true
635
+
636
+ # alert on invalid ruby synatx
637
+ Lint/Syntax:
638
+ Enabled: true
639
+
640
+ # remove extra requires like 'thread'
641
+ Lint/RedundantRequireStatement:
642
+ Enabled: true
643
+
644
+ # simplify stripping strings
645
+ Style/Strip:
646
+ Enabled: true
647
+
648
+ # simplify getting min/max
649
+ Style/RedundantSort:
650
+ Enabled: true
651
+
652
+ # no need for .rb in requires
653
+ Style/RedundantFileExtensionInRequire:
654
+ Enabled: true
655
+
656
+ # more code you don't need
657
+ Style/RedundantCondition:
658
+ Enabled: true
659
+
660
+ # Use __dir__ to simplify things
661
+ Style/Dir:
662
+ Enabled: true
663
+
664
+ # Use __FILE__ or __dir__ to simplify expand_paths
665
+ Style/ExpandPathArguments:
666
+ Enabled: true
667
+
668
+ ChefRuby/Ruby27KeywordArgumentWarnings:
669
+ Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
670
+ Enabled: true
671
+ VersionAdded: '1.3.0'
672
+
673
+ ChefRuby/UnlessDefinedRequire:
674
+ Description: Workaround RubyGems' slow requires by only running require if the constant isn't already defined
675
+ Enabled: true
676
+ VersionAdded: '1.3.0'
677
+ Include:
678
+ - 'lib/**/*'
679
+
680
+ ChefRuby/GemspecRequireRubygems:
681
+ Description: Rubygems does not need to be required in a Gemspec
682
+ Enabled: true
683
+ VersionAdded: '1.3.0'
684
+ Include:
685
+ - '**/*.gemspec'
686
+
687
+ ChefRuby/RequireNetHttps:
688
+ Description: net/https is deprecated and just includes net/http and openssl. We should include those directly instead
689
+ Enabled: true
690
+ VersionAdded: '1.3.0'
@@ -25,6 +25,8 @@ Layout/ArrayAlignment:
25
25
  Enabled: false
26
26
  Layout/AssignmentIndentation:
27
27
  Enabled: false
28
+ Layout/BeginEndAlignment:
29
+ Enabled: false
28
30
  Layout/BlockAlignment:
29
31
  Enabled: false
30
32
  Layout/BlockEndNewline:
@@ -53,6 +55,8 @@ Layout/EmptyLineAfterGuardClause:
53
55
  Enabled: false
54
56
  Layout/EmptyLineAfterMagicComment:
55
57
  Enabled: false
58
+ Layout/EmptyLineAfterMultilineCondition:
59
+ Enabled: false
56
60
  Layout/EmptyLineBetweenDefs:
57
61
  Enabled: false
58
62
  Layout/EmptyLinesAroundAccessModifier:
@@ -207,10 +211,14 @@ Lint/AssignmentInCondition:
207
211
  Enabled: false
208
212
  Lint/BigDecimalNew:
209
213
  Enabled: false
214
+ Lint/BinaryOperatorWithIdenticalOperands:
215
+ Enabled: false
210
216
  Lint/BooleanSymbol:
211
217
  Enabled: false
212
218
  Lint/CircularArgumentReference:
213
219
  Enabled: false
220
+ Lint/ConstantDefinitionInBlock:
221
+ Enabled: false
214
222
  Lint/ConstantResolution:
215
223
  Enabled: false
216
224
  Lint/Debugger:
@@ -223,18 +231,28 @@ Lint/DisjunctiveAssignmentInConstructor:
223
231
  Enabled: false
224
232
  Lint/DuplicateCaseCondition:
225
233
  Enabled: false
234
+ Lint/DuplicateElsifCondition:
235
+ Enabled: false
226
236
  Lint/DuplicateHashKey:
227
237
  Enabled: false
228
238
  Lint/DuplicateMethods:
229
239
  Enabled: false
240
+ Lint/DuplicateRequire:
241
+ Enabled: false
242
+ Lint/DuplicateRescueException:
243
+ Enabled: false
230
244
  Lint/EachWithObjectArgument:
231
245
  Enabled: false
232
246
  Lint/ElseLayout:
233
247
  Enabled: false
248
+ Lint/EmptyConditionalBody:
249
+ Enabled: false
234
250
  Lint/EmptyEnsure:
235
251
  Enabled: false
236
252
  Lint/EmptyExpression:
237
253
  Enabled: false
254
+ Lint/EmptyFile:
255
+ Enabled: false
238
256
  Lint/EmptyInterpolation:
239
257
  Enabled: false
240
258
  Lint/EmptyWhen:
@@ -245,12 +263,16 @@ Lint/ErbNewArguments:
245
263
  Enabled: false
246
264
  Lint/FlipFlop:
247
265
  Enabled: false
266
+ Lint/FloatComparison:
267
+ Enabled: false
248
268
  Lint/FloatOutOfRange:
249
269
  Enabled: false
250
270
  Lint/FormatParameterMismatch:
251
271
  Enabled: false
252
272
  Lint/HeredocMethodCallPosition:
253
273
  Enabled: false
274
+ Lint/IdentityComparison:
275
+ Enabled: false
254
276
  Lint/ImplicitStringConcatenation:
255
277
  Enabled: false
256
278
  Lint/InheritException:
@@ -267,6 +289,8 @@ Lint/Loop:
267
289
  Enabled: false
268
290
  Lint/MissingCopEnableDirective:
269
291
  Enabled: false
292
+ Lint/MissingSuper:
293
+ Enabled: false
270
294
  Lint/MixedRegexpCaptureTypes:
271
295
  Enabled: false
272
296
  Lint/MultipleComparison:
@@ -285,6 +309,8 @@ Lint/NumberConversion:
285
309
  Enabled: false
286
310
  Lint/OrderedMagicComments:
287
311
  Enabled: false
312
+ Lint/OutOfRangeRegexpRef:
313
+ Enabled: false
288
314
  Lint/ParenthesesAsGroupedExpression:
289
315
  Enabled: false
290
316
  Lint/PercentStringArray:
@@ -327,6 +353,8 @@ Lint/SafeNavigationWithEmpty:
327
353
  Enabled: false
328
354
  Lint/ScriptPermission:
329
355
  Enabled: false
356
+ Lint/SelfAssignment:
357
+ Enabled: false
330
358
  Lint/SendWithMixinArgument:
331
359
  Enabled: false
332
360
  Lint/ShadowedArgument:
@@ -343,12 +371,18 @@ Lint/Syntax:
343
371
  Enabled: false
344
372
  Lint/ToJSON:
345
373
  Enabled: false
374
+ Lint/TopLevelReturnWithArgument:
375
+ Enabled: false
376
+ Lint/TrailingCommaInAttributeDeclaration:
377
+ Enabled: false
346
378
  Lint/UnderscorePrefixedVariableName:
347
379
  Enabled: false
348
380
  Lint/UnifiedInteger:
349
381
  Enabled: false
350
382
  Lint/UnreachableCode:
351
383
  Enabled: false
384
+ Lint/UnreachableLoop:
385
+ Enabled: false
352
386
  Lint/UnusedBlockArgument:
353
387
  Enabled: false
354
388
  Lint/UnusedMethodArgument:
@@ -361,12 +395,14 @@ Lint/UselessAccessModifier:
361
395
  Enabled: false
362
396
  Lint/UselessAssignment:
363
397
  Enabled: false
364
- Lint/UselessComparison:
365
- Enabled: false
366
398
  Lint/UselessElseWithoutRescue:
367
399
  Enabled: false
400
+ Lint/UselessMethodDefinition:
401
+ Enabled: false
368
402
  Lint/UselessSetterCall:
369
403
  Enabled: false
404
+ Lint/UselessTimes:
405
+ Enabled: false
370
406
  Lint/Void:
371
407
  Enabled: false
372
408
  Metrics/CyclomaticComplexity:
@@ -421,10 +457,14 @@ Naming/VariableNumber:
421
457
  Enabled: false
422
458
  Style/AccessModifierDeclarations:
423
459
  Enabled: false
460
+ Style/AccessorGrouping:
461
+ Enabled: false
424
462
  Style/Alias:
425
463
  Enabled: false
426
464
  Style/AndOr:
427
465
  Enabled: false
466
+ Style/ArrayCoercion:
467
+ Enabled: false
428
468
  Style/ArrayJoin:
429
469
  Enabled: false
430
470
  Style/AsciiComments:
@@ -437,12 +477,16 @@ Style/BarePercentLiterals:
437
477
  Enabled: false
438
478
  Style/BeginBlock:
439
479
  Enabled: false
480
+ Style/BisectedAttrAccessor:
481
+ Enabled: false
440
482
  Style/BlockComments:
441
483
  Enabled: false
442
484
  Style/BlockDelimiters:
443
485
  Enabled: false
444
486
  Style/CaseEquality:
445
487
  Enabled: false
488
+ Style/CaseLikeIf:
489
+ Enabled: false
446
490
  Style/CharacterLiteral:
447
491
  Enabled: false
448
492
  Style/ClassAndModuleChildren:
@@ -451,6 +495,8 @@ Style/ClassCheck:
451
495
  Enabled: false
452
496
  Style/ClassMethods:
453
497
  Enabled: false
498
+ Style/ClassMethodsDefinitions:
499
+ Enabled: false
454
500
  Style/ClassVars:
455
501
  Enabled: false
456
502
  Style/CollectionMethods:
@@ -459,6 +505,8 @@ Style/ColonMethodCall:
459
505
  Enabled: false
460
506
  Style/ColonMethodDefinition:
461
507
  Enabled: false
508
+ Style/CombinableLoops:
509
+ Enabled: false
462
510
  Style/CommandLiteral:
463
511
  Enabled: false
464
512
  Style/CommentAnnotation:
@@ -513,6 +561,8 @@ Style/EvenOdd:
513
561
  Enabled: false
514
562
  Style/ExpandPathArguments:
515
563
  Enabled: false
564
+ Style/ExplicitBlockArgument:
565
+ Enabled: false
516
566
  Style/ExponentialNotation:
517
567
  Enabled: false
518
568
  Style/FloatDivision:
@@ -525,12 +575,18 @@ Style/FormatStringToken:
525
575
  Enabled: false
526
576
  Style/FrozenStringLiteralComment:
527
577
  Enabled: false
578
+ Style/GlobalStdStream:
579
+ Enabled: false
528
580
  Style/GlobalVars:
529
581
  Enabled: false
530
582
  Style/GuardClause:
531
583
  Enabled: false
584
+ Style/HashAsLastArrayItem:
585
+ Enabled: false
532
586
  Style/HashEachMethods:
533
587
  Enabled: false
588
+ Style/HashLikeCase:
589
+ Enabled: false
534
590
  Style/HashSyntax:
535
591
  Enabled: false
536
592
  Style/HashTransformKeys:
@@ -557,6 +613,8 @@ Style/InlineComment:
557
613
  Enabled: false
558
614
  Style/IpAddresses:
559
615
  Enabled: false
616
+ Style/KeywordParametersOrder:
617
+ Enabled: false
560
618
  Style/Lambda:
561
619
  Enabled: false
562
620
  Style/LambdaCall:
@@ -567,14 +625,20 @@ Style/MethodCallWithoutArgsParentheses:
567
625
  Enabled: false
568
626
  Style/MethodCallWithArgsParentheses:
569
627
  Enabled: false
628
+ Style/RedundantAssignment:
629
+ Enabled: false
570
630
  Style/RedundantFetchBlock:
571
631
  Enabled: false
632
+ Style/RedundantFileExtensionInRequire:
633
+ Enabled: false
634
+ Style/RedundantSelfAssignment:
635
+ Enabled: false
636
+ Style/SoleNestedConditional:
637
+ Enabled: false
572
638
  Style/MethodCalledOnDoEndBlock:
573
639
  Enabled: false
574
640
  Style/MethodDefParentheses:
575
641
  Enabled: false
576
- Style/MethodMissingSuper:
577
- Enabled: false
578
642
  Style/MinMax:
579
643
  Enabled: false
580
644
  Style/MissingElse:
@@ -639,6 +703,8 @@ Style/OptionHash:
639
703
  Enabled: false
640
704
  Style/OptionalArguments:
641
705
  Enabled: false
706
+ Style/OptionalBooleanParameter:
707
+ Enabled: false
642
708
  Style/ParallelAssignment:
643
709
  Enabled: false
644
710
  Style/ParenthesesAroundCondition:
@@ -707,6 +773,8 @@ Style/Send:
707
773
  Enabled: false
708
774
  Style/SignalException:
709
775
  Enabled: false
776
+ Style/SingleArgumentDig:
777
+ Enabled: false
710
778
  Style/SingleLineBlockParams:
711
779
  Enabled: false
712
780
  Style/SingleLineMethods:
@@ -719,6 +787,8 @@ Style/StabbyLambdaParentheses:
719
787
  Enabled: false
720
788
  Style/StderrPuts:
721
789
  Enabled: false
790
+ Style/StringConcatenation:
791
+ Enabled: false
722
792
  Style/StringHashKeys:
723
793
  Enabled: false
724
794
  Style/StringLiterals:
@@ -117,6 +117,8 @@ AllCops:
117
117
  # CacheRootDirectory is ~ (nil), which it is by default, the root will be
118
118
  # taken from the environment variable `$XDG_CACHE_HOME` if it is set, or if
119
119
  # `$XDG_CACHE_HOME` is not set, it will be `$HOME/.cache/`.
120
+ # The CacheRootDirectory can be overwritten by passing the `--cache-root` command
121
+ # line option or by setting `$RUBOCOP_CACHE_ROOT` environment variable.
120
122
  CacheRootDirectory: ~
121
123
  # It is possible for a malicious user to know the location of RuboCop's cache
122
124
  # directory by looking at CacheRootDirectory, and create a symlink in its
@@ -180,6 +182,9 @@ Bundler/OrderedGems:
180
182
  VersionAdded: '0.46'
181
183
  VersionChanged: '0.47'
182
184
  TreatCommentsAsGroupSeparators: true
185
+ # By default, "-" and "_" are ignored for order purposes.
186
+ # This can be overridden by setting this parameter to true.
187
+ ConsiderPunctuation: false
183
188
  Include:
184
189
  - '**/*.gemfile'
185
190
  - '**/Gemfile'
@@ -200,13 +205,17 @@ Gemspec/OrderedDependencies:
200
205
  Enabled: true
201
206
  VersionAdded: '0.51'
202
207
  TreatCommentsAsGroupSeparators: true
208
+ # By default, "-" and "_" are ignored for order purposes.
209
+ # This can be overridden by setting this parameter to true.
210
+ ConsiderPunctuation: false
203
211
  Include:
204
212
  - '**/*.gemspec'
205
213
 
206
214
  Gemspec/RequiredRubyVersion:
207
- Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
215
+ Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
208
216
  Enabled: true
209
217
  VersionAdded: '0.52'
218
+ VersionChanged: '0.89'
210
219
  Include:
211
220
  - '**/*.gemspec'
212
221
 
@@ -302,6 +311,19 @@ Layout/AssignmentIndentation:
302
311
  # But it can be overridden by setting this parameter
303
312
  IndentationWidth: ~
304
313
 
314
+ Layout/BeginEndAlignment:
315
+ Description: 'Align ends corresponding to begins correctly.'
316
+ Enabled: pending
317
+ VersionAdded: '0.91'
318
+ # The value `start_of_line` means that `end` should be aligned the start of the line
319
+ # where the `begin` keyword is.
320
+ # The value `begin` means that `end` should be aligned with the `begin` keyword.
321
+ EnforcedStyleAlignWith: start_of_line
322
+ SupportedStylesAlignWith:
323
+ - start_of_line
324
+ - begin
325
+ Severity: warning
326
+
305
327
  Layout/BlockAlignment:
306
328
  Description: 'Align block ends correctly.'
307
329
  Enabled: true
@@ -392,7 +414,6 @@ Layout/DefEndAlignment:
392
414
  SupportedStylesAlignWith:
393
415
  - start_of_line
394
416
  - def
395
- AutoCorrect: false
396
417
  Severity: warning
397
418
 
398
419
  Layout/DotPosition:
@@ -429,6 +450,14 @@ Layout/EmptyLineAfterMagicComment:
429
450
  Enabled: true
430
451
  VersionAdded: '0.49'
431
452
 
453
+ Layout/EmptyLineAfterMultilineCondition:
454
+ Description: 'Enforces empty line after multiline condition.'
455
+ # This is disabled, because this style is not very common in practice.
456
+ Enabled: false
457
+ VersionAdded: '0.90'
458
+ Reference:
459
+ - https://github.com/airbnb/ruby#multiline-if-newline
460
+
432
461
  Layout/EmptyLineBetweenDefs:
433
462
  Description: 'Use empty lines between defs.'
434
463
  StyleGuide: '#empty-lines-between-methods'
@@ -548,7 +577,6 @@ Layout/EndAlignment:
548
577
  - keyword
549
578
  - variable
550
579
  - start_of_line
551
- AutoCorrect: false
552
580
  Severity: warning
553
581
 
554
582
  Layout/EndOfLine:
@@ -1228,7 +1256,7 @@ Layout/SpaceInsideBlockBraces:
1228
1256
 
1229
1257
  Layout/SpaceInsideHashLiteralBraces:
1230
1258
  Description: "Use spaces inside hash literal braces - or don't."
1231
- StyleGuide: '#spaces-operators'
1259
+ StyleGuide: '#spaces-braces'
1232
1260
  Enabled: true
1233
1261
  VersionAdded: '0.49'
1234
1262
  EnforcedStyle: space
@@ -1349,6 +1377,12 @@ Lint/BigDecimalNew:
1349
1377
  Enabled: true
1350
1378
  VersionAdded: '0.53'
1351
1379
 
1380
+ Lint/BinaryOperatorWithIdenticalOperands:
1381
+ Description: 'This cop checks for places where binary operator has identical operands.'
1382
+ Enabled: pending
1383
+ Safe: false
1384
+ VersionAdded: '0.89'
1385
+
1352
1386
  Lint/BooleanSymbol:
1353
1387
  Description: 'Check for `:true` and `:false` symbols.'
1354
1388
  Enabled: true
@@ -1361,6 +1395,12 @@ Lint/CircularArgumentReference:
1361
1395
  Enabled: true
1362
1396
  VersionAdded: '0.33'
1363
1397
 
1398
+ Lint/ConstantDefinitionInBlock:
1399
+ Description: 'Do not define constants within a block.'
1400
+ StyleGuide: '#no-constant-definition-in-block'
1401
+ Enabled: pending
1402
+ VersionAdded: '0.91'
1403
+
1364
1404
  Lint/ConstantResolution:
1365
1405
  Description: 'Check that constants are fully qualified with `::`.'
1366
1406
  Enabled: false
@@ -1391,12 +1431,18 @@ Lint/DisjunctiveAssignmentInConstructor:
1391
1431
  Enabled: true
1392
1432
  Safe: false
1393
1433
  VersionAdded: '0.62'
1434
+ VersionChanged: '0.88'
1394
1435
 
1395
1436
  Lint/DuplicateCaseCondition:
1396
1437
  Description: 'Do not repeat values in case conditionals.'
1397
1438
  Enabled: true
1398
1439
  VersionAdded: '0.45'
1399
1440
 
1441
+ Lint/DuplicateElsifCondition:
1442
+ Description: 'Do not repeat conditions used in if `elsif`.'
1443
+ Enabled: 'pending'
1444
+ VersionAdded: '0.88'
1445
+
1400
1446
  Lint/DuplicateHashKey:
1401
1447
  Description: 'Check for duplicate keys in hash literals.'
1402
1448
  Enabled: true
@@ -1408,6 +1454,16 @@ Lint/DuplicateMethods:
1408
1454
  Enabled: true
1409
1455
  VersionAdded: '0.29'
1410
1456
 
1457
+ Lint/DuplicateRequire:
1458
+ Description: 'Check for duplicate `require`s and `require_relative`s.'
1459
+ Enabled: pending
1460
+ VersionAdded: '0.90'
1461
+
1462
+ Lint/DuplicateRescueException:
1463
+ Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
1464
+ Enabled: pending
1465
+ VersionAdded: '0.89'
1466
+
1411
1467
  Lint/EachWithObjectArgument:
1412
1468
  Description: 'Check for immutable argument given to each_with_object.'
1413
1469
  Enabled: true
@@ -1418,18 +1474,29 @@ Lint/ElseLayout:
1418
1474
  Enabled: true
1419
1475
  VersionAdded: '0.17'
1420
1476
 
1477
+ Lint/EmptyConditionalBody:
1478
+ Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
1479
+ Enabled: 'pending'
1480
+ AllowComments: true
1481
+ VersionAdded: '0.89'
1482
+
1421
1483
  Lint/EmptyEnsure:
1422
1484
  Description: 'Checks for empty ensure block.'
1423
1485
  Enabled: true
1424
1486
  VersionAdded: '0.10'
1425
1487
  VersionChanged: '0.48'
1426
- AutoCorrect: false
1427
1488
 
1428
1489
  Lint/EmptyExpression:
1429
1490
  Description: 'Checks for empty expressions.'
1430
1491
  Enabled: true
1431
1492
  VersionAdded: '0.45'
1432
1493
 
1494
+ Lint/EmptyFile:
1495
+ Description: 'Enforces that Ruby source files are not empty.'
1496
+ Enabled: pending
1497
+ AllowComments: true
1498
+ VersionAdded: '0.90'
1499
+
1433
1500
  Lint/EmptyInterpolation:
1434
1501
  Description: 'Checks for empty string interpolation.'
1435
1502
  Enabled: true
@@ -1461,6 +1528,12 @@ Lint/FlipFlop:
1461
1528
  Enabled: true
1462
1529
  VersionAdded: '0.16'
1463
1530
 
1531
+ Lint/FloatComparison:
1532
+ Description: 'Checks for the presence of precise comparison of floating point numbers.'
1533
+ StyleGuide: '#float-comparison'
1534
+ Enabled: pending
1535
+ VersionAdded: '0.89'
1536
+
1464
1537
  Lint/FloatOutOfRange:
1465
1538
  Description: >-
1466
1539
  Catches floating-point literals too large or small for Ruby to
@@ -1481,6 +1554,12 @@ Lint/HeredocMethodCallPosition:
1481
1554
  StyleGuide: '#heredoc-method-calls'
1482
1555
  VersionAdded: '0.68'
1483
1556
 
1557
+ Lint/IdentityComparison:
1558
+ Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
1559
+ Enabled: pending
1560
+ StyleGuide: '#identity-comparison'
1561
+ VersionAdded: '0.91'
1562
+
1484
1563
  Lint/ImplicitStringConcatenation:
1485
1564
  Description: >-
1486
1565
  Checks for adjacent string literals on the same line, which
@@ -1508,7 +1587,9 @@ Lint/InheritException:
1508
1587
  Lint/InterpolationCheck:
1509
1588
  Description: 'Raise warning for interpolation in single q strs.'
1510
1589
  Enabled: true
1590
+ Safe: false
1511
1591
  VersionAdded: '0.50'
1592
+ VersionChanged: '0.87'
1512
1593
 
1513
1594
  Lint/LiteralAsCondition:
1514
1595
  Description: 'Checks of literals used in conditions.'
@@ -1528,6 +1609,7 @@ Lint/Loop:
1528
1609
  StyleGuide: '#loop-with-break'
1529
1610
  Enabled: true
1530
1611
  VersionAdded: '0.9'
1612
+ VersionChanged: '0.89'
1531
1613
 
1532
1614
  Lint/MissingCopEnableDirective:
1533
1615
  Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
@@ -1542,6 +1624,13 @@ Lint/MissingCopEnableDirective:
1542
1624
  # .inf for any size
1543
1625
  MaximumRangeSize: .inf
1544
1626
 
1627
+ Lint/MissingSuper:
1628
+ Description: >-
1629
+ This cop checks for the presence of constructors and lifecycle callbacks
1630
+ without calls to `super`'.
1631
+ Enabled: pending
1632
+ VersionAdded: '0.89'
1633
+
1545
1634
  Lint/MixedRegexpCaptureTypes:
1546
1635
  Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
1547
1636
  Enabled: pending
@@ -1594,6 +1683,12 @@ Lint/OrderedMagicComments:
1594
1683
  Enabled: true
1595
1684
  VersionAdded: '0.53'
1596
1685
 
1686
+ Lint/OutOfRangeRegexpRef:
1687
+ Description: 'Checks for out of range reference for Regexp because it always returns nil.'
1688
+ Enabled: pending
1689
+ Safe: false
1690
+ VersionAdded: '0.89'
1691
+
1597
1692
  Lint/ParenthesesAsGroupedExpression:
1598
1693
  Description: >-
1599
1694
  Checks for method calls with a space before the opening
@@ -1716,6 +1811,7 @@ Lint/SafeNavigationChain:
1716
1811
  - presence
1717
1812
  - try
1718
1813
  - try!
1814
+ - in?
1719
1815
 
1720
1816
  Lint/SafeNavigationConsistency:
1721
1817
  Description: >-
@@ -1736,6 +1832,7 @@ Lint/SafeNavigationWithEmpty:
1736
1832
  Description: 'Avoid `foo&.empty?` in conditionals.'
1737
1833
  Enabled: true
1738
1834
  VersionAdded: '0.62'
1835
+ VersionChanged: '0.87'
1739
1836
 
1740
1837
  Lint/ScriptPermission:
1741
1838
  Description: 'Grant script file execute permission.'
@@ -1743,6 +1840,11 @@ Lint/ScriptPermission:
1743
1840
  VersionAdded: '0.49'
1744
1841
  VersionChanged: '0.50'
1745
1842
 
1843
+ Lint/SelfAssignment:
1844
+ Description: 'Checks for self-assignments.'
1845
+ Enabled: pending
1846
+ VersionAdded: '0.89'
1847
+
1746
1848
  Lint/SendWithMixinArgument:
1747
1849
  Description: 'Checks for `send` method when using mixin.'
1748
1850
  Enabled: true
@@ -1793,6 +1895,16 @@ Lint/ToJSON:
1793
1895
  Enabled: true
1794
1896
  VersionAdded: '0.66'
1795
1897
 
1898
+ Lint/TopLevelReturnWithArgument:
1899
+ Description: 'This cop detects top level return statements with argument.'
1900
+ Enabled: 'pending'
1901
+ VersionAdded: '0.89'
1902
+
1903
+ Lint/TrailingCommaInAttributeDeclaration:
1904
+ Description: 'This cop checks for trailing commas in attribute declarations.'
1905
+ Enabled: pending
1906
+ VersionAdded: '0.90'
1907
+
1796
1908
  Lint/UnderscorePrefixedVariableName:
1797
1909
  Description: 'Do not use prefix `_` for a variable that is used.'
1798
1910
  Enabled: true
@@ -1809,6 +1921,11 @@ Lint/UnreachableCode:
1809
1921
  Enabled: true
1810
1922
  VersionAdded: '0.9'
1811
1923
 
1924
+ Lint/UnreachableLoop:
1925
+ Description: 'This cop checks for loops that will have at most one iteration.'
1926
+ Enabled: pending
1927
+ VersionAdded: '0.89'
1928
+
1812
1929
  Lint/UnusedBlockArgument:
1813
1930
  Description: 'Checks for unused block arguments.'
1814
1931
  StyleGuide: '#underscore-unused-vars'
@@ -1858,16 +1975,18 @@ Lint/UselessAssignment:
1858
1975
  Enabled: true
1859
1976
  VersionAdded: '0.11'
1860
1977
 
1861
- Lint/UselessComparison:
1862
- Description: 'Checks for comparison of something with itself.'
1863
- Enabled: true
1864
- VersionAdded: '0.11'
1865
-
1866
1978
  Lint/UselessElseWithoutRescue:
1867
1979
  Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
1868
1980
  Enabled: true
1869
1981
  VersionAdded: '0.17'
1870
1982
 
1983
+ Lint/UselessMethodDefinition:
1984
+ Description: 'Checks for useless method definitions.'
1985
+ Enabled: pending
1986
+ VersionAdded: '0.90'
1987
+ Safe: false
1988
+ AllowComments: true
1989
+
1871
1990
  Lint/UselessSetterCall:
1872
1991
  Description: 'Checks for useless setter call to a local variable.'
1873
1992
  Enabled: true
@@ -1875,6 +1994,12 @@ Lint/UselessSetterCall:
1875
1994
  VersionChanged: '0.80'
1876
1995
  Safe: false
1877
1996
 
1997
+ Lint/UselessTimes:
1998
+ Description: 'Checks for useless `Integer#times` calls.'
1999
+ Enabled: pending
2000
+ VersionAdded: '0.91'
2001
+ Safe: false
2002
+
1878
2003
  Lint/Void:
1879
2004
  Description: 'Possible use of operator/literal/variable in void context.'
1880
2005
  Enabled: true
@@ -1896,15 +2021,16 @@ Metrics/AbcSize:
1896
2021
  # The ABC size is a calculated magnitude, so this number can be an Integer or
1897
2022
  # a Float.
1898
2023
  IgnoredMethods: []
1899
- Max: 15
2024
+ Max: 17
1900
2025
 
1901
2026
  Metrics/BlockLength:
1902
2027
  Description: 'Avoid long blocks with many lines.'
1903
2028
  Enabled: true
1904
2029
  VersionAdded: '0.44'
1905
- VersionChanged: '0.66'
2030
+ VersionChanged: '0.87'
1906
2031
  CountComments: false # count full line comments?
1907
2032
  Max: 25
2033
+ CountAsOne: []
1908
2034
  ExcludedMethods:
1909
2035
  # By default, exclude the `#refine` method, as it tends to have larger
1910
2036
  # associated blocks.
@@ -1925,8 +2051,10 @@ Metrics/ClassLength:
1925
2051
  Description: 'Avoid classes longer than 100 lines of code.'
1926
2052
  Enabled: true
1927
2053
  VersionAdded: '0.25'
2054
+ VersionChanged: '0.87'
1928
2055
  CountComments: false # count full line comments?
1929
2056
  Max: 100
2057
+ CountAsOne: []
1930
2058
 
1931
2059
  # Avoid complex methods.
1932
2060
  Metrics/CyclomaticComplexity:
@@ -1944,17 +2072,20 @@ Metrics/MethodLength:
1944
2072
  StyleGuide: '#short-methods'
1945
2073
  Enabled: true
1946
2074
  VersionAdded: '0.25'
1947
- VersionChanged: '0.59.2'
2075
+ VersionChanged: '0.87'
1948
2076
  CountComments: false # count full line comments?
1949
2077
  Max: 10
2078
+ CountAsOne: []
1950
2079
  ExcludedMethods: []
1951
2080
 
1952
2081
  Metrics/ModuleLength:
1953
2082
  Description: 'Avoid modules longer than 100 lines of code.'
1954
2083
  Enabled: true
1955
2084
  VersionAdded: '0.31'
2085
+ VersionChanged: '0.87'
1956
2086
  CountComments: false # count full line comments?
1957
2087
  Max: 100
2088
+ CountAsOne: []
1958
2089
 
1959
2090
  Metrics/ParameterLists:
1960
2091
  Description: 'Avoid parameter lists longer than three or four parameters.'
@@ -1972,7 +2103,7 @@ Metrics/PerceivedComplexity:
1972
2103
  VersionAdded: '0.25'
1973
2104
  VersionChanged: '0.81'
1974
2105
  IgnoredMethods: []
1975
- Max: 7
2106
+ Max: 8
1976
2107
 
1977
2108
  ################## Migration #############################
1978
2109
 
@@ -1992,10 +2123,12 @@ Naming/AccessorMethodName:
1992
2123
  VersionAdded: '0.50'
1993
2124
 
1994
2125
  Naming/AsciiIdentifiers:
1995
- Description: 'Use only ascii symbols in identifiers.'
2126
+ Description: 'Use only ascii symbols in identifiers and constants.'
1996
2127
  StyleGuide: '#english-identifiers'
1997
2128
  Enabled: true
1998
2129
  VersionAdded: '0.50'
2130
+ VersionChanged: '0.87'
2131
+ AsciiConstants: true
1999
2132
 
2000
2133
  Naming/BinaryOperatorParameterName:
2001
2134
  Description: 'When defining binary operators, name the argument other.'
@@ -2162,17 +2295,18 @@ Naming/MethodParameterName:
2162
2295
  AllowNamesEndingInNumbers: true
2163
2296
  # Allowed names that will not register an offense
2164
2297
  AllowedNames:
2165
- - io
2166
- - id
2167
- - to
2298
+ - at
2168
2299
  - by
2169
- - 'on'
2300
+ - db
2301
+ - id
2170
2302
  - in
2171
- - at
2303
+ - io
2172
2304
  - ip
2173
- - db
2305
+ - of
2306
+ - 'on'
2174
2307
  - os
2175
2308
  - pp
2309
+ - to
2176
2310
  # Forbidden names that will register an offense
2177
2311
  ForbiddenNames: []
2178
2312
 
@@ -2288,6 +2422,17 @@ Style/AccessModifierDeclarations:
2288
2422
  - group
2289
2423
  AllowModifiersOnSymbols: true
2290
2424
 
2425
+ Style/AccessorGrouping:
2426
+ Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
2427
+ Enabled: 'pending'
2428
+ VersionAdded: '0.87'
2429
+ EnforcedStyle: grouped
2430
+ SupportedStyles:
2431
+ # separated: each accessor goes in a separate statement.
2432
+ # grouped: accessors are grouped into a single statement.
2433
+ - separated
2434
+ - grouped
2435
+
2291
2436
  Style/Alias:
2292
2437
  Description: 'Use alias instead of alias_method.'
2293
2438
  StyleGuide: '#alias-method-lexically'
@@ -2312,6 +2457,15 @@ Style/AndOr:
2312
2457
  - always
2313
2458
  - conditionals
2314
2459
 
2460
+ Style/ArrayCoercion:
2461
+ Description: >-
2462
+ Use Array() instead of explicit Array check or [*var], when dealing
2463
+ with a variable you want to treat as an Array, but you're not certain it's an array.
2464
+ StyleGuide: '#array-coercion'
2465
+ Safe: false
2466
+ Enabled: 'pending'
2467
+ VersionAdded: '0.88'
2468
+
2315
2469
  Style/ArrayJoin:
2316
2470
  Description: 'Use Array#join instead of Array#*.'
2317
2471
  StyleGuide: '#array-join'
@@ -2355,6 +2509,13 @@ Style/BeginBlock:
2355
2509
  Enabled: true
2356
2510
  VersionAdded: '0.9'
2357
2511
 
2512
+ Style/BisectedAttrAccessor:
2513
+ Description: >-
2514
+ Checks for places where `attr_reader` and `attr_writer`
2515
+ for the same method can be combined into single `attr_accessor`.
2516
+ Enabled: 'pending'
2517
+ VersionAdded: '0.87'
2518
+
2358
2519
  Style/BlockComments:
2359
2520
  Description: 'Do not use block comments.'
2360
2521
  StyleGuide: '#no-block-comments'
@@ -2477,6 +2638,7 @@ Style/CaseEquality:
2477
2638
  StyleGuide: '#no-case-equality'
2478
2639
  Enabled: true
2479
2640
  VersionAdded: '0.9'
2641
+ VersionChanged: '0.89'
2480
2642
  # If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
2481
2643
  # the case equality operator is a constant.
2482
2644
  #
@@ -2487,6 +2649,13 @@ Style/CaseEquality:
2487
2649
  # String === "string"
2488
2650
  AllowOnConstant: false
2489
2651
 
2652
+ Style/CaseLikeIf:
2653
+ Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
2654
+ StyleGuide: '#case-vs-if-else'
2655
+ Enabled: 'pending'
2656
+ Safe: false
2657
+ VersionAdded: '0.88'
2658
+
2490
2659
  Style/CharacterLiteral:
2491
2660
  Description: 'Checks for uses of character literals.'
2492
2661
  StyleGuide: '#no-character-literals'
@@ -2502,7 +2671,6 @@ Style/ClassAndModuleChildren:
2502
2671
  # have the knowledge to perform either operation safely and thus requires
2503
2672
  # manual oversight.
2504
2673
  SafeAutoCorrect: false
2505
- AutoCorrect: false
2506
2674
  Enabled: true
2507
2675
  VersionAdded: '0.19'
2508
2676
  #
@@ -2541,6 +2709,16 @@ Style/ClassMethods:
2541
2709
  VersionAdded: '0.9'
2542
2710
  VersionChanged: '0.20'
2543
2711
 
2712
+ Style/ClassMethodsDefinitions:
2713
+ Description: 'Enforces using `def self.method_name` or `class << self` to define class methods.'
2714
+ StyleGuide: '#def-self-class-methods'
2715
+ Enabled: false
2716
+ VersionAdded: '0.89'
2717
+ EnforcedStyle: def_self
2718
+ SupportedStyles:
2719
+ - def_self
2720
+ - self_class
2721
+
2544
2722
  Style/ClassVars:
2545
2723
  Description: 'Avoid the use of class variables.'
2546
2724
  StyleGuide: '#no-class-vars'
@@ -2581,6 +2759,14 @@ Style/ColonMethodDefinition:
2581
2759
  Enabled: true
2582
2760
  VersionAdded: '0.52'
2583
2761
 
2762
+ Style/CombinableLoops:
2763
+ Description: >-
2764
+ Checks for places where multiple consecutive loops over the same data
2765
+ can be combined into a single loop.
2766
+ Enabled: pending
2767
+ Safe: false
2768
+ VersionAdded: '0.90'
2769
+
2584
2770
  Style/CommandLiteral:
2585
2771
  Description: 'Use `` or %x around command literals.'
2586
2772
  StyleGuide: '#percent-x'
@@ -2729,6 +2915,7 @@ Style/DoubleNegation:
2729
2915
  VersionAdded: '0.19'
2730
2916
  VersionChanged: '0.84'
2731
2917
  EnforcedStyle: allowed_in_returns
2918
+ SafeAutoCorrect: false
2732
2919
  SupportedStyles:
2733
2920
  - allowed_in_returns
2734
2921
  - forbidden
@@ -2823,6 +3010,16 @@ Style/ExpandPathArguments:
2823
3010
  Enabled: true
2824
3011
  VersionAdded: '0.53'
2825
3012
 
3013
+ Style/ExplicitBlockArgument:
3014
+ Description: >-
3015
+ Consider using explicit block argument to avoid writing block literal
3016
+ that just passes its arguments to another block.
3017
+ StyleGuide: '#block-argument'
3018
+ Enabled: pending
3019
+ # May change the yielding arity.
3020
+ Safe: false
3021
+ VersionAdded: '0.89'
3022
+
2826
3023
  Style/ExponentialNotation:
2827
3024
  Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
2828
3025
  StyleGuide: '#exponential-notation'
@@ -2904,7 +3101,14 @@ Style/FrozenStringLiteralComment:
2904
3101
  # `never` will enforce that the frozen string literal comment does not
2905
3102
  # exist in a file.
2906
3103
  - never
2907
- Safe: false
3104
+ SafeAutoCorrect: false
3105
+
3106
+ Style/GlobalStdStream:
3107
+ Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
3108
+ StyleGuide: '#global-stdout'
3109
+ Enabled: pending
3110
+ VersionAdded: '0.89'
3111
+ SafeAutoCorrect: false
2908
3112
 
2909
3113
  Style/GlobalVars:
2910
3114
  Description: 'Do not introduce global variables.'
@@ -2925,6 +3129,18 @@ Style/GuardClause:
2925
3129
  # needs to have to trigger this cop
2926
3130
  MinBodyLength: 1
2927
3131
 
3132
+ Style/HashAsLastArrayItem:
3133
+ Description: >-
3134
+ Checks for presence or absence of braces around hash literal as a last
3135
+ array item depending on configuration.
3136
+ StyleGuide: '#hash-literal-as-last-array-item'
3137
+ Enabled: 'pending'
3138
+ VersionAdded: '0.88'
3139
+ EnforcedStyle: braces
3140
+ SupportedStyles:
3141
+ - braces
3142
+ - no_braces
3143
+
2928
3144
  Style/HashEachMethods:
2929
3145
  Description: 'Use Hash#each_key and Hash#each_value.'
2930
3146
  StyleGuide: '#hash-each'
@@ -2932,6 +3148,16 @@ Style/HashEachMethods:
2932
3148
  VersionAdded: '0.80'
2933
3149
  Safe: false
2934
3150
 
3151
+ Style/HashLikeCase:
3152
+ Description: >-
3153
+ Checks for places where `case-when` represents a simple 1:1
3154
+ mapping and can be replaced with a hash lookup.
3155
+ Enabled: 'pending'
3156
+ VersionAdded: '0.88'
3157
+ # `MinBranchesCount` defines the number of branches `case` needs to have
3158
+ # to trigger this cop
3159
+ MinBranchesCount: 3
3160
+
2935
3161
  Style/HashSyntax:
2936
3162
  Description: >-
2937
3163
  Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
@@ -2956,15 +3182,17 @@ Style/HashSyntax:
2956
3182
  PreferHashRocketsForNonAlnumEndingSymbols: false
2957
3183
 
2958
3184
  Style/HashTransformKeys:
2959
- Description: 'Prefer `transform_keys` over `each_with_object` and `map`.'
3185
+ Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
2960
3186
  Enabled: 'pending'
2961
3187
  VersionAdded: '0.80'
3188
+ VersionChanged: '0.90'
2962
3189
  Safe: false
2963
3190
 
2964
3191
  Style/HashTransformValues:
2965
- Description: 'Prefer `transform_values` over `each_with_object` and `map`.'
3192
+ Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
2966
3193
  Enabled: 'pending'
2967
3194
  VersionAdded: '0.80'
3195
+ VersionChanged: '0.90'
2968
3196
  Safe: false
2969
3197
 
2970
3198
  Style/IdenticalConditionalBranches:
@@ -2995,6 +3223,7 @@ Style/IfUnlessModifierOfIfUnless:
2995
3223
  Avoid modifier if/unless usage on conditionals.
2996
3224
  Enabled: true
2997
3225
  VersionAdded: '0.39'
3226
+ VersionChanged: '0.87'
2998
3227
 
2999
3228
  Style/IfWithSemicolon:
3000
3229
  Description: 'Do not use if x; .... Use the ternary operator instead.'
@@ -3060,6 +3289,12 @@ Style/IpAddresses:
3060
3289
  - "::"
3061
3290
  # :: is a valid IPv6 address, but could potentially be legitimately in code
3062
3291
 
3292
+ Style/KeywordParametersOrder:
3293
+ Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
3294
+ StyleGuide: '#keyword-parameters-order'
3295
+ Enabled: pending
3296
+ VersionAdded: '0.90'
3297
+
3063
3298
  Style/Lambda:
3064
3299
  Description: 'Use the new lambda literal syntax for single-line blocks.'
3065
3300
  StyleGuide: '#lambda-multi-line'
@@ -3138,12 +3373,6 @@ Style/MethodDefParentheses:
3138
3373
  - require_no_parentheses
3139
3374
  - require_no_parentheses_except_multiline
3140
3375
 
3141
- Style/MethodMissingSuper:
3142
- Description: Checks for `method_missing` to call `super`.
3143
- StyleGuide: '#no-method-missing'
3144
- Enabled: true
3145
- VersionAdded: '0.56'
3146
-
3147
3376
  Style/MinMax:
3148
3377
  Description: >-
3149
3378
  Use `Enumerable#minmax` instead of `Enumerable#min`
@@ -3439,7 +3668,6 @@ Style/NumericPredicate:
3439
3668
  # object. Switching these methods has to be done with knowledge of the types
3440
3669
  # of the variables which rubocop doesn't have.
3441
3670
  SafeAutoCorrect: false
3442
- AutoCorrect: false
3443
3671
  Enabled: true
3444
3672
  VersionAdded: '0.42'
3445
3673
  VersionChanged: '0.59'
@@ -3455,12 +3683,13 @@ Style/NumericPredicate:
3455
3683
 
3456
3684
  Style/OneLineConditional:
3457
3685
  Description: >-
3458
- Favor the ternary operator(?:) over
3459
- if/then/else/end constructs.
3686
+ Favor the ternary operator (?:) or multi-line constructs over
3687
+ single-line if/then/else/end constructs.
3460
3688
  StyleGuide: '#ternary-operator'
3461
3689
  Enabled: true
3690
+ AlwaysCorrectToMultiline: false
3462
3691
  VersionAdded: '0.9'
3463
- VersionChanged: '0.38'
3692
+ VersionChanged: '0.90'
3464
3693
 
3465
3694
  Style/OptionHash:
3466
3695
  Description: "Don't use option hashes when you can use keyword arguments."
@@ -3485,6 +3714,13 @@ Style/OptionalArguments:
3485
3714
  VersionAdded: '0.33'
3486
3715
  VersionChanged: '0.83'
3487
3716
 
3717
+ Style/OptionalBooleanParameter:
3718
+ Description: 'Use keyword arguments when defining method with boolean argument.'
3719
+ StyleGuide: '#boolean-keyword-arguments'
3720
+ Enabled: pending
3721
+ Safe: false
3722
+ VersionAdded: '0.89'
3723
+
3488
3724
  Style/OrAssignment:
3489
3725
  Description: 'Recommend usage of double pipe equals (||=) where applicable.'
3490
3726
  StyleGuide: '#double-pipe-for-uninit'
@@ -3581,6 +3817,11 @@ Style/RandomWithOffset:
3581
3817
  Enabled: true
3582
3818
  VersionAdded: '0.52'
3583
3819
 
3820
+ Style/RedundantAssignment:
3821
+ Description: 'Checks for redundant assignment before returning.'
3822
+ Enabled: 'pending'
3823
+ VersionAdded: '0.87'
3824
+
3584
3825
  Style/RedundantBegin:
3585
3826
  Description: "Don't use begin blocks when they are not needed."
3586
3827
  StyleGuide: '#begin-implicit'
@@ -3623,6 +3864,14 @@ Style/RedundantFetchBlock:
3623
3864
  SafeForConstants: false
3624
3865
  VersionAdded: '0.86'
3625
3866
 
3867
+ Style/RedundantFileExtensionInRequire:
3868
+ Description: >-
3869
+ Checks for the presence of superfluous `.rb` extension in
3870
+ the filename provided to `require` and `require_relative`.
3871
+ StyleGuide: '#no-explicit-rb-to-require'
3872
+ Enabled: 'pending'
3873
+ VersionAdded: '0.88'
3874
+
3626
3875
  Style/RedundantFreeze:
3627
3876
  Description: "Checks usages of Object#freeze on immutable objects."
3628
3877
  Enabled: true
@@ -3671,6 +3920,12 @@ Style/RedundantSelf:
3671
3920
  VersionAdded: '0.10'
3672
3921
  VersionChanged: '0.13'
3673
3922
 
3923
+ Style/RedundantSelfAssignment:
3924
+ Description: 'Checks for places where redundant assignments are made for in place modification methods.'
3925
+ Enabled: pending
3926
+ Safe: false
3927
+ VersionAdded: '0.90'
3928
+
3674
3929
  Style/RedundantSort:
3675
3930
  Description: >-
3676
3931
  Use `min` instead of `sort.first`,
@@ -3790,6 +4045,12 @@ Style/SignalException:
3790
4045
  - only_fail
3791
4046
  - semantic
3792
4047
 
4048
+ Style/SingleArgumentDig:
4049
+ Description: 'Avoid using single argument dig method.'
4050
+ Enabled: pending
4051
+ VersionAdded: '0.89'
4052
+ Safe: false
4053
+
3793
4054
  Style/SingleLineBlockParams:
3794
4055
  Description: 'Enforces the names of some block params.'
3795
4056
  Enabled: false
@@ -3817,6 +4078,14 @@ Style/SlicingWithRange:
3817
4078
  VersionAdded: '0.83'
3818
4079
  Safe: false
3819
4080
 
4081
+ Style/SoleNestedConditional:
4082
+ Description: >-
4083
+ Finds sole nested conditional nodes
4084
+ which can be merged into outer conditional node.
4085
+ Enabled: pending
4086
+ VersionAdded: '0.89'
4087
+ AllowModifier: false
4088
+
3820
4089
  Style/SpecialGlobalVars:
3821
4090
  Description: 'Avoid Perl-style global variables.'
3822
4091
  StyleGuide: '#no-cryptic-perlisms'
@@ -3845,6 +4114,13 @@ Style/StderrPuts:
3845
4114
  Enabled: true
3846
4115
  VersionAdded: '0.51'
3847
4116
 
4117
+ Style/StringConcatenation:
4118
+ Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
4119
+ StyleGuide: '#string-interpolation'
4120
+ Enabled: pending
4121
+ Safe: false
4122
+ VersionAdded: '0.89'
4123
+
3848
4124
  Style/StringHashKeys:
3849
4125
  Description: 'Prefer symbols instead of strings as hash keys.'
3850
4126
  StyleGuide: '#symbols-as-keys'
@@ -3924,7 +4200,7 @@ Style/SymbolLiteral:
3924
4200
  Style/SymbolProc:
3925
4201
  Description: 'Use symbols as procs instead of blocks when possible.'
3926
4202
  Enabled: true
3927
- SafeAutoCorrect: false
4203
+ Safe: false
3928
4204
  VersionAdded: '0.26'
3929
4205
  VersionChanged: '0.64'
3930
4206
  # A list of method names to be ignored by the check.