cookstyle 6.12.6 → 6.15.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -1
  3. data/config/cookstyle.yml +122 -41
  4. data/config/disable_all.yml +28 -4
  5. data/config/upstream.yml +96 -16
  6. data/cookstyle.gemspec +1 -0
  7. data/lib/cookstyle.rb +7 -7
  8. data/lib/cookstyle/version.rb +2 -2
  9. data/lib/rubocop/cop/chef/correctness/invalid_default_action.rb +48 -0
  10. data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +26 -3
  11. data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +68 -0
  12. data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +4 -4
  13. data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +52 -0
  14. data/lib/rubocop/cop/chef/deprecation/cheffile.rb +2 -2
  15. data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +6 -5
  16. data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +2 -2
  17. data/lib/rubocop/cop/chef/deprecation/macos_userdefaults_global_property.rb +61 -0
  18. data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +4 -2
  19. data/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +3 -3
  20. data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +6 -10
  21. data/lib/rubocop/cop/chef/effortless/node_environment.rb +1 -1
  22. data/lib/rubocop/cop/chef/effortless/node_roles.rb +3 -3
  23. data/lib/rubocop/cop/chef/modernize/action_method_in_resource.rb +57 -0
  24. data/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +2 -2
  25. data/lib/rubocop/cop/chef/modernize/cron_d_file_or_template.rb +88 -0
  26. data/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +3 -3
  27. data/lib/rubocop/cop/chef/modernize/definitions.rb +1 -1
  28. data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +3 -3
  29. data/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +2 -2
  30. data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +3 -3
  31. data/lib/rubocop/cop/chef/redundant/double_compile_time.rb +65 -0
  32. data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +3 -3
  33. data/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +1 -1
  34. data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +5 -5
  35. data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +3 -3
  36. data/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +2 -2
  37. data/lib/rubocop/cop/chef/style/file_mode.rb +38 -19
  38. data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +1 -1
  39. data/lib/rubocop/monkey_patches/{cop.rb → base.rb} +1 -1
  40. metadata +13 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2a5a64113481754a334b8f95b80e976875672ca750c506dbdb586c2ccbab598
4
- data.tar.gz: 0ff373380e2f388e723a25b6ce1fae3e2447487cfe4c3692f3151e81f412a67a
3
+ metadata.gz: 3e49171ce1ae18a21ed120dc5dcb5a19c0fa1923c4d0d34118c4315836a37043
4
+ data.tar.gz: 77f7addb5541cb43836938196ba8fdfeebcbb75d10b940172e3a194652dc1c3b
5
5
  SHA512:
6
- metadata.gz: e4b62f764012b0f77378a0fa3d7b97abc249ece2fcc464234ce8c0b68d3bc41692324ce0557652f084a3d923f834973f660aa060206ab9d520fb09bbe75bc3de
7
- data.tar.gz: 6f3a5b63437a4dd752b211959915744fa6c6b7cce86c6da0711f950bcba8f1e3d8d40c3b661b19b4f2f5a871d3801316d12d39a29b367c097740852f704e78ee
6
+ metadata.gz: 52f6de8476deb4a8c0d01fb9d2258894baf9d27f3a4f0a9672f8dc7c35e1ba19ae6e0010c7f1096b6ae4004a16c784fc80351083904c7e13f6f38c7fda794b7c
7
+ data.tar.gz: '0858305d54b66ec0b2d831377577efd5d609c64ccbec89c77c9f2acb41548f271d6d72cc00cc2c3a9a9db2439d7c503169d076e223e9f8f8460c7c9173e0c77a'
data/Gemfile CHANGED
@@ -27,5 +27,4 @@ group :development do
27
27
  gem 'concord'
28
28
  gem 'rake'
29
29
  gem 'rspec', '>= 3.4'
30
- gem 'simplecov'
31
30
  end
@@ -5,27 +5,6 @@ AllCops:
5
5
  - '/**/files/**/*'
6
6
  - '/**/vendor/**/*'
7
7
  - Guardfile
8
- ChefAttributes:
9
- Patterns:
10
- - attributes/.*\.rb
11
- ChefDefinitions:
12
- Patterns:
13
- - definitions/.*\.rb
14
- ChefLibraries:
15
- Patterns:
16
- - libraries/.*\.rb
17
- ChefMetadata:
18
- Patterns:
19
- - metadata\.rb
20
- ChefProviders:
21
- Patterns:
22
- - providers/.*\.rb
23
- ChefRecipes:
24
- Patterns:
25
- - recipes/.*\.rb
26
- ChefResources:
27
- Patterns:
28
- - resources/.*\.rb
29
8
 
30
9
  ###############################
31
10
  # ChefStyle: Making cookbooks look better
@@ -67,7 +46,7 @@ ChefStyle/CommentFormat:
67
46
  - '**/Berksfile'
