ffi-geos 2.4.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +2 -2
  3. data/.rbenv-vars +1 -0
  4. data/.rubocop.yml +538 -92
  5. data/.rubocop_todo.yml +28 -18
  6. data/ffi-geos.gemspec +2 -2
  7. data/lib/ffi-geos/coordinate_sequence.rb +2 -1
  8. data/lib/ffi-geos/geometry.rb +95 -1
  9. data/lib/ffi-geos/point.rb +9 -0
  10. data/lib/ffi-geos/version.rb +1 -1
  11. data/lib/ffi-geos.rb +78 -3
  12. data/test/coordinate_sequence_tests.rb +22 -4
  13. data/test/geojson_reader_tests.rb +6 -2
  14. data/test/geometry/area_tests.rb +18 -0
  15. data/test/geometry/boundary_tests.rb +36 -0
  16. data/test/geometry/buffer_tests.rb +116 -0
  17. data/test/geometry/build_area_tests.rb +20 -0
  18. data/test/geometry/centroid_tests.rb +37 -0
  19. data/test/geometry/clip_by_rect_tests.rb +56 -0
  20. data/test/geometry/clone_tests.rb +29 -0
  21. data/test/geometry/concave_hull_of_polygons_tests.rb +28 -0
  22. data/test/geometry/concave_hull_tests.rb +38 -0
  23. data/test/geometry/convex_hull_tests.rb +26 -0
  24. data/test/geometry/coord_seq_tests.rb +27 -0
  25. data/test/geometry/delaunay_triangulation_tests.rb +82 -0
  26. data/test/geometry/densify_tests.rb +95 -0
  27. data/test/geometry/difference_tests.rb +108 -0
  28. data/test/geometry/dimensions_tests.rb +46 -0
  29. data/test/geometry/distance_tests.rb +29 -0
  30. data/test/geometry/dump_points_tests.rb +60 -0
  31. data/test/geometry/dup_tests.rb +29 -0
  32. data/test/geometry/empty_tests.rb +23 -0
  33. data/test/geometry/envelope_tests.rb +26 -0
  34. data/test/geometry/equal_identical_tests.rb +78 -0
  35. data/test/geometry/equal_tests.rb +62 -0
  36. data/test/geometry/exterior_ring_tests.rb +27 -0
  37. data/test/geometry/extract_unique_points_tests.rb +41 -0
  38. data/test/geometry/frecet_distance_tests.rb +24 -0
  39. data/test/geometry/get_geometry_n_tests.rb +21 -0
  40. data/test/geometry/hausdorff_distance_tests.rb +46 -0
  41. data/test/geometry/hilbert_code_tests.rb +45 -0
  42. data/test/geometry/interior_ring_n_tests.rb +64 -0
  43. data/test/geometry/interior_rings_tests.rb +36 -0
  44. data/test/geometry/interpolate_tests.rb +49 -0
  45. data/test/geometry/intersection_tests.rb +49 -0
  46. data/test/geometry/largest_empty_circle_tests.rb +26 -0
  47. data/test/geometry/length_tests.rb +18 -0
  48. data/test/geometry/line_merge_directed_tests.rb +28 -0
  49. data/test/geometry/line_merge_tests.rb +25 -0
  50. data/test/geometry/line_string_enumerator_tests.rb +20 -0
  51. data/test/geometry/line_substring_tests.rb +76 -0
  52. data/test/geometry/make_valid_tests.rb +27 -0
  53. data/test/geometry/maximum_inscribed_circle_tests.rb +21 -0
  54. data/test/geometry/minimum_bounding_circle_tests.rb +23 -0
  55. data/test/geometry/minimum_clearance_tests.rb +58 -0
  56. data/test/geometry/minimum_rotated_rectangle_tests.rb +28 -0
  57. data/test/geometry/minimum_width_tests.rb +26 -0
  58. data/test/geometry/misc_tests.rb +24 -0
  59. data/test/geometry/nearest_points_tests.rb +46 -0
  60. data/test/geometry/node_tests.rb +22 -0
  61. data/test/geometry/normalize_tests.rb +34 -0
  62. data/test/geometry/num_coordinates_tests.rb +39 -0
  63. data/test/geometry/num_goemetries_tests.rb +35 -0
  64. data/test/geometry/num_interior_rings_tests.rb +28 -0
  65. data/test/geometry/orient_polygons_tests.rb +101 -0
  66. data/test/geometry/point_on_surface_tests.rb +37 -0
  67. data/test/geometry/polygon_hull_simplify_tests.rb +55 -0
  68. data/test/geometry/polygonize_tests.rb +173 -0
  69. data/test/geometry/precision_tests.rb +42 -0
  70. data/test/geometry/project_tests.rb +56 -0
  71. data/test/geometry/relate_tests.rb +73 -0
  72. data/test/geometry/relationships_tests.rb +138 -0
  73. data/test/geometry/reverse_tests.rb +44 -0
  74. data/test/geometry/ring_tests.rb +18 -0
  75. data/test/geometry/shared_path_tests.rb +31 -0
  76. data/test/geometry/simple_tests.rb +18 -0
  77. data/test/geometry/simplify_tests.rb +21 -0
  78. data/test/geometry/snap_tests.rb +20 -0
  79. data/test/geometry/srid_copy_policy_tests.rb +94 -0
  80. data/test/geometry/start_and_end_point_tests.rb +24 -0
  81. data/test/geometry/sym_difference_tests.rb +114 -0
  82. data/test/geometry/topology_preserve_simplify_tests.rb +21 -0
  83. data/test/geometry/union_tests.rb +216 -0
  84. data/test/geometry/valid_tests.rb +56 -0
  85. data/test/geometry/voronoi_diagram_tests.rb +62 -0
  86. data/test/geometry_collection_tests.rb +14 -2
  87. data/test/interrupt_tests.rb +1 -1
  88. data/test/line_string_tests.rb +24 -3
  89. data/test/misc_tests.rb +1 -1
  90. data/test/point/has_m_tests.rb +43 -0
  91. data/test/point/x_y_z_m_tests.rb +51 -0
  92. data/test/point_tests.rb +25 -3
  93. data/test/polygon_tests.rb +14 -1
  94. data/test/prepared_geometry_tests.rb +6 -5
  95. data/test/strtree_tests.rb +11 -18
  96. data/test/test_helper.rb +2 -0
  97. data/test/tools_tests.rb +7 -0
  98. data/test/utils_tests.rb +14 -3
  99. data/test/wkb_reader_tests.rb +1 -0
  100. data/test/wkb_writer_tests.rb +26 -5
  101. data/test/wkt_reader_tests.rb +2 -0
  102. data/test/wkt_writer_tests.rb +20 -2
  103. metadata +154 -7
  104. data/test/geometry_tests.rb +0 -2114
data/.rubocop.yml CHANGED
@@ -42,6 +42,7 @@ AllCops:
42
42
  - '**/*.rbx'
43
43
  - '**/*.ru'
44
44
  - '**/*.ruby'
45
+ - '**/*.schema'
45
46
  - '**/*.spec'
46
47
  - '**/*.thor'
47
48
  - '**/*.watchr'
@@ -67,18 +68,17 @@ AllCops:
67
68
  - '**/Puppetfile'
68
69
  - '**/Rakefile'
69
70
  - '**/rakefile'
71
+ - '**/Schemafile'
70
72
  - '**/Snapfile'
71
73
  - '**/Steepfile'
72
74
  - '**/Thorfile'
73
75
  - '**/Vagabondfile'
74
76
  - '**/Vagrantfile'
75
77
  Exclude:
76
- - '.bundle/**/*'
77
- - 'node_modules/**/*'
78
78
  - 'tmp/**/*'
79
- - 'vendor/**/*'
80
79
  - '.git/**/*'
81
- - 'stuff/**/*'
80
+ - '.pryrc'
81
+
82
82
  # Default formatter will be used if no `-f/--format` option is given.
83
83
  DefaultFormatter: progress
84
84
  # Cop names are displayed in offense messages by default. Change behavior
@@ -122,7 +122,7 @@ AllCops:
122
122
  # the `--enable-pending-cops` command-line option.
123
123
  # When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
124
124
  # the `--disable-pending-cops` command-line option.
125
- NewCops: pending
125
+ NewCops: enable
126
126
  # Enables the result cache if `true`. Can be overridden by the `--cache` command
127
127
  # line option.
128
128
  UseCache: true
@@ -154,7 +154,7 @@ AllCops:
154
154
  # or gems.locked file. (Although the Ruby version is specified in the Gemfile
155
155
  # or gems.rb file, RuboCop reads the final value from the lock file.) If the
156
156
  # Ruby version is still unresolved, RuboCop will use the oldest officially
157
- # supported Ruby version (currently Ruby 2.5).
157
+ # supported Ruby version (currently Ruby 2.7).
158
158
  TargetRubyVersion: ~
159
159
  # Determines if a notification for extension libraries should be shown when
160
160
  # rubocop is run. Keys are the name of the extension, and values are an array
@@ -167,7 +167,19 @@ AllCops:
167
167
  Bundler/DuplicatedGem:
168
168
  Description: 'Checks for duplicate gem entries in Gemfile.'
169
169
  Enabled: true
170
+ Severity: warning
170
171
  VersionAdded: '0.46'
172
+ VersionChanged: '1.40'
173
+ Include:
174
+ - '**/*.gemfile'
175
+ - '**/Gemfile'
176
+ - '**/gems.rb'
177
+
178
+ Bundler/DuplicatedGroup:
179
+ Description: 'Checks for duplicate group entries in Gemfile.'
180
+ Enabled: true
181
+ Severity: warning
182
+ VersionAdded: '1.56'
171
183
  Include:
172
184
  - '**/*.gemfile'
173
185
  - '**/Gemfile'
@@ -219,7 +231,9 @@ Bundler/InsecureProtocolSource:
219
231
  because HTTP requests are insecure. Please change your source to
220
232
  'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
221
233
  Enabled: true
234
+ Severity: warning
222
235
  VersionAdded: '0.50'
236
+ VersionChanged: '1.40'
223
237
  AllowHttpProtocol: true
224
238
  Include:
225
239
  - '**/*.gemfile'
@@ -243,13 +257,6 @@ Bundler/OrderedGems:
243
257
 
244
258
  #################### Gemspec ###############################
245
259
 
246
- Gemspec/DateAssignment:
247
- Description: 'Checks that `date =` is not used in gemspec file, it is set automatically when the gem is packaged.'
248
- Enabled: true
249
- VersionAdded: '1.10'
250
- Include:
251
- - '**/*.gemspec'
252
-
253
260
  Gemspec/DependencyVersion:
254
261
  Description: 'Requires or forbids specifying gem dependency versions.'
255
262
  Enabled: false
@@ -264,15 +271,34 @@ Gemspec/DependencyVersion:
264
271
 
265
272
  Gemspec/DeprecatedAttributeAssignment:
266
273
  Description: Checks that deprecated attribute assignments are not set in a gemspec file.
267
- Enabled: false
274
+ Enabled: true
275
+ Severity: warning
268
276
  VersionAdded: '1.30'
277
+ VersionChanged: '1.40'
278
+ Include:
279
+ - '**/*.gemspec'
280
+
281
+ Gemspec/DevelopmentDependencies:
282
+ Description: Checks that development dependencies are specified in Gemfile rather than gemspec.
283
+ Enabled: true
284
+ VersionAdded: '1.44'
285
+ EnforcedStyle: Gemfile
286
+ SupportedStyles:
287
+ - Gemfile
288
+ - gems.rb
289
+ - gemspec
290
+ AllowedGems: []
269
291
  Include:
270
292
  - '**/*.gemspec'
293
+ - '**/Gemfile'
294
+ - '**/gems.rb'
271
295
 
272
296
  Gemspec/DuplicatedAssignment:
273
297
  Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
274
298
  Enabled: true
299
+ Severity: warning
275
300
  VersionAdded: '0.52'
301
+ VersionChanged: '1.40'
276
302
  Include:
277
303
  - '**/*.gemspec'
278
304
 
@@ -291,7 +317,9 @@ Gemspec/OrderedDependencies:
291
317
  Gemspec/RequireMFA:
292
318
  Description: 'Checks that the gemspec has metadata to require Multi-Factor Authentication from RubyGems.'
293
319
  Enabled: true
320
+ Severity: warning
294
321
  VersionAdded: '1.23'
322
+ VersionChanged: '1.40'
295
323
  Reference:
296
324
  - https://guides.rubygems.org/mfa-requirement-opt-in/
297
325
  Include:
@@ -300,8 +328,9 @@ Gemspec/RequireMFA:
300
328
  Gemspec/RequiredRubyVersion:
301
329
  Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
302
330
  Enabled: true
331
+ Severity: warning
303
332
  VersionAdded: '0.52'
304
- VersionChanged: '1.22'
333
+ VersionChanged: '1.40'
305
334
  Include:
306
335
  - '**/*.gemspec'
307
336
 
@@ -309,7 +338,9 @@ Gemspec/RubyVersionGlobalsUsage:
309
338
  Description: Checks usage of RUBY_VERSION in gemspec.
310
339
  StyleGuide: '#no-ruby-version-in-the-gemspec'
311
340
  Enabled: true
341
+ Severity: warning
312
342
  VersionAdded: '0.72'
343
+ VersionChanged: '1.40'
313
344
  Include:
314
345
  - '**/*.gemspec'
315
346
 
@@ -378,7 +409,7 @@ Layout/ArrayAlignment:
378
409
  #
379
410
  # array = [1, 2, 3,
380
411
  # 4, 5, 6]
381
- EnforcedStyle: with_first_element
412
+ EnforcedStyle: with_fixed_indentation
382
413
  SupportedStyles:
383
414
  - with_first_element
384
415
  - with_fixed_indentation
@@ -392,7 +423,7 @@ Layout/AssignmentIndentation:
392
423
  right-hand-side of a multi-line assignment.
393
424
  Enabled: true
394
425
  VersionAdded: '0.49'
395
- VersionChanged: '0.77'
426
+ VersionChanged: '1.45'
396
427
  # By default the indentation width from `Layout/IndentationWidth` is used,
397
428
  # but it can be overridden by setting this parameter.
398
429
  IndentationWidth: ~
@@ -450,7 +481,9 @@ Layout/ClassStructure:
450
481
  Description: 'Enforces a configured order of definitions within a class body.'
451
482
  StyleGuide: '#consistent-classes'
452
483
  Enabled: false
484
+ SafeAutoCorrect: false
453
485
  VersionAdded: '0.52'
486
+ VersionChanged: '1.53'
454
487
  Categories:
455
488
  module_inclusion:
456
489
  - include
@@ -510,7 +543,7 @@ Layout/DefEndAlignment:
510
543
  Layout/DotPosition:
511
544
  Description: 'Checks the position of the dot in multi-line method calls.'
512
545
  StyleGuide: '#consistent-multi-line-chains'
513
- Enabled: true
546
+ Enabled: false
514
547
  VersionAdded: '0.49'
515
548
  EnforcedStyle: leading
516
549
  SupportedStyles:
@@ -531,7 +564,7 @@ Layout/EmptyComment:
531
564
 
532
565
  Layout/EmptyLineAfterGuardClause:
533
566
  Description: 'Add empty line after guard clause.'
534
- Enabled: true
567
+ Enabled: false
535
568
  VersionAdded: '0.56'
536
569
  VersionChanged: '0.59'
537
570
 
@@ -558,9 +591,11 @@ Layout/EmptyLineBetweenDefs:
558
591
  EmptyLineBetweenMethodDefs: true
559
592
  EmptyLineBetweenClassDefs: true
560
593
  EmptyLineBetweenModuleDefs: true
594
+ # `DefLikeMacros` takes the name of any macro that you want to treat like a def.
595
+ DefLikeMacros: []
561
596
  # `AllowAdjacentOneLineDefs` means that single line method definitions don't
562
597
  # need an empty line between them. `true` by default.
563
- AllowAdjacentOneLineDefs: true
598
+ AllowAdjacentOneLineDefs: false
564
599
  # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
565
600
  NumberOfEmptyLines: 1
566
601
 
@@ -761,6 +796,7 @@ Layout/FirstArrayElementLineBreak:
761
796
  multi-line array.
762
797
  Enabled: false
763
798
  VersionAdded: '0.49'
799
+ AllowMultilineFinalElement: false
764
800
 
765
801
  Layout/FirstHashElementIndentation:
766
802
  Description: 'Checks the indentation of the first key in a hash literal.'
@@ -793,6 +829,7 @@ Layout/FirstHashElementLineBreak:
793
829
  multi-line hash.
794
830
  Enabled: false
795
831
  VersionAdded: '0.49'
832
+ AllowMultilineFinalElement: false
796
833
 
797
834
  Layout/FirstMethodArgumentLineBreak:
798
835
  Description: >-
@@ -800,6 +837,7 @@ Layout/FirstMethodArgumentLineBreak:
800
837
  multi-line method call.
801
838
  Enabled: false
802
839
  VersionAdded: '0.49'
840
+ AllowMultilineFinalElement: false
803
841
 
804
842
  Layout/FirstMethodParameterLineBreak:
805
843
  Description: >-
@@ -807,6 +845,7 @@ Layout/FirstMethodParameterLineBreak:
807
845
  multi-line method parameter definition.
808
846
  Enabled: false
809
847
  VersionAdded: '0.49'
848
+ AllowMultilineFinalElement: false
810
849
 
811
850
  Layout/FirstParameterIndentation:
812
851
  Description: >-
@@ -959,7 +998,6 @@ Layout/IndentationWidth:
959
998
  # Number of spaces for each indentation level.
960
999
  Width: 2
961
1000
  AllowedPatterns: []
962
- # IgnoredPatterns: [] # deprecated
963
1001
 
964
1002
  Layout/InitialIndentation:
965
1003
  Description: >-
@@ -982,6 +1020,27 @@ Layout/LeadingEmptyLines:
982
1020
  VersionAdded: '0.57'
983
1021
  VersionChanged: '0.77'
984
1022
 
1023
+ Layout/LineContinuationLeadingSpace:
1024
+ Description: >-
1025
+ Use trailing spaces instead of leading spaces in strings
1026
+ broken over multiple lines (by a backslash).
1027
+ Enabled: true
1028
+ VersionAdded: '1.31'
1029
+ VersionChanged: '1.45'
1030
+ EnforcedStyle: trailing
1031
+ SupportedStyles:
1032
+ - leading
1033
+ - trailing
1034
+
1035
+ Layout/LineContinuationSpacing:
1036
+ Description: 'Checks the spacing in front of backslash in line continuations.'
1037
+ Enabled: true
1038
+ VersionAdded: '1.31'
1039
+ EnforcedStyle: space
1040
+ SupportedStyles:
1041
+ - space
1042
+ - no_space
1043
+
985
1044
  Layout/LineEndStringConcatenationIndentation:
986
1045
  Description: >-
987
1046
  Checks the indentation of the next line after a line that
@@ -1017,7 +1076,6 @@ Layout/LineLength:
1017
1076
  # elements. Strings will be converted to Regexp objects. A line that matches
1018
1077
  # any regular expression listed in this option will be ignored by LineLength.
1019
1078
  AllowedPatterns: []
1020
- # IgnoredPatterns: []
1021
1079
 
1022
1080
  Layout/MultilineArrayBraceLayout:
1023
1081
  Description: >-
@@ -1041,6 +1099,7 @@ Layout/MultilineArrayLineBreaks:
1041
1099
  starts on a separate line.
1042
1100
  Enabled: false
1043
1101
  VersionAdded: '0.67'
1102
+ AllowMultilineFinalElement: false
1044
1103
 
1045
1104
  Layout/MultilineAssignmentLayout:
1046
1105
  Description: 'Check for a newline after the assignment operator in multi-line assignments.'
@@ -1091,6 +1150,7 @@ Layout/MultilineHashKeyLineBreaks:
1091
1150
  starts on a separate line.
1092
1151
  Enabled: false
1093
1152
  VersionAdded: '0.67'
1153
+ AllowMultilineFinalElement: false
1094
1154
 
1095
1155
  Layout/MultilineMethodArgumentLineBreaks:
1096
1156
  Description: >-