68
47
 
69
48
  ChefStyle/FileMode:
70
- Description: Use strings to represent file modes in Chef resources
49
+ Description: Use strings to represent file modes to avoid confusion between octal and base 10 integer formats.
71
50
  StyleGuide: '#chefstylefilemode'
72
51
  Enabled: true
73
52
  VersionAdded: '5.0.0'
@@ -454,6 +433,32 @@ ChefCorrectness/InvalidPlatformInCase:
454
433
  - '**/metadata.rb'
455
434
  - '**/Berksfile'
456
435
 
436
+ ChefCorrectness/InvalidDefaultAction:
437
+ Description: Default actions in resources should be a symbol or an array of symbols.
438
+ StyleGuide: '#chefcorrectnessinvaliddefaultaction'
439
+ Enabled: true
440
+ VersionAdded: '6.13.0'
441
+ Include:
442
+ - '**/libraries/*.rb'
443
+ - '**/resources/*.rb'
444
+
445
+ ChefCorrectness/SupportsMustBeFloat:
446
+ Description: Versions used in metadata.rb supports calls should be floats not integers.
447
+ StyleGuide: '#chefcorrectnesssupportsmustbefloat'
448
+ Enabled: true
449
+ VersionAdded: '6.13.0'
450
+ Include:
451
+ - '**/metadata.rb'
452
+
453
+ ChefCorrectness/MacosUserdefaultsInvalidType:
454
+ Description: The macos_userdefaults resource prior to Chef Infra Client 16.3 would silently continue if invalid types were passed resulting in unexpected behavior. Valid values are 'array', 'bool', 'dict', 'float', 'int', and 'string'.
455
+ StyleGuide: '#chefcorrectnessmacosuserdefaultsinvalidtype'
456
+ Enabled: true
457
+ VersionAdded: '6.14.0'
458
+ Exclude:
459
+ - '**/metadata.rb'
460
+ - '**/Berksfile'
461
+
457
462
  ###############################
458
463
  # ChefSharing: Issues that prevent sharing code with other teams or with the Chef community in general
459
464
  ###############################
@@ -498,7 +503,7 @@ ChefSharing/EmptyMetadataField:
498
503
  - '**/metadata.rb'
499
504
 
500
505
  ChefSharing/IncludePropertyDescriptions:
501
- Description: Properties should include description fields to allow automated documention. Requires Chef Infra Client 13.9 or later.
506
+ Description: Properties should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
502
507
  StyleGuide: '#chefsharingincludepropetydescriptions'
503
508
  Enabled: false
504
509
  VersionAdded: '6.1.0'
@@ -507,7 +512,7 @@ ChefSharing/IncludePropertyDescriptions:
507
512
  - '**/resources/*.rb'
508
513
 
509
514
  ChefSharing/IncludeResourceDescriptions:
510
- Description: Resources should include description fields to allow automated documention. Requires Chef Infra Client 13.9 or later.
515
+ Description: Resources should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
511
516
  StyleGuide: '#chefsharingincluderesourcedescriptions'
512
517
  Enabled: false
513
518
  VersionAdded: '6.1.0'
@@ -515,7 +520,7 @@ ChefSharing/IncludeResourceDescriptions:
515
520
  - '**/resources/*.rb'
516
521
 
517
522
  ChefSharing/IncludeResourceExamples:
518
- Description: Resources should include examples field to allow automated documention. Requires Chef Infra Client 13.9 or later.
523
+ Description: Resources should include examples field to allow automated documentation. Requires Chef Infra Client 13.9 or later.
519
524
  StyleGuide: '#chefsharingincluderesourceexamples'
520
525
  Enabled: false
521
526
  VersionAdded: '6.10.0'
@@ -1022,7 +1027,7 @@ ChefDeprecations/ResourceUsesOnlyResourceName:
1022
1027
 
1023
1028
  ChefDeprecations/ChefDKGenerators:
1024
1029
  Description: Chef Workstation 0.8 and later renamed the ChefDK module used when writing custom cookbook generators from ChefDK to ChefCLI. For compatibility with the latest Chef Workstation releases you'll need to reference the new class names.
1025
- StyleGuide: '#chefdkgenerators'
1030
+ StyleGuide: '#chefdeprecationschefdkgenerators'
1026
1031
  Enabled: true
1027
1032
  VersionAdded: '6.12.0'
1028
1033
  Exclude:
@@ -1031,7 +1036,7 @@ ChefDeprecations/ChefDKGenerators:
1031
1036
 
1032
1037
  ChefDeprecations/ChefHandlerRecipe:
1033
1038
  Description: There is no need to include the empty and deprecated chef_handler::default recipe in order to use the chef_handler resource.
1034
- StyleGuide: '#chefhandlerrecipe'
1039
+ StyleGuide: '#chefdeprecationschefhandlerrecipe'
1035
1040
  Enabled: true
1036
1041
  VersionAdded: '6.12.0'
1037
1042
  Exclude:
@@ -1040,13 +1045,22 @@ ChefDeprecations/ChefHandlerRecipe:
1040
1045
 
1041
1046
  ChefDeprecations/UseAutomaticResourceName:
1042
1047
  Description: The use_automatic_resource_name method was removed in Chef Infra Client 16. The resource name/provides should be set explicitly instead.
1043
- StyleGuide: '#useautomaticresourcename'
1048
+ StyleGuide: '#chefdeprecationsuseautomaticresourcename'
1044
1049
  Enabled: true
1045
1050
  VersionAdded: '6.12.0'
1046
1051
  Include:
1047
1052
  - '**/libraries/*.rb'
1048
1053
  - '**/resources/*.rb'
1049
1054
 
1055
+ ChefDeprecations/MacosUserdefaultsGlobalProperty:
1056
+ Description: The `global` property in the macos_userdefaults resource was deprecated in Chef Infra Client 16.3. Omitting the `domain` property will now set global defaults.
1057
+ StyleGuide: '#chefdeprecationsmacosuserdefaultsglobalproperty'
1058
+ Enabled: true
1059
+ VersionAdded: '6.14.0'
1060
+ Exclude:
1061
+ - '**/metadata.rb'
1062
+ - '**/Berksfile'
1063
+
1050
1064
  ###############################
1051
1065
  # ChefModernize: Cleaning up legacy code and using new built-in resources
1052
1066
  ###############################
@@ -1523,7 +1537,7 @@ ChefModernize/WindowsRegistryUAC:
1523
1537
  - '**/Berksfile'
1524
1538
 
1525
1539
  ChefModernize/UseMultipackageInstalls:
1526
- Description: Pass an array of packages to package resources instead of interating over an array of packages when using multi-package capable package subystem such as apt, yum, chocolatey, dnf, or zypper. Multipackage installs are faster and simplify logs.
1540
+ Description: Pass an array of packages to package resources instead of iterating over an array of packages when using multi-package capable package subsystem such as apt, yum, chocolatey, dnf, or zypper. Multi-package installs are faster and simplify logs.
1527
1541
  StyleGuide: '#chefmodernizeusemultipackageinstalls'
1528
1542
  Enabled: true
1529
1543
  VersionAdded: '6.0.0'
@@ -1581,7 +1595,7 @@ ChefModernize/ShellOutHelper:
1581
1595
 
1582
1596
  ChefModernize/ConditionalUsingTest:
1583
1597
  Description: Use ::File.exist?('/foo/bar') instead of the slower 'test -f /foo/bar' which requires shelling out.
1584
- StyleGuide: '#conditionalusingtest'
1598
+ StyleGuide: '#chefmodernizeconditionalusingtest'
1585
1599
  Enabled: true
1586
1600
  VersionAdded: '6.11.0'
1587
1601
  Exclude:
@@ -1589,6 +1603,26 @@ ChefModernize/ConditionalUsingTest:
1589
1603
  - '**/Berksfile'
1590
1604
  - '**/attributes/*.rb'
1591
1605
 
1606
+ ChefModernize/CronDFileOrTemplate:
1607
+ Description: Use the cron_d resource that ships with Chef Infra Client 14.4+ instead of manually creating the file with template, file, or cookbook_file resources
1608
+ StyleGuide: '#chefmodernizecrondfileortemplate'
1609
+ Enabled: true
1610
+ VersionAdded: '6.13.0'
1611
+ Exclude:
1612
+ - '**/metadata.rb'
1613
+ - '**/Berksfile'
1614
+ - '**/attributes/*.rb'
1615
+
1616
+ ChefModernize/ActionMethodInResource:
1617
+ Description: Use the custom resource language's `action :my_action` blocks instead of creating actions with methods.
1618
+ StyleGuide: '#chefmodernizeactionmethodinresource'
1619
+ Enabled: true
1620
+ VersionAdded: '6.13.0'
1621
+ Include:
1622
+ - '**/resources/*.rb'
1623
+ - '**/providers/*.rb'
1624
+ - '**/libraries/*.rb'
1625
+
1592
1626
  ###############################
1593
1627
  # ChefRedundantCode: Cleanup unnecessary code in your cookbooks regardless of Chef Infra Client release
1594
1628
  ###############################
@@ -1785,7 +1819,7 @@ ChefRedundantCode/UseCreateIfMissing:
1785
1819
 
1786
1820
  ChefRedundantCode/OhaiAttributeToString:
1787
1821
  Description: Many Ohai node attributes are already strings and don't need to be cast to strings again
1788
- StyleGuide: '#ohaiattributetostring'
1822
+ StyleGuide: '#chefredundantcodeohaiattributetostring'
1789
1823
  Enabled: true