@@ -1098,6 +1158,7 @@ Layout/MultilineMethodArgumentLineBreaks:
1098
1158
  starts on a separate line.
1099
1159
  Enabled: false
1100
1160
  VersionAdded: '0.67'
1161
+ AllowMultilineFinalElement: false
1101
1162
 
1102
1163
  Layout/MultilineMethodCallBraceLayout:
1103
1164
  Description: >-
@@ -1146,6 +1207,14 @@ Layout/MultilineMethodDefinitionBraceLayout:
1146
1207
  - new_line
1147
1208
  - same_line
1148
1209
 
1210
+ Layout/MultilineMethodParameterLineBreaks:
1211
+ Description: >-
1212
+ Checks that each parameter in a multi-line method definition
1213
+ starts on a separate line.
1214
+ Enabled: false
1215
+ VersionAdded: '1.32'
1216
+ AllowMultilineFinalElement: false
1217
+
1149
1218
  Layout/MultilineOperationIndentation:
1150
1219
  Description: >-
1151
1220
  Checks indentation of binary operations that span more than
@@ -1284,6 +1353,10 @@ Layout/SpaceAroundOperators:
1284
1353
  SupportedStylesForExponentOperator:
1285
1354
  - space
1286
1355
  - no_space
1356
+ EnforcedStyleForRationalLiterals: no_space
1357
+ SupportedStylesForRationalLiterals:
1358
+ - space
1359
+ - no_space
1287
1360
 
1288
1361
  Layout/SpaceBeforeBlockBraces:
1289
1362
  Description: >-
@@ -1479,11 +1552,11 @@ Lint/AmbiguousBlockAssociation:
1479
1552
  Description: >-
1480
1553
  Checks for ambiguous block association with method when param passed without
1481
1554
  parentheses.
1482
- StyleGuide: '#syntax'
1483
1555
  Enabled: true
1484
1556
  VersionAdded: '0.48'
1485
1557
  VersionChanged: '1.13'
1486
- IgnoredMethods: []
1558
+ AllowedMethods: []
1559
+ AllowedPatterns: []
1487
1560
 
1488
1561
  Lint/AmbiguousOperator:
1489
1562
  Description: >-
@@ -1520,7 +1593,9 @@ Lint/AssignmentInCondition:
1520
1593
  Description: "Don't use assignment in conditions."
1521
1594
  StyleGuide: '#safe-assignment-in-condition'
1522
1595
  Enabled: true
1596
+ SafeAutoCorrect: false
1523
1597
  VersionAdded: '0.9'
1598
+ VersionChanged: '1.45'
1524
1599
  AllowSafeAssignment: true
1525
1600
 
1526
1601
  Lint/BigDecimalNew:
@@ -1529,7 +1604,7 @@ Lint/BigDecimalNew:
1529
1604
  VersionAdded: '0.53'
1530
1605
 
1531
1606
  Lint/BinaryOperatorWithIdenticalOperands:
1532
- Description: 'This cop checks for places where binary operator has identical operands.'
1607
+ Description: 'Checks for places where binary operator has identical operands.'
1533
1608
  Enabled: true
1534
1609
  Safe: false
1535
1610
  VersionAdded: '0.89'
@@ -1558,6 +1633,11 @@ Lint/ConstantDefinitionInBlock:
1558
1633
  AllowedMethods:
1559
1634
  - enums
1560
1635
 
1636
+ Lint/ConstantOverwrittenInRescue:
1637
+ Description: 'Checks for overwriting an exception with an exception result by use `rescue =>`.'
1638
+ Enabled: true
1639
+ VersionAdded: '1.31'
1640
+
1561
1641
  Lint/ConstantResolution:
1562
1642
  Description: 'Check that constants are fully qualified with `::`.'
1563
1643
  Enabled: false
@@ -1571,13 +1651,13 @@ Lint/Debugger:
1571
1651
  Description: 'Check for debugger calls.'
1572
1652
  Enabled: true
1573
1653
  VersionAdded: '0.14'
1574
- VersionChanged: '1.10'
1575
- #DebuggerReceivers: [] # deprecated
1654
+ VersionChanged: '1.46'
1576
1655
  DebuggerMethods:
1577
1656
  # Groups are available so that a specific group can be disabled in
1578
1657
  # a user's configuration, but are otherwise not significant.
1579
1658
  Kernel:
1580
1659
  - binding.irb
1660
+ - Kernel.binding.irb
1581
1661
  Byebug:
1582
1662
  - byebug
1583
1663
  - remote_byebug
@@ -1595,7 +1675,11 @@ Lint/Debugger:
1595
1675
  - binding.pry
1596
1676
  - binding.remote_pry
1597
1677
  - binding.pry_remote
1678
+ - Kernel.binding.pry
1679
+ - Kernel.binding.remote_pry
1680
+ - Kernel.binding.pry_remote
1598
1681
  - Pry.rescue
1682
+ - pry
1599
1683
  Rails:
1600
1684
  - debugger
1601
1685
  - Kernel.debugger
@@ -1613,7 +1697,7 @@ Lint/DeprecatedConstants:
1613
1697
  Description: 'Checks for deprecated constants.'
1614
1698
  Enabled: true
1615
1699
  VersionAdded: '1.8'
1616
- VersionChanged: '1.22'
1700
+ VersionChanged: '1.40'
1617
1701
  # You can configure deprecated constants.
1618
1702
  # If there is an alternative method, you can set alternative value as `Alternative`.
1619
1703
  # And you can set the deprecated version as `DeprecatedVersion`.
@@ -1640,6 +1724,12 @@ Lint/DeprecatedConstants:
1640
1724
  'Random::DEFAULT':
1641
1725
  Alternative: 'Random.new'
1642
1726
  DeprecatedVersion: '3.0'
1727
+ 'Struct::Group':
1728
+ Alternative: 'Etc::Group'
1729
+ DeprecatedVersion: '3.0'
1730
+ 'Struct::Passwd':
1731
+ Alternative: 'Etc::Passwd'
1732
+ DeprecatedVersion: '3.0'
1643
1733
 
1644
1734
  Lint/DeprecatedOpenSSLConstant:
1645
1735
  Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
@@ -1677,6 +1767,16 @@ Lint/DuplicateHashKey:
1677
1767
  VersionAdded: '0.34'
1678
1768
  VersionChanged: '0.77'
1679
1769
 
1770
+ Lint/DuplicateMagicComment:
1771
+ Description: 'Check for duplicated magic comments.'
1772
+ Enabled: true
1773
+ VersionAdded: '1.37'
1774
+
1775
+ Lint/DuplicateMatchPattern:
1776
+ Description: 'Do not repeat patterns in `in` keywords.'
1777
+ Enabled: true
1778
+ VersionAdded: '1.50'
1779
+
1680
1780
  Lint/DuplicateMethods:
1681
1781
  Description: 'Check for duplicate method definitions.'
1682
1782
  Enabled: true
@@ -1727,8 +1827,10 @@ Lint/EmptyClass:
1727
1827
  Lint/EmptyConditionalBody:
1728
1828
  Description: 'Checks for the presence of `if`, `elsif` and `unless` branches without a body.'
1729
1829
  Enabled: true
1830
+ SafeAutoCorrect: false
1730
1831
  AllowComments: true
1731
1832
  VersionAdded: '0.89'
1833
+ VersionChanged: '1.34'
1732
1834
 
1733
1835
  Lint/EmptyEnsure:
1734
1836
  Description: 'Checks for empty ensure block.'
@@ -1857,11 +1959,17 @@ Lint/InheritException:
1857
1959
  - runtime_error
1858
1960
 
1859
1961
  Lint/InterpolationCheck:
1860
- Description: 'Raise warning for interpolation in single q strs.'
1962
+ Description: 'Checks for interpolation in a single quoted string.'
1861
1963
  Enabled: true
1862
- Safe: false
1964
+ SafeAutoCorrect: false
1863
1965
  VersionAdded: '0.50'
1864
- VersionChanged: '0.87'
1966
+ VersionChanged: '1.40'
1967
+
1968
+ Lint/ItWithoutArgumentsInBlock:
1969
+ Description: 'Checks uses of `it` calls without arguments in block.'
1970
+ Reference: 'https://bugs.ruby-lang.org/issues/18980'
1971
+ Enabled: true
1972
+ VersionAdded: '1.59'
1865
1973
 
1866
1974
  Lint/LambdaWithoutLiteralBlock:
1867
1975
  Description: 'Checks uses of lambda without a literal block.'
@@ -1873,6 +1981,11 @@ Lint/LiteralAsCondition:
1873
1981
  Enabled: true
1874
1982
  VersionAdded: '0.51'
1875
1983
 
1984
+ Lint/LiteralAssignmentInCondition:
1985
+ Description: 'Checks for literal assignments in the conditions.'
1986
+ Enabled: true
1987
+ VersionAdded: '1.58'
1988
+
1876
1989
  Lint/LiteralInInterpolation:
1877
1990
  Description: 'Checks for literals used in interpolation.'
1878
1991
  Enabled: true
@@ -1907,9 +2020,16 @@ Lint/MissingSuper:
1907
2020
  Checks for the presence of constructors and lifecycle callbacks
1908
2021
  without calls to `super`.
1909
2022
  Enabled: true
2023
+ AllowedParentClasses: []
1910
2024
  VersionAdded: '0.89'
1911
2025
  VersionChanged: '1.4'
1912
2026
 
2027
+ Lint/MixedCaseRange:
2028
+ Description: 'Checks for mixed-case character ranges since they include likely unintended characters.'
2029
+ Enabled: true
2030
+ SafeAutoCorrect: false
2031
+ VersionAdded: '1.53'
2032
+
1913
2033
  Lint/MixedRegexpCaptureTypes:
1914
2034
  Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
1915
2035
  Enabled: true
@@ -1925,6 +2045,8 @@ Lint/NestedMethodDefinition:
1925
2045
  Description: 'Do not use nested method definitions.'
1926
2046
  StyleGuide: '#no-nested-methods'
1927
2047
  Enabled: true
2048
+ AllowedMethods: []
2049
+ AllowedPatterns: []
1928
2050
  VersionAdded: '0.32'
1929
2051
 