1790
1824
  VersionAdded: '6.10.0'
1791
1825
  Exclude:
@@ -1794,13 +1828,23 @@ ChefRedundantCode/OhaiAttributeToString:
1794
1828
 
1795
1829
  ChefRedundantCode/MultiplePlatformChecks:
1796
1830
  Description: You can pass multiple values to the platform? and platform_family? helpers instead of calling the helpers multiple times.
1797
- StyleGuide: '#multipleplatformchecks'
1831
+ StyleGuide: '#chefredundantcodemultipleplatformchecks'
1798
1832
  Enabled: true
1799
1833
  VersionAdded: '6.10.0'
1800
1834
  Exclude:
1801
1835
  - '**/metadata.rb'
1802
1836
  - '**/Berksfile'
1803
1837
 
1838
+ ChefRedundantCode/DoubleCompileTime:
1839
+ Description: If a resource includes the `compile_time` property there's no need to also use `.run_action(:some_action)` on the resource block
1840
+ StyleGuide: '#chefredundantcodedoublecompiletime'
1841
+ Enabled: true
1842
+ VersionAdded: '6.13.0'
1843
+ Exclude:
1844
+ - '**/metadata.rb'
1845
+ - '**/attributes/*.rb'
1846
+ - '**/Berksfile'
1847
+
1804
1848
  ###############################
1805
1849
  # ChefEffortless: Migrating to new patterns
1806
1850
  ###############################
@@ -1826,7 +1870,7 @@ ChefEffortless/CookbookUsesDatabags:
1826
1870
  - '**/metadata.rb'
1827
1871
  - '**/Berksfile'
1828
1872
 
1829
- ChefEffortless/CookbookUsesEnvironmments:
1873
+ ChefEffortless/CookbookUsesEnvironments:
1830
1874
  Description: Cookbook uses environments, which cannot be used in the Effortless Infra pattern
1831
1875
  StyleGuide: '#chefeffortlesscookbookusesenvironments'
1832
1876
  Enabled: false
@@ -2162,10 +2206,6 @@ Style/WordArray:
2162
2206
  Enabled: true
2163
2207
  Style/ZeroLengthPredicate:
2164
2208
  Enabled: true
2165
- Metrics/BlockNesting:
2166
- Enabled: true
2167
- Metrics/ParameterLists:
2168
- Enabled: true
2169
2209
  Lint/AmbiguousOperator:
2170
2210
  Enabled: true
2171
2211
  Lint/AssignmentInCondition:
@@ -2297,16 +2337,16 @@ Metrics/CyclomaticComplexity:
2297
2337
  Enabled: false
2298
2338
  Metrics/PerceivedComplexity:
2299
2339
  Enabled: false
2300
-
2301
- #### COPS FOR THE NEXT MAJOR RELEASE
2340
+ Metrics/BlockNesting:
2341
+ Enabled: false
2342
+ Metrics/ParameterLists:
2343
+ Enabled: false
2302
2344
 
2303
2345
  # This updates how we send helpers into the Chef recipe/resource classes and makes WAY more sense
2304
2346
  # Chef::Recipe.send(:include, ::Apt::Helpers) -> Chef::Recipe.include ::Apt::Helpers
2305
2347
  Lint/SendWithMixinArgument:
2306
2348
  Enabled: true
2307
2349
 
2308
- #### END COPS FOR THE NEXT MAJOR RELEASE
2309
-
2310
2350
  # this migrates old # rubocop: comments to use the latest namespaces, which prevents a ton of spam during cookstyle runs
2311
2351
  Migration/DepartmentName:
2312
2352
  Enabled: true
@@ -2531,3 +2571,44 @@ Style/HashEachMethods:
2531
2571
  # We want to catch this deprecation in cookbooks
2532
2572
  Lint/DeprecatedOpenSSLConstant:
2533
2573
  Enabled: true
2574
+
2575
+ # This just isn't a big deal in the context of a cookbook
2576
+ Naming/AccessorMethodName:
2577
+ Enabled: false
2578
+
2579
+ # Rescuing a particular exception twice isn't going to work
2580
+ Lint/DuplicateRescueException:
2581
+ Enabled: true
2582
+
2583
+ # if b == 0 && b == 0 is invalid and we should flag it
2584
+ Lint/BinaryOperatorWithIdenticalOperands:
2585
+ Enabled: true
2586
+
2587
+ # returning at the top level with an arg is invalid
2588
+ # @TODO we can enable this once this is fixed: https://github.com/rubocop-hq/rubocop/issues/8462
2589
+ # Lint/TopLevelReturnWithArgument:
2590
+ # Enabled: true
2591
+
2592
+ # simplify hash acccess that doesn't actually need .dig
2593
+ Style/SingleArgumentDig:
2594
+ Enabled: true
2595
+
2596
+ # trying to access $2 when there is no $2 will always return nil
2597
+ Lint/OutOfRangeRegexpRef:
2598
+ Enabled: true
2599
+
2600
+ # simplify how people coerce arrays
2601
+ Style/ArrayCoercion:
2602
+ Enabled: true
2603
+
2604
+ # if your elseif is the same as your if you're gonna have a bad day
2605
+ Lint/DuplicateElsifCondition:
2606
+ Enabled: true
2607
+
2608
+ # simplify attr_reader and attr_write into attr_accessor
2609
+ Style/BisectedAttrAccessor:
2610
+ Enabled: true
2611
+
2612
+ # avoid assignments that aren't needed
2613
+ Style/RedundantAssignment:
2614
+ Enabled: true
@@ -207,6 +207,8 @@ Lint/AssignmentInCondition:
207
207
  Enabled: false