1930
2052
  Lint/NestedPercentLiteral:
@@ -1944,6 +2066,13 @@ Lint/NoReturnInBeginEndBlocks:
1944
2066
  Enabled: true
1945
2067
  VersionAdded: '1.2'
1946
2068
 
2069
+ Lint/NonAtomicFileOperation:
2070
+ Description: Checks for non-atomic file operations.
2071
+ StyleGuide: '#atomic-file-operations'
2072
+ Enabled: true
2073
+ VersionAdded: '1.31'
2074
+ SafeAutoCorrect: false
2075
+
1947
2076
  Lint/NonDeterministicRequireOrder:
1948
2077
  Description: 'Always sort arrays returned by Dir.glob when requiring files.'
1949
2078
  Enabled: true
@@ -1961,7 +2090,8 @@ Lint/NumberConversion:
1961
2090
  VersionAdded: '0.53'
1962
2091
  VersionChanged: '1.1'
1963
2092
  SafeAutoCorrect: false
1964
- IgnoredMethods: []
2093
+ AllowedMethods: []
2094
+ AllowedPatterns: []
1965
2095
  IgnoredClasses:
1966
2096
  - Time
1967
2097
  - DateTime
@@ -1980,7 +2110,9 @@ Lint/OrAssignmentToConstant:
1980
2110
  Lint/OrderedMagicComments:
1981
2111
  Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
1982
2112
  Enabled: true
2113
+ SafeAutoCorrect: false
1983
2114
  VersionAdded: '0.53'
2115
+ VersionChanged: '1.37'
1984
2116
 
1985
2117
  Lint/OutOfRangeRegexpRef:
1986
2118
  Description: 'Checks for out of range reference for Regexp because it always returns nil.'
@@ -2047,10 +2179,17 @@ Lint/RedundantDirGlobSort:
2047
2179
  VersionChanged: '1.26'
2048
2180
  SafeAutoCorrect: false
2049
2181
 
2182
+ Lint/RedundantRegexpQuantifiers:
2183
+ Description: 'Checks for redundant quantifiers in Regexps.'
2184
+ Enabled: true
2185
+ VersionAdded: '1.53'
2186
+
2050
2187
  Lint/RedundantRequireStatement:
2051
2188
  Description: 'Checks for unnecessary `require` statement.'
2052
2189
  Enabled: true
2190
+ SafeAutoCorrect: false
2053
2191
  VersionAdded: '0.76'
2192
+ VersionChanged: '1.57'
2054
2193
 
2055
2194
  Lint/RedundantSafeNavigation:
2056
2195
  Description: 'Checks for redundant safe navigation calls.'
@@ -2110,6 +2249,11 @@ Lint/RequireParentheses:
2110
2249
  Enabled: true
2111
2250
  VersionAdded: '0.18'
2112
2251
 
2252
+ Lint/RequireRangeParentheses:
2253
+ Description: 'Checks that a range literal is enclosed in parentheses when the end of the range is at a line break.'
2254
+ Enabled: true
2255
+ VersionAdded: '1.32'
2256
+
2113
2257
  Lint/RequireRelativeSelfPath:
2114
2258
  Description: 'Checks for uses a file requiring itself with `require_relative`.'
2115
2259
  Enabled: true
@@ -2246,6 +2390,9 @@ Lint/TopLevelReturnWithArgument:
2246
2390
  Description: 'Detects top level return statements with argument.'
2247
2391
  Enabled: true
2248
2392
  VersionAdded: '0.89'
2393
+ # These codes are `eval`-ed in method and their return values may be used.
2394
+ Exclude:
2395
+ - '**/*.jb'
2249
2396
 
2250
2397
  Lint/TrailingCommaInAttributeDeclaration:
2251
2398
  Description: 'Checks for trailing commas in attribute declarations.'
@@ -2305,7 +2452,6 @@ Lint/UnreachableLoop:
2305
2452
  # RSpec uses `times` in its message expectations
2306
2453
  # eg. `exactly(2).times`
2307
2454
  - !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
2308
- # IgnoredPatterns: [] # deprecated
2309
2455
 
2310
2456
  Lint/UnusedBlockArgument:
2311
2457
  Description: 'Checks for unused block arguments.'
@@ -2355,6 +2501,14 @@ Lint/UselessAssignment:
2355
2501
  StyleGuide: '#underscore-unused-vars'
2356
2502
  Enabled: true
2357
2503
  VersionAdded: '0.11'
2504
+ VersionChanged: '1.51'
2505
+ SafeAutoCorrect: false
2506
+
2507
+ Lint/UselessElseWithoutRescue:
2508
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
2509
+ Enabled: true
2510
+ VersionAdded: '0.17'
2511
+ VersionChanged: '1.31'
2358
2512
 
2359
2513
  Lint/UselessMethodDefinition:
2360
2514
  Description: 'Checks for useless method definitions.'
@@ -2363,6 +2517,11 @@ Lint/UselessMethodDefinition:
2363
2517
  VersionChanged: '0.91'
2364
2518
  Safe: false
2365
2519
 
2520
+ Lint/UselessRescue:
2521
+ Description: 'Checks for useless `rescue`s.'
2522
+ Enabled: true
2523
+ VersionAdded: '1.43'
2524
+
2366
2525
  Lint/UselessRuby2Keywords:
2367
2526
  Description: 'Finds unnecessary uses of `ruby2_keywords`.'
2368
2527
  Enabled: true
@@ -2371,10 +2530,9 @@ Lint/UselessRuby2Keywords:
2371
2530
  Lint/UselessSetterCall:
2372
2531
  Description: 'Checks for useless setter call to a local variable.'
2373
2532
  Enabled: true
2374
- SafeAutoCorrect: false
2533
+ Safe: false
2375
2534
  VersionAdded: '0.13'
2376
2535
  VersionChanged: '1.2'
2377
- Safe: false
2378
2536
 
2379
2537
  Lint/UselessTimes:
2380
2538
  Description: 'Checks for useless `Integer#times` calls.'
@@ -2402,9 +2560,12 @@ Metrics/AbcSize:
2402
2560
  VersionChanged: '1.5'
2403
2561
  # The ABC size is a calculated magnitude, so this number can be an Integer or
2404
2562
  # a Float.
2405
- IgnoredMethods: []
2563
+ AllowedMethods: []
2564
+ AllowedPatterns: []
2406
2565
  CountRepeatedAttributes: true
2407
2566
  Max: 30
2567
+ Exclude:
2568
+ - 'db/migrate/**/*'
2408
2569
 
2409
2570
  Metrics/BlockLength:
2410
2571
  Description: 'Avoid long blocks with many lines.'
@@ -2414,13 +2575,14 @@ Metrics/BlockLength:
2414
2575
  CountComments: false # count full line comments?
2415
2576
  Max: 50
2416
2577
  CountAsOne: []
2417
- #ExcludedMethods: [] # deprecated, retained for backwards compatibility
2418
- IgnoredMethods:
2578
+ AllowedMethods:
2419
2579
  # By default, exclude the `#refine` method, as it tends to have larger
2420
2580
  # associated blocks.
2421
2581
  - refine
2582
+ AllowedPatterns: []
2422
2583
  Exclude:
2423
2584
  - '**/*.gemspec'
2585
+ - 'app/avo/resources/**/*.rb'
2424
2586
 
2425
2587
  Metrics/BlockNesting:
2426
2588
  Description: 'Avoid excessive block nesting.'
@@ -2440,6 +2602,12 @@ Metrics/ClassLength:
2440
2602
  Max: 300
2441
2603
  CountAsOne: []
2442
2604
 
2605
+ Metrics/CollectionLiteralLength:
2606
+ Description: 'Checks for `Array` or `Hash` literals with many entries.'
2607
+ Enabled: true
2608
+ VersionAdded: '1.47'
2609
+ LengthThreshold: 250
2610
+
2443
2611
  # Avoid complex methods.
2444
2612
  Metrics/CyclomaticComplexity:
2445
2613
  Description: >-
@@ -2448,8 +2616,11 @@ Metrics/CyclomaticComplexity:
2448
2616
  Enabled: true
2449
2617
  VersionAdded: '0.25'
2450
2618
  VersionChanged: '0.81'
2451
- IgnoredMethods: []
2619
+ AllowedMethods: []
2620
+ AllowedPatterns: []
2452
2621
  Max: 10
2622
+ Exclude:
2623
+ - 'db/migrate/**/*'
2453
2624
 
2454
2625
  Metrics/MethodLength:
2455
2626
  Description: 'Avoid methods longer than 10 lines of code.'
@@ -2460,8 +2631,8 @@ Metrics/MethodLength:
2460
2631
  CountComments: false # count full line comments?
2461
2632
  Max: 50
2462
2633
  CountAsOne: []
2463
- #ExcludedMethods: [] # deprecated, retained for backwards compatibility
2464
- IgnoredMethods: []
2634
+ AllowedMethods: []
2635
+ AllowedPatterns: []
2465
2636
 
2466
2637
  Metrics/ModuleLength:
2467
2638
  Description: 'Avoid modules longer than 100 lines of code.'
@@ -2489,8 +2660,11 @@ Metrics/PerceivedComplexity:
2489
2660
  Enabled: true
2490
2661
  VersionAdded: '0.25'
2491
2662
  VersionChanged: '0.81'
2492
- IgnoredMethods: []
2663
+ AllowedMethods: []
2664
+ AllowedPatterns: []
2493
2665
  Max: 8
2666
+ Exclude:
2667
+ - 'db/migrate/**/*'
2494
2668
 
2495
2669
  ################## Migration #############################
2496
2670
 
@@ -2498,7 +2672,7 @@ Migration/DepartmentName:
2498
2672
  Description: >-
2499
2673
  Check that cop names in rubocop:disable (etc) comments are
2500
2674
  given with department name.
2501
- Enabled: true
2675
+ Enabled: false
2502
2676
  VersionAdded: '0.75'
2503
2677
 
2504
2678
  #################### Naming ##############################
@@ -2660,13 +2834,13 @@ Naming/HeredocDelimiterNaming:
2660
2834
  Enabled: true
2661
2835
  VersionAdded: '0.50'
2662
2836
  ForbiddenDelimiters:
2663
- - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
2837
+ - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/i'
2664
2838
 
2665
2839
  Naming/InclusiveLanguage:
2666
2840
  Description: 'Recommend the use of inclusive language instead of problematic terms.'
2667
- Enabled: false
2841
+ Enabled: true
2668
2842
  VersionAdded: '1.18'
2669
- VersionChanged: '1.21'
2843
+ VersionChanged: '1.49'
2670
2844
  CheckIdentifiers: true
2671
2845
  CheckConstants: true
2672
2846
  CheckVariables: true
@@ -2678,12 +2852,12 @@ Naming/InclusiveLanguage:
2678
2852
  whitelist:
2679
2853
  Regex: !ruby/regexp '/white[-_\s]?list/'
2680
2854
  Suggestions:
2681
- - allowlist
2855
+ - allow_list
2682
2856
  - permit
2683
2857
  blacklist:
2684
2858
  Regex: !ruby/regexp '/black[-_\s]?list/'
2685
2859
  Suggestions:
2686
- - denylist
2860
+ - deny_list
2687
2861
  - block
2688
2862
  slave:
2689
2863
  WholeWord: true
@@ -2718,32 +2892,31 @@ Naming/MethodName:
2718
2892
  # - '\A\s*onSelectionCleared\s*'
2719
2893
  #
2720
2894
  AllowedPatterns: []
2721
- # IgnoredPatterns: [] # deprecated
2722
2895
 
2723
2896
  Naming/MethodParameterName:
2724
2897
  Description: >-
2725
2898
  Checks for method parameter names that contain capital letters,
2726
2899
  end in numbers, or do not meet a minimal length.
2727
- Enabled: true
2900
+ Enabled: false
2728
2901
  VersionAdded: '0.53'
2729
2902
  VersionChanged: '0.77'
2730
2903
  # Parameter names may be equal to or greater than this value
2731
- MinNameLength: 1
2904
+ MinNameLength: 3
2732
2905
  AllowNamesEndingInNumbers: true
2733
2906
  # Allowed names that will not register an offense
2734
2907
  AllowedNames:
2908
+ - as
2735
2909
  - at
2736
2910
  - by
2911
+ - cc
2737
2912
  - db
2738
2913
  - id
2914
+ - if
2739
2915
  - in
2740
2916
  - io
2741
2917
  - ip
2742
2918
  - of
2743
2919
  - 'on'
2744
- - os
2745
- - pp
2746
- - to
2747
2920
  # Forbidden names that will register an offense
2748
2921
  ForbiddenNames: []
2749
2922
 
@@ -2808,7 +2981,7 @@ Naming/VariableNumber:
2808
2981
  - normalcase
2809
2982
  - non_integer
2810
2983
  CheckMethodNames: true
2811
- CheckSymbols: true
2984
+ CheckSymbols: false
2812
2985
  AllowedIdentifiers:
2813
2986
  - capture3 # Open3.capture3
2814
2987
  - iso8601 # Time#iso8601
@@ -2816,6 +2989,7 @@ Naming/VariableNumber:
2816
2989
  - rfc822 # Time#rfc822
2817
2990
  - rfc2822 # Time#rfc2822
2818
2991
  - rfc3339 # DateTime.rfc3339
2992
+ - x86_64 # Allowed by default as an underscore separated CPU architecture name
2819
2993
  AllowedPatterns: []
2820
2994
 
2821
2995
  #################### Security ##############################
@@ -2823,7 +2997,9 @@ Naming/VariableNumber:
2823
2997
  Security/CompoundHash:
2824
2998
  Description: 'When overwriting Object#hash to combine values, prefer delegating to Array#hash over writing a custom implementation.'
2825
2999
  Enabled: true
3000
+ Safe: false
2826
3001
  VersionAdded: '1.28'
3002
+ VersionChanged: '1.51'
2827
3003
 
2828
3004
  Security/Eval:
2829
3005
  Description: 'The use of eval represents a serious security risk.'
@@ -2878,7 +3054,7 @@ Security/YAMLLoad:
2878
3054
 
2879
3055
  Style/AccessModifierDeclarations:
2880
3056
  Description: 'Checks style of how access modifiers are used.'
2881
- Enabled: true
3057
+ Enabled: false
2882
3058
  VersionAdded: '0.57'
2883
3059
  VersionChanged: '0.81'
2884
3060
  EnforcedStyle: group
@@ -2886,6 +3062,7 @@ Style/AccessModifierDeclarations:
2886
3062
  - inline
2887
3063
  - group
2888
3064
  AllowModifiersOnSymbols: true
3065
+ SafeAutoCorrect: false
2889
3066
 
2890
3067
  Style/AccessorGrouping:
2891
3068
  Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
@@ -2927,8 +3104,21 @@ Style/ArgumentsForwarding:
2927
3104
  Description: 'Use arguments forwarding.'
2928
3105
  StyleGuide: '#arguments-forwarding'
2929
3106
  Enabled: true
2930
- AllowOnlyRestArgument: true
3107
+ # AllowOnlyRestArgument: true
3108
+ UseAnonymousForwarding: true
3109
+ RedundantRestArgumentNames:
3110
+ - args
3111
+ - arguments
3112
+ RedundantKeywordRestArgumentNames:
3113
+ - kwargs
3114
+ - options
3115
+ - opts
3116
+ RedundantBlockArgumentNames:
3117
+ - blk
3118
+ - block
3119
+ - proc
2931
3120
  VersionAdded: '1.1'
3121
+ VersionChanged: '1.58'
2932
3122
 
2933
3123
  Style/ArrayCoercion:
2934
3124
  Description: >-
@@ -2939,6 +3129,19 @@ Style/ArrayCoercion:
2939
3129
  Enabled: true
2940
3130
  VersionAdded: '0.88'
2941
3131
 
3132
+ Style/ArrayFirstLast:
3133
+ Description: 'Use `arr.first` and `arr.last` instead of `arr[0]` and `arr[-1]`.'
3134
+ Reference: '#first-and-last'
3135
+ Enabled: false
3136
+ VersionAdded: '1.58'
3137
+ Safe: false
3138
+
3139
+ Style/ArrayIntersect:
3140
+ Description: 'Use `array1.intersect?(array2)` instead of `(array1 & array2).any?`.'
3141
+ Enabled: true
3142
+ Safe: false
3143
+ VersionAdded: '1.40'
3144
+
2942
3145
  Style/ArrayJoin:
2943
3146
  Description: 'Use Array#join instead of Array#*.'
2944
3147
  StyleGuide: '#array-join'
@@ -3020,7 +3223,7 @@ Style/BlockDelimiters:
3020
3223
  # This looks at the usage of a block's method to determine its type (e.g. is
3021
3224
  # the result of a `map` assigned to a variable or passed to another
3022
3225
  # method) but exceptions are permitted in the `ProceduralMethods`,
3023
- # `FunctionalMethods` and `IgnoredMethods` sections below.
3226
+ # `FunctionalMethods` and `AllowedMethods` sections below.
3024
3227
  - semantic
3025
3228
  # The `braces_for_chaining` style enforces braces around single line blocks
3026
3229
  # and do..end around multi-line blocks, except for multi-line blocks whose
@@ -3061,7 +3264,7 @@ Style/BlockDelimiters:
3061
3264
  - let!
3062
3265
  - subject
3063
3266
  - watch
3064
- IgnoredMethods:
3267
+ AllowedMethods:
3065
3268
  # Methods that can be either procedural or functional and cannot be
3066
3269
  # categorised from their usage alone, e.g.
3067
3270
  #
@@ -3078,6 +3281,7 @@ Style/BlockDelimiters:
3078
3281
  - lambda
3079
3282
  - proc
3080
3283
  - it
3284
+ AllowedPatterns: []
3081
3285
  # The AllowBracesOnProceduralOneLiners option is ignored unless the
3082
3286
  # EnforcedStyle is set to `semantic`. If so:
3083
3287
  #
@@ -3101,7 +3305,7 @@ Style/BlockDelimiters:
3101
3305
  # collection.each do |element| puts element end
3102
3306
  AllowBracesOnProceduralOneLiners: false
3103
3307
  # The BracesRequiredMethods overrides all other configurations except
3104
- # IgnoredMethods. It can be used to enforce that all blocks for specific
3308
+ # AllowedMethods. It can be used to enforce that all blocks for specific
3105
3309
  # methods use braces. For example, you can use this to enforce Sorbet
3106
3310
  # signatures use braces even when the rest of your codebase enforces
3107
3311
  # the `line_count_based` style.
@@ -3122,6 +3326,15 @@ Style/CaseEquality:
3122
3326
  # # good
3123
3327
  # String === "string"
3124
3328
  AllowOnConstant: false
3329
+ # If `AllowOnSelfClass` option is enabled, the cop will ignore violations when the receiver of
3330
+ # the case equality operator is `self.class`.
3331
+ #
3332
+ # # bad
3333
+ # some_class === object
3334
+ #
3335
+ # # good
3336
+ # self.class === object
3337
+ AllowOnSelfClass: false
3125
3338
 
3126
3339
  Style/CaseLikeIf:
3127
3340
  Description: 'Identifies places where `if-elsif` constructions can be replaced with `case-when`.'
@@ -3129,6 +3342,9 @@ Style/CaseLikeIf:
3129
3342
  Enabled: true
3130
3343
  Safe: false
3131
3344
  VersionAdded: '0.88'
3345
+ VersionChanged: '1.48'
3346
+ # `MinBranchesCount` defines the number of branches `if` needs to have to trigger this cop.
3347
+ MinBranchesCount: 3
3132
3348
 
3133
3349
  Style/CharacterLiteral:
3134
3350
  Description: 'Checks for uses of character literals.'
@@ -3141,11 +3357,11 @@ Style/ClassAndModuleChildren:
3141
3357
  StyleGuide: '#namespace-definition'
3142
3358
  # Moving from compact to nested children requires knowledge of whether the
3143
3359
  # outer parent is a module or a class. Moving from nested to compact requires
3144
- # verification that the outer parent is defined elsewhere. Rubocop does not
3360
+ # verification that the outer parent is defined elsewhere. RuboCop does not
3145
3361
  # have the knowledge to perform either operation safely and thus requires