208
208
  Lint/BigDecimalNew:
209
209
  Enabled: false
210
+ Lint/BinaryOperatorWithIdenticalOperands:
211
+ Enabled: false
210
212
  Lint/BooleanSymbol:
211
213
  Enabled: false
212
214
  Lint/CircularArgumentReference:
@@ -229,10 +231,14 @@ Lint/DuplicateHashKey:
229
231
  Enabled: false
230
232
  Lint/DuplicateMethods:
231
233
  Enabled: false
234
+ Lint/DuplicateRescueException:
235
+ Enabled: false
232
236
  Lint/EachWithObjectArgument:
233
237
  Enabled: false
234
238
  Lint/ElseLayout:
235
239
  Enabled: false
240
+ Lint/EmptyConditionalBody:
241
+ Enabled: false
236
242
  Lint/EmptyEnsure:
237
243
  Enabled: false
238
244
  Lint/EmptyExpression:
@@ -247,6 +253,8 @@ Lint/ErbNewArguments:
247
253
  Enabled: false
248
254
  Lint/FlipFlop:
249
255
  Enabled: false
256
+ Lint/FloatComparison:
257
+ Enabled: false
250
258
  Lint/FloatOutOfRange:
251
259
  Enabled: false
252
260
  Lint/FormatParameterMismatch:
@@ -269,6 +277,8 @@ Lint/Loop:
269
277
  Enabled: false
270
278
  Lint/MissingCopEnableDirective:
271
279
  Enabled: false
280
+ Lint/MissingSuper:
281
+ Enabled: false
272
282
  Lint/MixedRegexpCaptureTypes:
273
283
  Enabled: false
274
284
  Lint/MultipleComparison:
@@ -287,6 +297,8 @@ Lint/NumberConversion:
287
297
  Enabled: false
288
298
  Lint/OrderedMagicComments:
289
299
  Enabled: false
300
+ Lint/OutOfRangeRegexpRef:
301
+ Enabled: false
290
302
  Lint/ParenthesesAsGroupedExpression:
291
303
  Enabled: false
292
304
  Lint/PercentStringArray:
@@ -329,6 +341,8 @@ Lint/SafeNavigationWithEmpty:
329
341
  Enabled: false
330
342
  Lint/ScriptPermission:
331
343
  Enabled: false
344
+ Lint/SelfAssignment:
345
+ Enabled: false
332
346
  Lint/SendWithMixinArgument:
333
347
  Enabled: false
334
348
  Lint/ShadowedArgument:
@@ -345,12 +359,16 @@ Lint/Syntax:
345
359
  Enabled: false
346
360
  Lint/ToJSON:
347
361
  Enabled: false
362
+ Lint/TopLevelReturnWithArgument:
363
+ Enabled: false
348
364
  Lint/UnderscorePrefixedVariableName:
349
365
  Enabled: false
350
366
  Lint/UnifiedInteger:
351
367
  Enabled: false
352
368
  Lint/UnreachableCode:
353
369
  Enabled: false
370
+ Lint/UnreachableLoop:
371
+ Enabled: false
354
372
  Lint/UnusedBlockArgument:
355
373
  Enabled: false
356
374
  Lint/UnusedMethodArgument:
@@ -363,8 +381,6 @@ Lint/UselessAccessModifier:
363
381
  Enabled: false
364
382
  Lint/UselessAssignment:
365
383
  Enabled: false
366
- Lint/UselessComparison:
367
- Enabled: false
368
384
  Lint/UselessElseWithoutRescue:
369
385
  Enabled: false
370
386
  Lint/UselessSetterCall:
@@ -523,6 +539,8 @@ Style/EvenOdd:
523
539
  Enabled: false
524
540
  Style/ExpandPathArguments:
525
541
  Enabled: false
542
+ Style/ExplicitBlockArgument:
543
+ Enabled: false
526
544
  Style/ExponentialNotation:
527
545
  Enabled: false
528
546
  Style/FloatDivision:
@@ -535,6 +553,8 @@ Style/FormatStringToken:
535
553
  Enabled: false
536
554
  Style/FrozenStringLiteralComment:
537
555
  Enabled: false
556
+ Style/GlobalStdStream:
557
+ Enabled: false
538
558
  Style/GlobalVars:
539
559
  Enabled: false
540
560
  Style/GuardClause:
@@ -591,8 +611,6 @@ Style/MethodCalledOnDoEndBlock:
591
611
  Enabled: false
592
612
  Style/MethodDefParentheses:
593
613
  Enabled: false
594
- Style/MethodMissingSuper:
595
- Enabled: false
596
614
  Style/MinMax:
597
615
  Enabled: false
598
616
  Style/MissingElse:
@@ -657,6 +675,8 @@ Style/OptionHash:
657
675
  Enabled: false
658
676
  Style/OptionalArguments:
659
677
  Enabled: false
678
+ Style/OptionalBooleanParameter:
679
+ Enabled: false
660
680
  Style/ParallelAssignment:
661
681
  Enabled: false
662
682
  Style/ParenthesesAroundCondition:
@@ -725,6 +745,8 @@ Style/Send:
725
745
  Enabled: false
726
746
  Style/SignalException:
727
747
  Enabled: false
748
+ Style/SingleArgumentDig:
749
+ Enabled: false
728
750
  Style/SingleLineBlockParams:
729
751
  Enabled: false
730
752
  Style/SingleLineMethods:
@@ -737,6 +759,8 @@ Style/StabbyLambdaParentheses:
737
759
  Enabled: false
738
760
  Style/StderrPuts:
739
761
  Enabled: false
762
+ Style/StringConcatenation:
763
+ Enabled: false
740
764
  Style/StringHashKeys:
741
765
  Enabled: false
742
766
  Style/StringLiterals:
@@ -210,9 +210,10 @@ Gemspec/OrderedDependencies:
210
210
  - '**/*.gemspec'
211
211
 
212
212
  Gemspec/RequiredRubyVersion:
213
- Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
213
+ Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
214
214
  Enabled: true
215
215
  VersionAdded: '0.52'
216
+ VersionChanged: '0.89'
216
217
  Include:
217
218
  - '**/*.gemspec'
218
219
 
@@ -1234,7 +1235,7 @@ Layout/SpaceInsideBlockBraces:
1234
1235
 
1235
1236
  Layout/SpaceInsideHashLiteralBraces:
1236
1237
  Description: "Use spaces inside hash literal braces - or don't."
1237
- StyleGuide: '#spaces-operators'
1238
+ StyleGuide: '#spaces-braces'
1238
1239
  Enabled: true
1239
1240
  VersionAdded: '0.49'
1240
1241
  EnforcedStyle: space
@@ -1355,6 +1356,12 @@ Lint/BigDecimalNew:
1355
1356
  Enabled: true
1356
1357
  VersionAdded: '0.53'
1357
1358
 
1359
+ Lint/BinaryOperatorWithIdenticalOperands:
1360
+ Description: 'This cop checks for places where binary operator has identical operands.'
1361
+ Enabled: pending
1362
+ Safe: false
1363
+ VersionAdded: '0.89'
1364
+
1358
1365
  Lint/BooleanSymbol:
1359
1366
  Description: 'Check for `:true` and `:false` symbols.'
1360
1367
  Enabled: true
@@ -1420,6 +1427,11 @@ Lint/DuplicateMethods:
1420
1427
  Enabled: true
1421
1428
  VersionAdded: '0.29'
1422
1429
 
1430
+ Lint/DuplicateRescueException:
1431
+ Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
1432
+ Enabled: pending
1433
+ VersionAdded: '0.89'
1434
+
1423
1435
  Lint/EachWithObjectArgument:
1424
1436
  Description: 'Check for immutable argument given to each_with_object.'
1425
1437
  Enabled: true
@@ -1430,6 +1442,12 @@ Lint/ElseLayout:
1430
1442
  Enabled: true
1431
1443
  VersionAdded: '0.17'
1432
1444
 
1445
+ Lint/EmptyConditionalBody:
1446
+ Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
1447
+ Enabled: 'pending'
1448
+ AllowComments: true
1449
+ VersionAdded: '0.89'
1450
+
1433
1451
  Lint/EmptyEnsure:
1434
1452
  Description: 'Checks for empty ensure block.'
1435
1453
  Enabled: true
@@ -1473,6 +1491,12 @@ Lint/FlipFlop:
1473
1491
  Enabled: true
1474
1492
  VersionAdded: '0.16'
1475
1493
 
1494
+ Lint/FloatComparison:
1495
+ Description: 'Checks for the presence of precise comparison of floating point numbers.'
1496
+ StyleGuide: '#float-comparison'
1497
+ Enabled: pending
1498
+ VersionAdded: '0.89'
1499
+
1476
1500
  Lint/FloatOutOfRange:
1477
1501
  Description: >-
1478
1502
  Catches floating-point literals too large or small for Ruby to
@@ -1520,7 +1544,7 @@ Lint/InheritException:
1520
1544
  Lint/InterpolationCheck:
1521
1545
  Description: 'Raise warning for interpolation in single q strs.'
1522
1546
  Enabled: true
1523
- SafeAutoCorrect: false
1547
+ Safe: false
1524
1548
  VersionAdded: '0.50'
1525
1549
  VersionChanged: '0.87'
1526
1550
 
@@ -1542,6 +1566,7 @@ Lint/Loop:
1542
1566
  StyleGuide: '#loop-with-break'
1543
1567
  Enabled: true
1544
1568
  VersionAdded: '0.9'
1569
+ VersionChanged: '0.89'
1545
1570
 
1546
1571
  Lint/MissingCopEnableDirective:
1547
1572
  Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
@@ -1556,6 +1581,13 @@ Lint/MissingCopEnableDirective:
1556
1581
  # .inf for any size
1557
1582
  MaximumRangeSize: .inf
1558
1583
 
1584
+ Lint/MissingSuper:
1585
+ Description: >-
1586
+ This cop checks for the presence of constructors and lifecycle callbacks
1587
+ without calls to `super`'.
1588
+ Enabled: pending
1589
+ VersionAdded: '0.89'
1590
+
1559
1591
  Lint/MixedRegexpCaptureTypes:
1560
1592
  Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
1561
1593
  Enabled: pending
@@ -1608,6 +1640,12 @@ Lint/OrderedMagicComments:
1608
1640
  Enabled: true
1609
1641
  VersionAdded: '0.53'
1610
1642
 
1643
+ Lint/OutOfRangeRegexpRef:
1644
+ Description: 'Checks for out of range reference for Regexp because it always returns nil.'
1645
+ Enabled: pending
1646
+ Safe: false
1647
+ VersionAdded: '0.89'
1648
+
1611
1649
  Lint/ParenthesesAsGroupedExpression:
1612
1650
  Description: >-
1613
1651
  Checks for method calls with a space before the opening
@@ -1758,6 +1796,11 @@ Lint/ScriptPermission:
1758
1796
  VersionAdded: '0.49'
1759
1797
  VersionChanged: '0.50'
1760
1798
 
1799
+ Lint/SelfAssignment:
1800
+ Description: 'Checks for self-assignments.'
1801
+ Enabled: pending
1802
+ VersionAdded: '0.89'
1803
+
1761
1804
  Lint/SendWithMixinArgument:
1762
1805
  Description: 'Checks for `send` method when using mixin.'
1763
1806
  Enabled: true
@@ -1808,6 +1851,11 @@ Lint/ToJSON:
1808
1851
  Enabled: true
1809
1852
  VersionAdded: '0.66'
1810
1853
 
1854
+ Lint/TopLevelReturnWithArgument:
1855
+ Description: 'This cop detects top level return statements with argument.'
1856
+ Enabled: 'pending'
1857
+ VersionAdded: '0.89'
1858
+
1811
1859
  Lint/UnderscorePrefixedVariableName:
1812
1860
  Description: 'Do not use prefix `_` for a variable that is used.'
1813
1861
  Enabled: true
@@ -1824,6 +1872,11 @@ Lint/UnreachableCode:
1824
1872
  Enabled: true
1825
1873
  VersionAdded: '0.9'
1826
1874
 
1875
+ Lint/UnreachableLoop:
1876
+ Description: 'This cop checks for loops that will have at most one iteration.'
1877
+ Enabled: pending
1878
+ VersionAdded: '0.89'
1879
+
1827
1880
  Lint/UnusedBlockArgument:
1828
1881
  Description: 'Checks for unused block arguments.'
1829
1882
  StyleGuide: '#underscore-unused-vars'
@@ -1873,11 +1926,6 @@ Lint/UselessAssignment:
1873
1926
  Enabled: true
1874
1927
  VersionAdded: '0.11'
1875
1928
 
1876
- Lint/UselessComparison:
1877
- Description: 'Checks for comparison of something with itself.'
1878
- Enabled: true
1879
- VersionAdded: '0.11'
1880
-
1881
1929
  Lint/UselessElseWithoutRescue:
1882
1930
  Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
1883
1931
  Enabled: true
@@ -1911,7 +1959,7 @@ Metrics/AbcSize:
1911
1959
  # The ABC size is a calculated magnitude, so this number can be an Integer or
1912
1960
  # a Float.
1913
1961
  IgnoredMethods: []
1914
- Max: 15
1962
+ Max: 17
1915
1963
 
1916
1964
  Metrics/BlockLength:
1917
1965
  Description: 'Avoid long blocks with many lines.'