3146
3362
  # manual oversight.
3147
3363
  SafeAutoCorrect: false
3148
- Enabled: true
3364
+ Enabled: false
3149
3365
  VersionAdded: '0.19'
3150
3366
  #
3151
3367
  # Basically there are two different styles:
@@ -3180,11 +3396,14 @@ Style/ClassEqualityComparison:
3180
3396
  Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
3181
3397
  StyleGuide: '#instance-of-vs-class-comparison'
3182
3398
  Enabled: true
3399
+ SafeAutoCorrect: false
3183
3400
  VersionAdded: '0.93'
3184
- IgnoredMethods:
3401
+ VersionChanged: '1.57'
3402
+ AllowedMethods:
3185
3403
  - ==
3186
3404
  - equal?
3187
3405
  - eql?
3406
+ AllowedPatterns: []
3188
3407
 
3189
3408
  Style/ClassMethods:
3190
3409
  Description: 'Use self when defining module/class methods.'
@@ -3215,6 +3434,7 @@ Style/CollectionCompact:
3215
3434
  Safe: false
3216
3435
  VersionAdded: '1.2'
3217
3436
  VersionChanged: '1.3'
3437
+ AllowedReceivers: []
3218
3438
 
3219
3439
  # Align with the style guide.
3220
3440
  Style/CollectionMethods:
@@ -3233,6 +3453,7 @@ Style/CollectionMethods:
3233
3453
  PreferredMethods:
3234
3454
  collect: 'map'
3235
3455
  collect!: 'map!'
3456
+ collect_concat: 'flat_map'
3236
3457
  inject: 'reduce'
3237
3458
  detect: 'find'
3238
3459
  find_all: 'select'
@@ -3305,6 +3526,17 @@ Style/CommentedKeyword:
3305
3526
  VersionAdded: '0.51'
3306
3527
  VersionChanged: '1.19'
3307
3528
 
3529
+ Style/ComparableClamp:
3530
+ Description: 'Enforces the use of `Comparable#clamp` instead of comparison by minimum and maximum.'
3531
+ Enabled: true
3532
+ VersionAdded: '1.44'
3533
+
3534
+ Style/ConcatArrayLiterals:
3535
+ Description: 'Enforces the use of `Array#push(item)` instead of `Array#concat([item])` to avoid redundant array literals.'
3536
+ Enabled: true
3537
+ Safe: false
3538
+ VersionAdded: '1.41'
3539
+
3308
3540
  Style/ConditionalAssignment:
3309
3541
  Description: >-
3310
3542
  Use the return value of `if` and `case` statements for
@@ -3360,10 +3592,18 @@ Style/Copyright:
3360
3592
  Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
3361
3593
  AutocorrectNotice: ''
3362
3594
 
3595
+ Style/DataInheritance:
3596
+ Description: 'Checks for inheritance from Data.define.'
3597
+ StyleGuide: '#no-extend-data-define'
3598
+ Enabled: true
3599
+ SafeAutoCorrect: false
3600
+ VersionAdded: '1.49'
3601
+ VersionChanged: '1.51'
3602
+
3363
3603
  Style/DateTime:
3364
3604
  Description: 'Use Time over DateTime.'
3365
- StyleGuide: '#date--time'
3366
- Enabled: false
3605
+ StyleGuide: '#date-time'
3606
+ Enabled: true
3367
3607
  VersionAdded: '0.51'
3368
3608
  VersionChanged: '0.92'
3369
3609
  SafeAutoCorrect: false
@@ -3383,6 +3623,12 @@ Style/Dir:
3383
3623
  Enabled: true
3384
3624
  VersionAdded: '0.50'
3385
3625
 
3626
+ Style/DirEmpty:
3627
+ Description: >-
3628
+ Prefer to use `Dir.empty?('path/to/dir')` when checking if a directory is empty.
3629
+ Enabled: true
3630
+ VersionAdded: '1.48'
3631
+
3386
3632
  Style/DisableCopsWithinSourceCodeDirective:
3387
3633
  Description: >-
3388
3634
  Forbids disabling/enabling cops within source code.
@@ -3471,6 +3717,12 @@ Style/EmptyElse:
3471
3717
  - empty
3472
3718
  - nil
3473
3719
  - both
3720
+ AllowComments: false
3721
+
3722
+ Style/EmptyHeredoc:
3723
+ Description: 'Checks for using empty heredoc to reduce redundancy.'
3724
+ Enabled: true
3725
+ VersionAdded: '1.32'
3474
3726
 
3475
3727
  Style/EmptyLambdaParameter:
3476
3728
  Description: 'Omit parens for empty lambda parameters.'
@@ -3537,6 +3789,11 @@ Style/EvenOdd:
3537
3789
  VersionAdded: '0.12'
3538
3790
  VersionChanged: '0.29'
3539
3791
 
3792
+ Style/ExactRegexpMatch:
3793
+ Description: 'Checks for exact regexp match inside Regexp literals.'
3794
+ Enabled: true
3795
+ VersionAdded: '1.51'
3796
+
3540
3797
  Style/ExpandPathArguments:
3541
3798
  Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`."
3542
3799
  Enabled: true
@@ -3572,6 +3829,13 @@ Style/FetchEnvVar:
3572
3829
  # Environment variables to be excluded from the inspection.
3573
3830
  AllowedVars: []
3574
3831
 
3832
+ Style/FileEmpty:
3833
+ Description: >-
3834
+ Prefer to use `File.empty?('path/to/file')` when checking if a file is empty.
3835
+ Enabled: true
3836
+ Safe: false
3837
+ VersionAdded: '1.48'
3838
+
3575
3839
  Style/FileRead:
3576
3840
  Description: 'Favor `File.(bin)read` convenience methods.'
3577
3841
  StyleGuide: '#file-read'
@@ -3617,7 +3881,7 @@ Style/FormatString:
3617
3881
  Enabled: true
3618
3882
  VersionAdded: '0.19'
3619
3883
  VersionChanged: '0.49'
3620
- EnforcedStyle: format
3884
+ EnforcedStyle: sprintf
3621
3885
  SupportedStyles:
3622
3886
  - format
3623
3887
  - sprintf
@@ -3640,7 +3904,8 @@ Style/FormatStringToken:
3640
3904
  MaxUnannotatedPlaceholdersAllowed: 1
3641
3905
  VersionAdded: '0.49'
3642
3906
  VersionChanged: '1.0'
3643
- IgnoredMethods: []
3907
+ AllowedMethods: []
3908
+ AllowedPatterns: []
3644
3909
 
3645
3910
  Style/FrozenStringLiteralComment:
3646
3911
  Description: >-
@@ -3685,7 +3950,7 @@ Style/GuardClause:
3685
3950
  StyleGuide: '#no-nested-conditionals'
3686
3951
  Enabled: true
3687
3952
  VersionAdded: '0.20'
3688
- VersionChanged: '1.28'
3953
+ VersionChanged: '1.31'
3689
3954
  # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
3690
3955
  # needs to have to trigger this cop
3691
3956
  MinBodyLength: 1
@@ -3707,8 +3972,9 @@ Style/HashConversion:
3707
3972
  Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
3708
3973
  StyleGuide: '#avoid-hash-constructor'
3709
3974
  Enabled: true
3975
+ SafeAutoCorrect: false
3710
3976
  VersionAdded: '1.10'
3711
- VersionChanged: '1.11'
3977
+ VersionChanged: '1.55'
3712
3978
  AllowSplatArgument: true
3713
3979
 
3714
3980
  Style/HashEachMethods:
@@ -3718,14 +3984,17 @@ Style/HashEachMethods:
3718
3984
  Safe: false
3719
3985
  VersionAdded: '0.80'
3720
3986
  VersionChanged: '1.16'
3721
- AllowedReceivers: []
3987
+ AllowedReceivers:
3988
+ - Thread.current
3722
3989
 
3723
3990
  Style/HashExcept:
3724
3991
  Description: >-
3725
3992
  Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
3726
3993
  that can be replaced with `Hash#except` method.
3727
3994
  Enabled: true
3995
+ Safe: false
3728
3996
  VersionAdded: '1.7'
3997
+ VersionChanged: '1.39'
3729
3998
 
3730
3999
  Style/HashLikeCase:
3731
4000
  Description: >-
@@ -3756,7 +4025,7 @@ Style/HashSyntax:
3756
4025
  # enforces both ruby19 and no_mixed_keys styles
3757
4026
  - ruby19_no_mixed_keys
3758
4027
  # Force hashes that have a hash value omission
3759
- EnforcedShorthandSyntax: always
4028
+ EnforcedShorthandSyntax: either
3760
4029
  SupportedShorthandSyntax:
3761
4030
  # forces use of the 3.1 syntax (e.g. {foo:}) when the hash key and value are the same.
3762
4031
  - always
@@ -3764,6 +4033,8 @@ Style/HashSyntax:
3764
4033
  - never
3765
4034
  # accepts both shorthand and explicit use of hash literal value.
3766
4035
  - either
4036
+ # forces use of the 3.1 syntax only if all values can be omitted in the hash.
4037
+ - consistent
3767
4038
  # Force hashes that have a symbol value to use hash rockets
3768
4039
  UseHashRocketsWithSymbolValues: false
3769
4040
  # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
@@ -3876,16 +4147,35 @@ Style/InverseMethods:
3876
4147
  :=~: :!~
3877
4148
  :<: :>=
3878
4149
  :>: :<=
3879
- # `ActiveSupport` defines some common inverse methods. They are listed below,
3880
- # and not enabled by default.
3881
- # :present?: :blank?,
3882
- # :include?: :exclude?
3883
4150
  # `InverseBlocks` are methods that are inverted by inverting the return
3884
4151
  # of the block that is passed to the method
3885
4152
  InverseBlocks:
3886
4153
  :select: :reject
3887
4154
  :select!: :reject!
3888
4155
 
4156
+ Style/InvertibleUnlessCondition:
4157
+ Description: 'Favor `if` with inverted condition over `unless`.'
4158
+ Enabled: false
4159
+ Safe: false
4160
+ VersionAdded: '1.44'
4161
+ VersionChanged: '1.50'
4162
+ # `InverseMethods` are methods that can be inverted in a `unless` condition.
4163
+ # The relationship of inverse methods needs to be defined in both directions.
4164
+ # Keys and values both need to be defined as symbols.
4165
+ InverseMethods:
4166
+ :!=: :==
4167
+ :>: :<=
4168
+ :<=: :>
4169
+ :<: :>=
4170
+ :>=: :<
4171
+ :!~: :=~
4172
+ :zero?: :nonzero?
4173
+ :nonzero?: :zero?
4174
+ :any?: :none?
4175
+ :none?: :any?
4176
+ :even?: :odd?
4177
+ :odd?: :even?
4178
+
3889
4179
  Style/IpAddresses:
3890
4180
  Description: "Don't include literal IP addresses in code."
3891
4181
  Enabled: false
@@ -3911,7 +4201,7 @@ Style/KeywordParametersOrder:
3911
4201
  Style/Lambda:
3912
4202
  Description: 'Use the new lambda literal syntax for single-line blocks.'
3913
4203
  StyleGuide: '#lambda-multi-line'
3914
- Enabled: true
4204
+ Enabled: false
3915
4205
  VersionAdded: '0.9'
3916
4206
  VersionChanged: '0.40'
3917
4207
  EnforcedStyle: line_count_dependent
@@ -3940,6 +4230,26 @@ Style/LineEndConcatenation:
3940
4230
  VersionAdded: '0.18'
3941
4231
  VersionChanged: '0.64'
3942
4232
 
4233
+ Style/MagicCommentFormat:
4234
+ Description: 'Use a consistent style for magic comments.'
4235
+ Enabled: true
4236
+ VersionAdded: '1.35'
4237
+ EnforcedStyle: snake_case
4238
+ SupportedStyles:
4239
+ # `snake` will enforce the magic comment is written
4240
+ # in snake case (words separated by underscores).
4241
+ # Eg: froze_string_literal: true
4242
+ - snake_case
4243
+ # `kebab` will enforce the magic comment is written
4244
+ # in kebab case (words separated by hyphens).
4245
+ # Eg: froze-string-literal: true
4246
+ - kebab_case
4247
+ DirectiveCapitalization: lowercase
4248
+ ValueCapitalization: ~
4249
+ SupportedCapitalizations:
4250
+ - lowercase
4251
+ - uppercase
4252
+
3943
4253
  Style/MapCompactWithConditionalBlock:
3944
4254
  Description: 'Prefer `select` or `reject` over `map { ... }.compact`.'
3945
4255
  Enabled: true
@@ -3951,6 +4261,12 @@ Style/MapToHash:
3951
4261
  VersionAdded: '1.24'
3952
4262
  Safe: false
3953
4263
 
4264
+ Style/MapToSet:
4265
+ Description: 'Prefer `to_set` with a block over `map.to_set`.'
4266
+ Enabled: true
4267
+ Safe: false
4268
+ VersionAdded: '1.42'
4269
+
3954
4270
  Style/MethodCallWithArgsParentheses:
3955
4271
  Description: 'Use parentheses for method calls with arguments.'
3956
4272
  StyleGuide: '#method-invocation-parens'
@@ -3958,9 +4274,8 @@ Style/MethodCallWithArgsParentheses:
3958
4274
  VersionAdded: '0.47'
3959
4275
  VersionChanged: '1.7'
3960
4276
  IgnoreMacros: true
3961
- IgnoredMethods: []
4277
+ AllowedMethods: []
3962
4278
  AllowedPatterns: []
3963
- # IgnoredPatterns: [] # deprecated
3964
4279
  IncludedMacros: []
3965
4280
  AllowParenthesesInMultilineCall: false
3966
4281
  AllowParenthesesInChaining: false
@@ -3975,7 +4290,8 @@ Style/MethodCallWithoutArgsParentheses:
3975
4290
  Description: 'Do not use parentheses for method calls with no arguments.'
3976
4291
  StyleGuide: '#method-invocation-parens'
3977
4292
  Enabled: true
3978
- IgnoredMethods: []
4293
+ AllowedMethods: []
4294
+ AllowedPatterns: []
3979
4295
  VersionAdded: '0.47'
3980
4296
  VersionChanged: '0.55'
3981
4297
 
@@ -4006,6 +4322,12 @@ Style/MinMax:
4006
4322
  Enabled: true
4007
4323
  VersionAdded: '0.50'
4008
4324
 
4325
+ Style/MinMaxComparison:
4326
+ Description: 'Enforces the use of `max` or `min` instead of comparison for greater or less.'
4327
+ Enabled: true
4328
+ Safe: false
4329
+ VersionAdded: '1.42'
4330
+
4009
4331
  Style/MissingElse:
4010
4332
  Description: >-
4011
4333
  Require if/case expressions to have an else branches.
@@ -4129,6 +4451,7 @@ Style/MultipleComparison:
4129
4451
  VersionAdded: '0.49'
4130
4452
  VersionChanged: '1.1'
4131
4453
  AllowMethodComparison: true
4454
+ ComparisonsThreshold: 2
4132
4455
 
4133
4456
  Style/MutableConstant:
4134
4457
  Description: 'Do not assign mutable objects to constants.'
@@ -4320,24 +4643,24 @@ Style/NumericLiterals:
4320
4643
  Add underscores to large numeric literals to improve their
4321
4644
  readability.
4322
4645
  StyleGuide: '#underscores-in-numerics'
4323
- Enabled: true
4646
+ Enabled: false
4324
4647
  VersionAdded: '0.9'
4325
4648
  VersionChanged: '0.48'
4326
4649
  MinDigits: 5
4327
4650
  Strict: false
4328
4651
  # You can specify allowed numbers. (e.g. port number 3000, 8080, and etc)
4329
4652
  AllowedNumbers: []
4653
+ AllowedPatterns: []
4330
4654
 
4331
4655
  Style/NumericPredicate:
4332
4656
  Description: >-
4333
4657
  Checks for the use of predicate- or comparison methods for
4334
4658
  numeric comparisons.
4335
4659
  StyleGuide: '#predicate-methods'
4336
- Safe: false
4337
4660
  # This will change to a new method call which isn't guaranteed to be on the
4338
4661
  # object. Switching these methods has to be done with knowledge of the types
4339
4662
  # of the variables which rubocop doesn't have.
4340
- SafeAutoCorrect: false
4663
+ Safe: false
4341
4664
  Enabled: true
4342
4665
  VersionAdded: '0.42'
4343
4666
  VersionChanged: '0.59'
@@ -4345,7 +4668,8 @@ Style/NumericPredicate:
4345
4668
  SupportedStyles:
4346
4669
  - predicate
4347
4670
  - comparison
4348
- IgnoredMethods: []
4671
+ AllowedMethods: []
4672
+ AllowedPatterns: []
4349
4673
  # Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
4350
4674
  # false positives.
4351
4675
  Exclude:
@@ -4382,10 +4706,19 @@ Style/OpenStructUse:
4382
4706
  - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats
4383
4707
 
4384
4708
  Enabled: true
4709
+ Safe: false
4385
4710
  VersionAdded: '1.23'
4711
+ VersionChanged: '1.51'
4712
+
4713
+ Style/OperatorMethodCall:
4714
+ Description: 'Checks for redundant dot before operator method call.'
4715
+ StyleGuide: '#operator-method-call'
4716
+ Enabled: true
4717
+ VersionAdded: '1.37'
4386
4718
 
4387
4719
  Style/OptionHash:
4388
4720
  Description: "Don't use option hashes when you can use keyword arguments."
4721
+ StyleGuide: '#keyword-arguments-vs-option-hashes'
4389
4722
  Enabled: false
4390
4723
  VersionAdded: '0.33'
4391
4724
  VersionChanged: '0.34'
@@ -4455,6 +4788,7 @@ Style/PercentLiteralDelimiters:
4455
4788
  default: {}
4456
4789
  '%': '{}'
4457
4790
  '%i': '{}'
4791
+ '%I': '{}'
4458
4792
  '%q': '{}'
4459
4793
  '%Q': '{}'
4460
4794
  '%r': '{}'
@@ -4533,10 +4867,16 @@ Style/RedundantArgument:
4533
4867
  Enabled: true
4534
4868
  Safe: false
4535
4869
  VersionAdded: '1.4'
4536
- VersionChanged: '1.7'
4870
+ VersionChanged: '1.55'
4537
4871
  Methods:
4538
4872
  # Array#join
4539
4873
  join: ''
4874
+ # Array#sum
4875
+ sum: 0
4876
+ # Kernel.#exit
4877
+ exit: true
4878
+ # Kernel.#exit!
4879
+ exit!: false
4540
4880
  # String#split
4541
4881
  split: ' '
4542
4882
  # String#chomp
@@ -4544,6 +4884,11 @@ Style/RedundantArgument:
4544
4884
  # String#chomp!
4545
4885
  chomp!: "\n"
4546
4886
 
4887
+ Style/RedundantArrayConstructor:
4888
+ Description: 'Checks for the instantiation of array using redundant `Array` constructor.'
4889
+ Enabled: true
4890
+ VersionAdded: '1.52'
4891
+
4547
4892
  Style/RedundantAssignment:
4548
4893
  Description: 'Checks for redundant assignment before returning.'
4549
4894
  Enabled: true
@@ -4571,6 +4916,27 @@ Style/RedundantConditional:
4571
4916
  Enabled: true
4572
4917
  VersionAdded: '0.50'
4573
4918
 
4919
+ Style/RedundantConstantBase:
4920
+ Description: Avoid redundant `::` prefix on constant.
4921
+ Enabled: true
4922
+ VersionAdded: '1.40'
4923
+
4924
+ Style/RedundantCurrentDirectoryInPath:
4925
+ Description: 'Checks for uses a redundant current directory in path.'
4926
+ Enabled: true
4927
+ VersionAdded: '1.53'
4928
+
4929
+ Style/RedundantDoubleSplatHashBraces:
4930
+ Description: 'Checks for redundant uses of double splat hash braces.'
4931
+ Enabled: true
4932
+ VersionAdded: '1.41'
4933
+
4934
+ Style/RedundantEach:
4935
+ Description: 'Checks for redundant `each`.'
4936
+ Enabled: true
4937
+ Safe: false
4938
+ VersionAdded: '1.38'
4939
+
4574
4940
  Style/RedundantException:
4575
4941
  Description: "Checks for an obsolete RuntimeException argument in raise/fail."
4576
4942
  StyleGuide: '#no-explicit-runtimeerror'
@@ -4599,12 +4965,26 @@ Style/RedundantFileExtensionInRequire:
4599
4965
  Enabled: true
4600
4966
  VersionAdded: '0.88'
4601
4967
 
4968
+ Style/RedundantFilterChain:
4969
+ Description: >-
4970
+ Identifies usages of `any?`, `empty?`, `none?` or `one?` predicate methods chained to
4971
+ `select`/`filter`/`find_all` and change them to use predicate method instead.
4972
+ Enabled: true
4973
+ SafeAutoCorrect: false
4974
+ VersionAdded: '1.52'
4975
+ VersionChanged: '1.57'
4976
+
4602
4977
  Style/RedundantFreeze:
4603
4978
  Description: "Checks usages of Object#freeze on immutable objects."
4604
4979
  Enabled: true
4605
4980
  VersionAdded: '0.34'
4606
4981
  VersionChanged: '0.66'
4607
4982
 
4983
+ Style/RedundantHeredocDelimiterQuotes:
4984
+ Description: 'Checks for redundant heredoc delimiter quotes.'
4985
+ Enabled: true
4986
+ VersionAdded: '1.45'
4987
+
4608
4988
  Style/RedundantInitialize:
4609
4989
  Description: 'Checks for redundant `initialize` methods.'
4610
4990
  Enabled: true
@@ -4620,6 +5000,11 @@ Style/RedundantInterpolation:
4620
5000
  VersionAdded: '0.76'
4621
5001
  VersionChanged: '1.30'
4622
5002
 
5003
+ Style/RedundantLineContinuation:
5004
+ Description: 'Check for redundant line continuation.'
5005
+ Enabled: true
5006
+ VersionAdded: '1.49'
5007
+
4623
5008
  Style/RedundantParentheses:
4624
5009
  Description: "Checks for parentheses that seem not to serve any purpose."
4625
5010
  Enabled: true
@@ -4631,11 +5016,21 @@ Style/RedundantPercentQ:
4631
5016
  Enabled: true
4632
5017
  VersionAdded: '0.76'
4633
5018
 
5019
+ Style/RedundantRegexpArgument:
5020
+ Description: 'Identifies places where argument can be replaced from a deterministic regexp to a string.'
5021
+ Enabled: true
5022
+ VersionAdded: '1.53'
5023
+
4634
5024
  Style/RedundantRegexpCharacterClass:
4635
5025
  Description: 'Checks for unnecessary single-element Regexp character classes.'
4636
5026
  Enabled: true
4637
5027
  VersionAdded: '0.85'
4638
5028
 
5029
+ Style/RedundantRegexpConstructor:
5030
+ Description: 'Checks for the instantiation of regexp using redundant `Regexp.new` or `Regexp.compile`.'
5031
+ Enabled: true
5032
+ VersionAdded: '1.52'
5033
+
4639
5034
  Style/RedundantRegexpEscape:
4640
5035
  Description: 'Checks for redundant escapes in Regexps.'
4641
5036
  Enabled: true
@@ -4682,6 +5077,11 @@ Style/RedundantSortBy:
4682
5077
  Enabled: true
4683
5078
  VersionAdded: '0.36'
4684
5079
 
5080
+ Style/RedundantStringEscape:
5081
+ Description: 'Checks for redundant escapes in string literals.'
5082
+ Enabled: true
5083
+ VersionAdded: '1.37'
5084
+
4685
5085
  Style/RegexpLiteral:
4686
5086
  Description: 'Use / or %r around regular expressions.'
4687
5087
  StyleGuide: '#percent-r'
@@ -4700,6 +5100,12 @@ Style/RegexpLiteral:
4700
5100
  # are found in the regexp string.
4701
5101
  AllowInnerSlashes: false
4702
5102
 
5103
+ Style/RequireOrder:
5104
+ Description: Sort `require` and `require_relative` in alphabetical order.
5105
+ Enabled: false
5106
+ SafeAutoCorrect: false
5107
+ VersionAdded: '1.40'
5108
+
4703
5109
  Style/RescueModifier:
4704
5110
  Description: 'Avoid using rescue in its modifier form.'
4705
5111
  StyleGuide: '#no-rescue-modifiers'
@@ -4727,6 +5133,15 @@ Style/ReturnNil:
4727
5133
  - return_nil
4728
5134
  VersionAdded: '0.50'
4729
5135
 
5136
+ Style/ReturnNilInPredicateMethodDefinition:
5137
+ Description: 'Checks if uses of `return` or `return nil` in predicate method definition.'
5138
+ StyleGuide: '#bool-methods-qmark'
5139
+ Enabled: true
5140
+ SafeAutoCorrect: false
5141
+ AllowedMethods: []
5142
+ AllowedPatterns: []
5143
+ VersionAdded: '1.53'
5144
+
4730
5145
  Style/SafeNavigation:
4731
5146
  Description: >-
4732
5147
  Transforms usages of a method call safeguarded by
@@ -4819,6 +5234,12 @@ Style/SingleLineBlockParams:
4819
5234
  - acc
4820
5235
  - elem
4821
5236
 
5237
+ Style/SingleLineDoEndBlock:
5238
+ Description: 'Checks for single-line `do`...`end` blocks.'
5239
+ StyleGuide: '#single-line-do-end-block'
5240
+ Enabled: true
5241
+ VersionAdded: '1.57'
5242
+
4822
5243
  Style/SingleLineMethods:
4823
5244
  Description: 'Avoid single-line methods.'
4824
5245
  StyleGuide: '#no-single-line-methods'
@@ -4828,7 +5249,8 @@ Style/SingleLineMethods:
4828
5249
  AllowIfMethodIsEmpty: true
4829
5250
 
4830
5251
  Style/SlicingWithRange:
4831
- Description: 'Checks array slicing is done with endless ranges when suitable.'
5252
+ Description: 'Checks array slicing is done with redundant, endless, and beginless ranges when suitable.'
5253
+ StyleGuide: '#slicing-with-ranges'
4832
5254
  Enabled: true
4833
5255
  VersionAdded: '0.83'
4834
5256
  Safe: false
@@ -4955,6 +5377,12 @@ Style/StructInheritance:
4955
5377
  VersionAdded: '0.29'
4956
5378
  VersionChanged: '1.20'
4957
5379
 
5380
+ Style/SuperWithArgsParentheses:
5381
+ Description: 'Use parentheses for `super` with arguments.'
5382
+ StyleGuide: '#super-with-args'
5383
+ Enabled: true
5384
+ VersionAdded: '1.58'
5385
+
4958
5386
  Style/SwapValues:
4959
5387
  Description: 'Enforces the use of shorthand-style swapping of 2 variables.'
4960
5388
  StyleGuide: '#values-swapping'
@@ -4965,10 +5393,10 @@ Style/SwapValues:
4965
5393
  Style/SymbolArray:
4966
5394
  Description: 'Use %i or %I for arrays of symbols.'
4967
5395
  StyleGuide: '#percent-i'
4968
- Enabled: false
5396
+ Enabled: true
4969
5397
  VersionAdded: '0.9'
4970
5398
  VersionChanged: '0.49'
4971
- EnforcedStyle: percent
5399
+ EnforcedStyle: brackets
4972
5400
  MinSize: 2
4973
5401
  SupportedStyles:
4974
5402
  - percent
@@ -4984,13 +5412,13 @@ Style/SymbolProc:
4984
5412
  Enabled: true
4985
5413
  Safe: false
4986
5414
  VersionAdded: '0.26'
4987
- VersionChanged: '1.28'
5415
+ VersionChanged: '1.40'
4988
5416
  AllowMethodsWithArguments: false
4989
- # A list of method names to be ignored by the check.
5417
+ # A list of method names to be always allowed by the check.
4990
5418
  # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
4991
- IgnoredMethods:
4992
- - respond_to
5419
+ AllowedMethods:
4993
5420
  - define_method
5421
+ AllowedPatterns: []
4994
5422
  AllowComments: false
4995
5423
 
4996
5424
  Style/TernaryParentheses:
@@ -5116,7 +5544,7 @@ Style/TrivialAccessors:
5116
5544
  # on_exception :restart
5117
5545
  #
5118
5546
  # Commonly used in DSLs
5119
- AllowDSLWriters: true
5547
+ AllowDSLWriters: false
5120
5548
  IgnoreClassMethods: false
5121
5549
  AllowedMethods:
5122
5550
  - to_ary
@@ -5211,6 +5639,11 @@ Style/WordArray:
5211
5639
  # The regular expression `WordRegex` decides what is considered a word.
5212
5640
  WordRegex: !ruby/regexp '/\A(?:\p{Word}|\p{Word}-\p{Word}|\n|\t)+\z/'
5213
5641
 
5642
+ Style/YAMLFileRead:
5643
+ Description: 'Checks for the use of `YAML.load`, `YAML.safe_load`, and `YAML.parse` with `File.read` argument.'
5644
+ Enabled: true
5645
+ VersionAdded: '1.53'
5646
+
5214
5647
  Style/YodaCondition:
5215
5648
  Description: 'Forbid or enforce yoda conditions.'
5216
5649
  Reference: 'https://en.wikipedia.org/wiki/Yoda_conditions'
@@ -5229,6 +5662,19 @@ Style/YodaCondition:
5229
5662
  VersionAdded: '0.49'
5230
5663
  VersionChanged: '0.75'
5231
5664
 
5665
+ Style/YodaExpression:
5666
+ Description: 'Forbid the use of yoda expressions.'
5667
+ Enabled: false
5668
+ Safe: false
5669
+ VersionAdded: '1.42'
5670
+ VersionChanged: '1.43'
5671
+ SupportedOperators:
5672
+ - '*'
5673
+ - '+'
5674
+ - '&'
5675
+ - '|'
5676
+ - '^'
5677
+
5232
5678
  Style/ZeroLengthPredicate:
5233
5679
  Description: 'Use #empty? when testing for objects of length 0.'
5234
5680
  Enabled: true