@@ -1993,7 +2041,7 @@ Metrics/PerceivedComplexity:
1993
2041
  VersionAdded: '0.25'
1994
2042
  VersionChanged: '0.81'
1995
2043
  IgnoredMethods: []
1996
- Max: 7
2044
+ Max: 8
1997
2045
 
1998
2046
  ################## Migration #############################
1999
2047
 
@@ -2352,6 +2400,7 @@ Style/ArrayCoercion:
2352
2400
  Use Array() instead of explicit Array check or [*var], when dealing
2353
2401
  with a variable you want to treat as an Array, but you're not certain it's an array.
2354
2402
  StyleGuide: '#array-coercion'
2403
+ Safe: false
2355
2404
  Enabled: 'pending'
2356
2405
  VersionAdded: '0.88'
2357
2406
 
@@ -2527,6 +2576,7 @@ Style/CaseEquality:
2527
2576
  StyleGuide: '#no-case-equality'
2528
2577
  Enabled: true
2529
2578
  VersionAdded: '0.9'
2579
+ VersionChanged: '0.89'
2530
2580
  # If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
2531
2581
  # the case equality operator is a constant.
2532
2582
  #
@@ -2880,6 +2930,16 @@ Style/ExpandPathArguments:
2880
2930
  Enabled: true
2881
2931
  VersionAdded: '0.53'
2882
2932
 
2933
+ Style/ExplicitBlockArgument:
2934
+ Description: >-
2935
+ Consider using explicit block argument to avoid writing block literal
2936
+ that just passes its arguments to another block.
2937
+ StyleGuide: '#block-argument'
2938
+ Enabled: pending
2939
+ # May change the yielding arity.
2940
+ Safe: false
2941
+ VersionAdded: '0.89'
2942
+
2883
2943
  Style/ExponentialNotation:
2884
2944
  Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
2885
2945
  StyleGuide: '#exponential-notation'
@@ -2963,6 +3023,12 @@ Style/FrozenStringLiteralComment:
2963
3023
  - never
2964
3024
  Safe: false
2965
3025
 
3026
+ Style/GlobalStdStream:
3027
+ Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
3028
+ StyleGuide: '#global-stdout'
3029
+ Enabled: pending
3030
+ VersionAdded: '0.89'
3031
+
2966
3032
  Style/GlobalVars:
2967
3033
  Description: 'Do not introduce global variables.'
2968
3034
  StyleGuide: '#instance-vars'
@@ -3218,12 +3284,6 @@ Style/MethodDefParentheses:
3218
3284
  - require_no_parentheses
3219
3285
  - require_no_parentheses_except_multiline
3220
3286
 
3221
- Style/MethodMissingSuper:
3222
- Description: Checks for `method_missing` to call `super`.
3223
- StyleGuide: '#no-method-missing'
3224
- Enabled: true
3225
- VersionAdded: '0.56'
3226
-
3227
3287
  Style/MinMax:
3228
3288
  Description: >-
3229
3289
  Use `Enumerable#minmax` instead of `Enumerable#min`
@@ -3565,6 +3625,13 @@ Style/OptionalArguments:
3565
3625
  VersionAdded: '0.33'
3566
3626
  VersionChanged: '0.83'
3567
3627
 
3628
+ Style/OptionalBooleanParameter:
3629
+ Description: 'Use keyword arguments when defining method with boolean argument.'
3630
+ StyleGuide: '#boolean-keyword-arguments'
3631
+ Enabled: pending
3632
+ Safe: false
3633
+ VersionAdded: '0.89'
3634
+
3568
3635
  Style/OrAssignment:
3569
3636
  Description: 'Recommend usage of double pipe equals (||=) where applicable.'
3570
3637
  StyleGuide: '#double-pipe-for-uninit'
@@ -3883,6 +3950,12 @@ Style/SignalException:
3883
3950
  - only_fail
3884
3951
  - semantic
3885
3952
 
3953
+ Style/SingleArgumentDig:
3954
+ Description: 'Avoid using single argument dig method.'
3955
+ Enabled: pending
3956
+ VersionAdded: '0.89'
3957
+ Safe: false
3958
+
3886
3959
  Style/SingleLineBlockParams:
3887
3960
  Description: 'Enforces the names of some block params.'
3888
3961
  Enabled: false
@@ -3938,6 +4011,13 @@ Style/StderrPuts:
3938
4011
  Enabled: true
3939
4012
  VersionAdded: '0.51'
3940
4013
 
4014
+ Style/StringConcatenation:
4015
+ Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
4016
+ StyleGuide: '#string-interpolation'
4017
+ Enabled: pending
4018
+ Safe: false
4019
+ VersionAdded: '0.89'
4020
+
3941
4021
  Style/StringHashKeys:
3942
4022
  Description: 'Prefer symbols instead of strings as hash keys.'
3943
4023
  StyleGuide: '#symbols-as-keys'