ffi-geos 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rubocop.yml CHANGED
@@ -80,6 +80,8 @@ AllCops:
80
80
  # When specifying style guide URLs, any paths and/or fragments will be
81
81
  # evaluated relative to the base URL.
82
82
  StyleGuideBaseURL: https://rubystyle.guide
83
+ # Documentation URLs will be constructed using the base URL.
84
+ DocumentationBaseURL: https://docs.rubocop.org/rubocop
83
85
  # Extra details are not displayed in offense messages by default. Change
84
86
  # behavior by overriding ExtraDetails, or by giving the
85
87
  # `-E/--extra-details` option.
@@ -132,7 +134,7 @@ AllCops:
132
134
  # What MRI version of the Ruby interpreter is the inspected code intended to
133
135
  # run on? (If there is more than one, set this to the lowest version.)
134
136
  # If a value is specified for TargetRubyVersion then it is used. Acceptable
135
- # values are specificed as a float (i.e. 2.5); the teeny version of Ruby
137
+ # values are specified as a float (i.e. 3.0); the teeny version of Ruby
136
138
  # should not be included. If the project specifies a Ruby version in the
137
139
  # .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
138
140
  # try to determine the desired version of Ruby by inspecting the
@@ -140,7 +142,7 @@ AllCops:
140
142
  # or gems.locked file. (Although the Ruby version is specified in the Gemfile
141
143
  # or gems.rb file, RuboCop reads the final value from the lock file.) If the
142
144
  # Ruby version is still unresolved, RuboCop will use the oldest officially
143
- # supported Ruby version (currently Ruby 2.4).
145
+ # supported Ruby version (currently Ruby 2.5).
144
146
  TargetRubyVersion: ~
145
147
  # Determines if a notification for extension libraries should be shown when
146
148
  # rubocop is run. Keys are the name of the extension, and values are an array
@@ -152,6 +154,7 @@ AllCops:
152
154
  rubocop-minitest: [minitest]
153
155
  rubocop-sequel: [sequel]
154
156
  rubocop-rake: [rake]
157
+ rubocop-graphql: [graphql]
155
158
 
156
159
  #################### Bundler ###############################
157
160
 
@@ -176,6 +179,34 @@ Bundler/GemComment:
176
179
  IgnoredGems: []
177
180
  OnlyFor: []
178
181
 
182
+ Bundler/GemFilename:
183
+ Description: 'Enforces the filename for managing gems.'
184
+ Enabled: true
185
+ VersionAdded: '1.20'
186
+ EnforcedStyle: 'Gemfile'
187
+ SupportedStyles:
188
+ - 'Gemfile'
189
+ - 'gems.rb'
190
+ Include:
191
+ - '**/Gemfile'
192
+ - '**/gems.rb'
193
+ - '**/Gemfile.lock'
194
+ - '**/gems.locked'
195
+
196
+ Bundler/GemVersion:
197
+ Description: 'Requires or forbids specifying gem versions.'
198
+ Enabled: false
199
+ VersionAdded: '1.14'
200
+ EnforcedStyle: 'required'
201
+ SupportedStyles:
202
+ - 'required'
203
+ - 'forbidden'
204
+ Include:
205
+ - '**/*.gemfile'
206
+ - '**/Gemfile'
207
+ - '**/gems.rb'
208
+ AllowedGems: []
209
+
179
210
  Bundler/InsecureProtocolSource:
180
211
  Description: >-
181
212
  The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
@@ -183,6 +214,7 @@ Bundler/InsecureProtocolSource:
183
214
  'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
184
215
  Enabled: true
185
216
  VersionAdded: '0.50'
217
+ AllowHttpProtocol: true
186
218
  Include:
187
219
  - '**/*.gemfile'
188
220
  - '**/Gemfile'
@@ -231,11 +263,20 @@ Gemspec/OrderedDependencies:
231
263
  Include:
232
264
  - '**/*.gemspec'
233
265
 
266
+ Gemspec/RequireMFA:
267
+ Description: 'Checks that the gemspec has metadata to require MFA from RubyGems.'
268
+ Enabled: true
269
+ VersionAdded: '1.23'
270
+ Reference:
271
+ - https://guides.rubygems.org/mfa-requirement-opt-in/
272
+ Include:
273
+ - '**/*.gemspec'
274
+
234
275
  Gemspec/RequiredRubyVersion:
235
276
  Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
236
277
  Enabled: true
237
278
  VersionAdded: '0.52'
238
- VersionChanged: '0.89'
279
+ VersionChanged: '1.22'
239
280
  Include:
240
281
  - '**/*.gemspec'
241
282
 
@@ -258,8 +299,8 @@ Layout/AccessModifierIndentation:
258
299
  SupportedStyles:
259
300
  - outdent
260
301
  - indent
261
- # By default, the indentation width from Layout/IndentationWidth is used
262
- # But it can be overridden by setting this parameter
302
+ # By default the indentation width from `Layout/IndentationWidth` is used,
303
+ # but it can be overridden by setting this parameter.
263
304
  IndentationWidth: ~
264
305
 
265
306
  Layout/ArgumentAlignment:
@@ -287,8 +328,8 @@ Layout/ArgumentAlignment:
287
328
  SupportedStyles:
288
329
  - with_first_argument
289
330
  - with_fixed_indentation
290
- # By default, the indentation width from Layout/IndentationWidth is used
291
- # But it can be overridden by setting this parameter
331
+ # By default the indentation width from `Layout/IndentationWidth` is used,
332
+ # but it can be overridden by setting this parameter.
292
333
  IndentationWidth: ~
293
334
 
294
335
  Layout/ArrayAlignment:
@@ -316,8 +357,8 @@ Layout/ArrayAlignment:
316
357
  SupportedStyles:
317
358
  - with_first_element
318
359
  - with_fixed_indentation
319
- # By default, the indentation width from Layout/IndentationWidth is used
320
- # But it can be overridden by setting this parameter
360
+ # By default the indentation width from `Layout/IndentationWidth` is used,
361
+ # but it can be overridden by setting this parameter.
321
362
  IndentationWidth: ~
322
363
 
323
364
  Layout/AssignmentIndentation:
@@ -327,8 +368,8 @@ Layout/AssignmentIndentation:
327
368
  Enabled: true
328
369
  VersionAdded: '0.49'
329
370
  VersionChanged: '0.77'
330
- # By default, the indentation width from `Layout/IndentationWidth` is used
331
- # But it can be overridden by setting this parameter
371
+ # By default the indentation width from `Layout/IndentationWidth` is used,
372
+ # but it can be overridden by setting this parameter.
332
373
  IndentationWidth: ~
333
374
 
334
375
  Layout/BeginEndAlignment:
@@ -365,18 +406,19 @@ Layout/BlockEndNewline:
365
406
  VersionAdded: '0.49'
366
407
 
367
408
  Layout/CaseIndentation:
368
- Description: 'Indentation of when in a case/when/[else/]end.'
409
+ Description: 'Indentation of when in a case/(when|in)/[else/]end.'
369
410
  StyleGuide: '#indent-when-to-case'
370
411
  Enabled: true
371
412
  VersionAdded: '0.49'
413
+ VersionChanged: '1.16'
372
414
  EnforcedStyle: end
373
415
  SupportedStyles:
374
416
  - case
375
417
  - end
376
418
  IndentOneStep: true
377
- # By default, the indentation width from `Layout/IndentationWidth` is used.
378
- # But it can be overridden by setting this parameter.
379
- # This only matters if `IndentOneStep` is `true`
419
+ # By default the indentation width from `Layout/IndentationWidth` is used,
420
+ # but it can be overridden by setting this parameter.
421
+ # This only matters if `IndentOneStep` is `true`.
380
422
  IndentationWidth: ~
381
423
 
382
424
  Layout/ClassStructure:
@@ -411,7 +453,11 @@ Layout/ClosingParenthesisIndentation:
411
453
  Layout/CommentIndentation:
412
454
  Description: 'Indentation of comments.'
413
455
  Enabled: true
456
+ # When true, allows comments to have extra indentation if that aligns them
457
+ # with a comment on the preceding line.
458
+ AllowForAlignment: false
414
459
  VersionAdded: '0.49'
460
+ VersionChanged: '1.24'
415
461
 
416
462
  Layout/ConditionPosition:
417
463
  Description: >-
@@ -483,13 +529,13 @@ Layout/EmptyLineBetweenDefs:
483
529
  StyleGuide: '#empty-lines-between-methods'
484
530
  Enabled: true
485
531
  VersionAdded: '0.49'
486
- VersionChanged: '1.7'
532
+ VersionChanged: '1.23'
487
533
  EmptyLineBetweenMethodDefs: true
488
534
  EmptyLineBetweenClassDefs: true
489
535
  EmptyLineBetweenModuleDefs: true
490
- # If `true`, this parameter means that single line method definitions don't
491
- # need an empty line between them.
492
- AllowAdjacentOneLineDefs: false
536
+ # `AllowAdjacentOneLineDefs` means that single line method definitions don't
537
+ # need an empty line between them. `true` by default.
538
+ AllowAdjacentOneLineDefs: true
493
539
  # Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
494
540
  NumberOfEmptyLines: 1
495
541
 
@@ -653,8 +699,8 @@ Layout/FirstArgumentIndentation:
653
699
  # Same as `special_for_inner_method_call` except that the special rule only
654
700
  # applies if the outer method call encloses its arguments in parentheses.
655
701
  - special_for_inner_method_call_in_parentheses
656
- # By default, the indentation width from `Layout/IndentationWidth` is used
657
- # But it can be overridden by setting this parameter
702
+ # By default the indentation width from `Layout/IndentationWidth` is used,
703
+ # but it can be overridden by setting this parameter.
658
704
  IndentationWidth: ~
659
705
 
660
706
  Layout/FirstArrayElementIndentation:
@@ -680,8 +726,8 @@ Layout/FirstArrayElementIndentation:
680
726
  - special_inside_parentheses
681
727
  - consistent
682
728
  - align_brackets
683
- # By default, the indentation width from `Layout/IndentationWidth` is used
684
- # But it can be overridden by setting this parameter
729
+ # By default the indentation width from `Layout/IndentationWidth` is used,
730
+ # but it can be overridden by setting this parameter.
685
731
  IndentationWidth: ~
686
732
 
687
733
  Layout/FirstArrayElementLineBreak:
@@ -712,8 +758,8 @@ Layout/FirstHashElementIndentation:
712
758
  - special_inside_parentheses
713
759
  - consistent
714
760
  - align_braces
715
- # By default, the indentation width from `Layout/IndentationWidth` is used
716
- # But it can be overridden by setting this parameter
761
+ # By default the indentation width from `Layout/IndentationWidth` is used,
762
+ # but it can be overridden by setting this parameter.
717
763
  IndentationWidth: ~
718
764
 
719
765
  Layout/FirstHashElementLineBreak:
@@ -748,8 +794,8 @@ Layout/FirstParameterIndentation:
748
794
  SupportedStyles:
749
795
  - consistent
750
796
  - align_parentheses
751
- # By default, the indentation width from `Layout/IndentationWidth` is used
752
- # But it can be overridden by setting this parameter
797
+ # By default the indentation width from `Layout/IndentationWidth` is used,
798
+ # but it can be overridden by setting this parameter.
753
799
  IndentationWidth: ~
754
800
 
755
801
  Layout/HashAlignment:
@@ -759,7 +805,7 @@ Layout/HashAlignment:
759
805
  Enabled: true
760
806
  AllowMultipleStyles: true
761
807
  VersionAdded: '0.49'
762
- VersionChanged: '0.77'
808
+ VersionChanged: '1.16'
763
809
  # Alignment of entries using hash rocket as separator. Valid values are:
764
810
  #
765
811
  # key - left alignment of keys
@@ -870,8 +916,8 @@ Layout/IndentationStyle:
870
916
  Enabled: true
871
917
  VersionAdded: '0.49'
872
918
  VersionChanged: '0.82'
873
- # By default, the indentation width from Layout/IndentationWidth is used
874
- # But it can be overridden by setting this parameter
919
+ # By default the indentation width from `Layout/IndentationWidth` is used,
920
+ # but it can be overridden by setting this parameter.
875
921
  # It is used during auto-correction to determine how many spaces should
876
922
  # replace each tab.
877
923
  IndentationWidth: ~
@@ -910,13 +956,26 @@ Layout/LeadingEmptyLines:
910
956
  VersionAdded: '0.57'
911
957
  VersionChanged: '0.77'
912
958
 
959
+ Layout/LineEndStringConcatenationIndentation:
960
+ Description: >-
961
+ Checks the indentation of the next line after a line that
962
+ ends with a string literal and a backslash.
963
+ Enabled: true
964
+ VersionAdded: '1.18'
965
+ EnforcedStyle: aligned
966
+ SupportedStyles:
967
+ - aligned
968
+ - indented
969
+ # By default the indentation width from `Layout/IndentationWidth` is used,
970
+ # but it can be overridden by setting this parameter.
971
+ IndentationWidth: ~
972
+
913
973
  Layout/LineLength:
914
974
  Description: 'Checks that line length does not exceed the configured limit.'
915
975
  StyleGuide: '#max-line-length'
916
976
  Enabled: true
917
977
  VersionAdded: '0.25'
918
978
  VersionChanged: '1.4'
919
- AutoCorrect: true
920
979
  Max: 300
921
980
  # To make it possible to copy or click on URIs in the code, we allow lines
922
981
  # containing a URI to be longer than Max.
@@ -1040,8 +1099,8 @@ Layout/MultilineMethodCallIndentation:
1040
1099
  - aligned
1041
1100
  - indented
1042
1101
  - indented_relative_to_receiver
1043
- # By default, the indentation width from Layout/IndentationWidth is used
1044
- # But it can be overridden by setting this parameter
1102
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1103
+ # but it can be overridden by setting this parameter.
1045
1104
  IndentationWidth: ~
1046
1105
 
1047
1106
  Layout/MultilineMethodDefinitionBraceLayout:
@@ -1070,8 +1129,8 @@ Layout/MultilineOperationIndentation:
1070
1129
  SupportedStyles:
1071
1130
  - aligned
1072
1131
  - indented
1073
- # By default, the indentation width from `Layout/IndentationWidth` is used
1074
- # But it can be overridden by setting this parameter
1132
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1133
+ # but it can be overridden by setting this parameter.
1075
1134
  IndentationWidth: ~
1076
1135
 
1077
1136
  Layout/ParameterAlignment:
@@ -1099,15 +1158,28 @@ Layout/ParameterAlignment:
1099
1158
  SupportedStyles:
1100
1159
  - with_first_parameter
1101
1160
  - with_fixed_indentation
1102
- # By default, the indentation width from Layout/IndentationWidth is used
1103
- # But it can be overridden by setting this parameter
1161
+ # By default the indentation width from `Layout/IndentationWidth` is used,
1162
+ # but it can be overridden by setting this parameter.
1104
1163
  IndentationWidth: ~
1105
1164
 
1165
+ Layout/RedundantLineBreak:
1166
+ Description: >-
1167
+ Do not break up an expression into multiple lines when it fits
1168
+ on a single line.
1169
+ Enabled: false
1170
+ InspectBlocks: false
1171
+ VersionAdded: '1.13'
1172
+
1106
1173
  Layout/RescueEnsureAlignment:
1107
1174
  Description: 'Align rescues and ensures correctly.'
1108
1175
  Enabled: true
1109
1176
  VersionAdded: '0.49'
1110
1177
 
1178
+ Layout/SingleLineBlockChain:
1179
+ Description: 'Put method call on a separate line if chained to a single line block.'
1180
+ Enabled: false
1181
+ VersionAdded: '1.14'
1182
+
1111
1183
  Layout/SpaceAfterColon:
1112
1184
  Description: 'Use spaces after colons.'
1113
1185
  StyleGuide: '#spaces-operators'
@@ -1286,7 +1358,7 @@ Layout/SpaceInsideBlockBraces:
1286
1358
 
1287
1359
  Layout/SpaceInsideHashLiteralBraces:
1288
1360
  Description: "Use spaces inside hash literal braces - or don't."
1289
- StyleGuide: '#spaces-operators'
1361
+ StyleGuide: '#spaces-braces'
1290
1362
  Enabled: true
1291
1363
  VersionAdded: '0.49'
1292
1364
  EnforcedStyle: space
@@ -1307,10 +1379,11 @@ Layout/SpaceInsideParens:
1307
1379
  StyleGuide: '#spaces-braces'
1308
1380
  Enabled: true
1309
1381
  VersionAdded: '0.49'
1310
- VersionChanged: '0.55'
1382
+ VersionChanged: '1.22'
1311
1383
  EnforcedStyle: no_space
1312
1384
  SupportedStyles:
1313
1385
  - space
1386
+ - compact
1314
1387
  - no_space
1315
1388
 
1316
1389
  Layout/SpaceInsidePercentLiteralDelimiters:
@@ -1382,6 +1455,8 @@ Lint/AmbiguousBlockAssociation:
1382
1455
  StyleGuide: '#syntax'
1383
1456
  Enabled: true
1384
1457
  VersionAdded: '0.48'
1458
+ VersionChanged: '1.13'
1459
+ IgnoredMethods: []
1385
1460
 
1386
1461
  Lint/AmbiguousOperator:
1387
1462
  Description: >-
@@ -1392,6 +1467,20 @@ Lint/AmbiguousOperator:
1392
1467
  VersionAdded: '0.17'
1393
1468
  VersionChanged: '0.83'
1394
1469
 
1470
+ Lint/AmbiguousOperatorPrecedence:
1471
+ Description: >-
1472
+ Checks for expressions containing multiple binary operations with
1473
+ ambiguous precedence.
1474
+ Enabled: true
1475
+ VersionAdded: '1.21'
1476
+
1477
+ Lint/AmbiguousRange:
1478
+ Description: Checks for ranges with ambiguous boundaries.
1479
+ Enabled: true
1480
+ VersionAdded: '1.19'
1481
+ SafeAutoCorrect: false
1482
+ RequireParenthesesForMethodChains: false
1483
+
1395
1484
  Lint/AmbiguousRegexpLiteral:
1396
1485
  Description: >-
1397
1486
  Checks for ambiguous regexp literals in the first argument of
@@ -1422,9 +1511,9 @@ Lint/BinaryOperatorWithIdenticalOperands:
1422
1511
  Lint/BooleanSymbol:
1423
1512
  Description: 'Check for `:true` and `:false` symbols.'
1424
1513
  Enabled: true
1425
- Safe: false
1514
+ SafeAutoCorrect: false
1426
1515
  VersionAdded: '0.50'
1427
- VersionChanged: '0.83'
1516
+ VersionChanged: '1.22'
1428
1517
 
1429
1518
  Lint/CircularArgumentReference:
1430
1519
  Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
@@ -1456,6 +1545,7 @@ Lint/Debugger:
1456
1545
  Enabled: true
1457
1546
  VersionAdded: '0.14'
1458
1547
  VersionChanged: '1.10'
1548
+ #DebuggerReceivers: [] # deprecated
1459
1549
  DebuggerMethods:
1460
1550
  # Groups are available so that a specific group can be disabled in
1461
1551
  # a user's configuration, but are otherwise not significant.
@@ -1469,6 +1559,11 @@ Lint/Debugger:
1469
1559
  Capybara:
1470
1560
  - save_and_open_page
1471
1561
  - save_and_open_screenshot
1562
+ debug.rb:
1563
+ - binding.b
1564
+ - binding.break
1565
+ - Kernel.binding.b
1566
+ - Kernel.binding.break
1472
1567
  Pry:
1473
1568
  - binding.pry
1474
1569
  - binding.remote_pry
@@ -1477,6 +1572,8 @@ Lint/Debugger:
1477
1572
  Rails:
1478
1573
  - debugger
1479
1574
  - Kernel.debugger
1575
+ RubyJard:
1576
+ - jard
1480
1577
  WebConsole:
1481
1578
  - binding.console
1482
1579
 
@@ -1489,6 +1586,7 @@ Lint/DeprecatedConstants:
1489
1586
  Description: 'Checks for deprecated constants.'
1490
1587
  Enabled: true
1491
1588
  VersionAdded: '1.8'
1589
+ VersionChanged: '1.22'
1492
1590
  # You can configure deprecated constants.
1493
1591
  # If there is an alternative method, you can set alternative value as `Alternative`.
1494
1592
  # And you can set the deprecated version as `DeprecatedVersion`.
@@ -1509,6 +1607,9 @@ Lint/DeprecatedConstants:
1509
1607
  'FALSE':
1510
1608
  Alternative: 'false'
1511
1609
  DeprecatedVersion: '2.4'
1610
+ 'Net::HTTPServerException':
1611
+ Alternative: 'Net::HTTPClientException'
1612
+ DeprecatedVersion: '2.6'
1512
1613
  'Random::DEFAULT':
1513
1614
  Alternative: 'Random.new'
1514
1615
  DeprecatedVersion: '3.0'
@@ -1584,7 +1685,7 @@ Lint/EmptyBlock:
1584
1685
  Description: 'This cop checks for blocks without a body.'
1585
1686
  Enabled: true
1586
1687
  VersionAdded: '1.1'
1587
- VersionChanged: '1.3'
1688
+ VersionChanged: '1.15'
1588
1689
  AllowComments: true
1589
1690
  AllowEmptyLambdas: true
1590
1691
 
@@ -1617,6 +1718,12 @@ Lint/EmptyFile:
1617
1718
  AllowComments: true
1618
1719
  VersionAdded: '0.90'
1619
1720
 
1721
+ Lint/EmptyInPattern:
1722
+ Description: 'Checks for the presence of `in` pattern branches without a body.'
1723
+ Enabled: true
1724
+ AllowComments: true
1725
+ VersionAdded: '1.16'
1726
+
1620
1727
  Lint/EmptyInterpolation:
1621
1728
  Description: 'Checks for empty string interpolation.'
1622
1729
  Enabled: true
@@ -1694,6 +1801,13 @@ Lint/ImplicitStringConcatenation:
1694
1801
  Enabled: true
1695
1802
  VersionAdded: '0.36'
1696
1803
 
1804
+ Lint/IncompatibleIoSelectWithFiberScheduler:
1805
+ Description: 'Checks for `IO.select` that is incompatible with Fiber Scheduler.'
1806
+ Enabled: true
1807
+ SafeAutoCorrect: false
1808
+ VersionAdded: '1.21'
1809
+ VersionChanged: '1.24'
1810
+
1697
1811
  Lint/IneffectiveAccessModifier:
1698
1812
  Description: >-
1699
1813
  Checks for attempts to use `private` or `protected` to set
@@ -1775,7 +1889,6 @@ Lint/MultipleComparison:
1775
1889
  Enabled: true
1776
1890
  VersionAdded: '0.47'
1777
1891
  VersionChanged: '1.1'
1778
- AllowMethodComparison: true
1779
1892
 
1780
1893
  Lint/NestedMethodDefinition:
1781
1894
  Description: 'Do not use nested method definitions.'
@@ -1958,6 +2071,11 @@ Lint/RequireParentheses:
1958
2071
  Enabled: true
1959
2072
  VersionAdded: '0.18'
1960
2073
 
2074
+ Lint/RequireRelativeSelfPath:
2075
+ Description: 'Checks for uses a file requiring itself with `require_relative`.'
2076
+ Enabled: true
2077
+ VersionAdded: '1.22'
2078
+
1961
2079
  Lint/RescueException:
1962
2080
  Description: 'Avoid rescuing the Exception class.'
1963
2081
  StyleGuide: '#no-blind-rescues'
@@ -2064,6 +2182,7 @@ Lint/SymbolConversion:
2064
2182
  Description: 'Checks for unnecessary symbol conversions.'
2065
2183
  Enabled: true
2066
2184
  VersionAdded: '1.9'
2185
+ VersionChanged: '1.16'
2067
2186
  EnforcedStyle: strict
2068
2187
  SupportedStyles:
2069
2188
  - strict
@@ -2209,6 +2328,11 @@ Lint/UselessMethodDefinition:
2209
2328
  Safe: false
2210
2329
  AllowComments: true
2211
2330
 
2331
+ Lint/UselessRuby2Keywords:
2332
+ Description: 'Finds unnecessary uses of `ruby2_keywords`.'
2333
+ Enabled: true
2334
+ VersionAdded: '1.23'
2335
+
2212
2336
  Lint/UselessSetterCall:
2213
2337
  Description: 'Checks for useless setter call to a local variable.'
2214
2338
  Enabled: true
@@ -2255,6 +2379,7 @@ Metrics/BlockLength:
2255
2379
  CountComments: false # count full line comments?
2256
2380
  Max: 50
2257
2381
  CountAsOne: []
2382
+ #ExcludedMethods: [] # deprecated, retained for backwards compatibility
2258
2383
  IgnoredMethods:
2259
2384
  # By default, exclude the `#refine` method, as it tends to have larger
2260
2385
  # associated blocks.
@@ -2300,6 +2425,7 @@ Metrics/MethodLength:
2300
2425
  CountComments: false # count full line comments?
2301
2426
  Max: 50
2302
2427
  CountAsOne: []
2428
+ #ExcludedMethods: [] # deprecated, retained for backwards compatibility
2303
2429
  IgnoredMethods: []
2304
2430
 
2305
2431
  Metrics/ModuleLength:
@@ -2363,6 +2489,15 @@ Naming/BinaryOperatorParameterName:
2363
2489
  VersionAdded: '0.50'
2364
2490
  VersionChanged: '1.2'
2365
2491
 
2492
+ Naming/BlockForwarding:
2493
+ Description: 'Use anonymous block forwarding.'
2494
+ Enabled: true
2495
+ VersionAdded: '1.24'
2496
+ EnforcedStyle: anonymous
2497
+ SupportedStyles:
2498
+ - anonymous
2499
+ - explicit
2500
+
2366
2501
  Naming/BlockParameterName:
2367
2502
  Description: >-
2368
2503
  Checks for block parameter names that contain capital letters,
@@ -2412,6 +2547,13 @@ Naming/FileName:
2412
2547
  # whether each source file's class or module name matches the file name --
2413
2548
  # not whether the nested module hierarchy matches the subdirectory path.
2414
2549
  CheckDefinitionPathHierarchy: true
2550
+ # paths that are considered root directories, for example "lib" in most ruby projects
2551
+ # or "app/models" in rails projects
2552
+ CheckDefinitionPathHierarchyRoots:
2553
+ - lib
2554
+ - spec
2555
+ - test
2556
+ - src
2415
2557
  # If non-`nil`, expect all source file names to match the following regex.
2416
2558
  # Only the file name itself is matched, not the entire file path.
2417
2559
  # Use anchors as necessary if you want to match the entire name rather than
@@ -2482,6 +2624,33 @@ Naming/HeredocDelimiterNaming:
2482
2624
  ForbiddenDelimiters:
2483
2625
  - !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
2484
2626
 
2627
+ Naming/InclusiveLanguage:
2628
+ Description: 'Recommend the use of inclusive language instead of problematic terms.'
2629
+ Enabled: false
2630
+ VersionAdded: '1.18'
2631
+ VersionChanged: '1.21'
2632
+ CheckIdentifiers: true
2633
+ CheckConstants: true
2634
+ CheckVariables: true
2635
+ CheckStrings: false
2636
+ CheckSymbols: true
2637
+ CheckComments: true
2638
+ CheckFilepaths: true
2639
+ FlaggedTerms:
2640
+ whitelist:
2641
+ Regex: !ruby/regexp '/white[-_\s]?list/'
2642
+ Suggestions:
2643
+ - allowlist
2644
+ - permit
2645
+ blacklist:
2646
+ Regex: !ruby/regexp '/black[-_\s]?list/'
2647
+ Suggestions:
2648
+ - denylist
2649
+ - block
2650
+ slave:
2651
+ WholeWord: true
2652
+ Suggestions: ['replica', 'secondary', 'follower']
2653
+
2485
2654
  Naming/MemoizedInstanceVariableName:
2486
2655
  Description: >-
2487
2656
  Memoized method name should match memo instance variable name.
@@ -2615,6 +2784,14 @@ Security/Eval:
2615
2784
  Enabled: true
2616
2785
  VersionAdded: '0.47'
2617
2786
 
2787
+ Security/IoMethods:
2788
+ Description: >-
2789
+ Checks for the first argument to `IO.read`, `IO.binread`, `IO.write`, `IO.binwrite`,
2790
+ `IO.foreach`, and `IO.readlines`.
2791
+ Enabled: true
2792
+ Safe: false
2793
+ VersionAdded: '1.22'
2794
+
2618
2795
  Security/JSONLoad:
2619
2796
  Description: >-
2620
2797
  Prefer usage of `JSON.parse` over `JSON.load` due to potential
@@ -2622,10 +2799,9 @@ Security/JSONLoad:
2622
2799
  Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
2623
2800
  Enabled: true
2624
2801
  VersionAdded: '0.43'
2625
- VersionChanged: '0.44'
2802
+ VersionChanged: '1.22'
2626
2803
  # Autocorrect here will change to a method that may cause crashes depending
2627
2804
  # on the value of the argument.
2628
- AutoCorrect: false
2629
2805
  SafeAutoCorrect: false
2630
2806
 
2631
2807
  Security/MarshalLoad:
@@ -2691,8 +2867,9 @@ Style/AndOr:
2691
2867
  Description: 'Use &&/|| instead of and/or.'
2692
2868
  StyleGuide: '#no-and-or-or'
2693
2869
  Enabled: true
2870
+ SafeAutoCorrect: false
2694
2871
  VersionAdded: '0.9'
2695
- VersionChanged: '0.25'
2872
+ VersionChanged: '1.21'
2696
2873
  # Whether `and` and `or` are banned only in conditionals (conditionals)
2697
2874
  # or completely (always).
2698
2875
  EnforcedStyle: conditionals
@@ -2728,7 +2905,7 @@ Style/AsciiComments:
2728
2905
  StyleGuide: '#english-comments'
2729
2906
  Enabled: true
2730
2907
  VersionAdded: '0.9'
2731
- VersionChanged: '0.52'
2908
+ VersionChanged: '1.21'
2732
2909
  AllowedChars:
2733
2910
  - ©
2734
2911
 
@@ -2890,7 +3067,7 @@ Style/CaseEquality:
2890
3067
  Enabled: true
2891
3068
  VersionAdded: '0.9'
2892
3069
  VersionChanged: '0.89'
2893
- # If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
3070
+ # If `AllowOnConstant` option is enabled, the cop will ignore violations when the receiver of
2894
3071
  # the case equality operator is a constant.
2895
3072
  #
2896
3073
  # # bad
@@ -3065,7 +3242,7 @@ Style/CommentAnnotation:
3065
3242
  StyleGuide: '#annotate-keywords'
3066
3243
  Enabled: true
3067
3244
  VersionAdded: '0.10'
3068
- VersionChanged: '1.3'
3245
+ VersionChanged: '1.20'
3069
3246
  Keywords:
3070
3247
  - TODO
3071
3248
  - FIXME
@@ -3073,12 +3250,14 @@ Style/CommentAnnotation:
3073
3250
  - HACK
3074
3251
  - REVIEW
3075
3252
  - NOTE
3253
+ RequireColon: true
3076
3254
 
3077
3255
  Style/CommentedKeyword:
3078
3256
  Description: 'Do not place comments on the same line as certain keywords.'
3079
3257
  Enabled: true
3258
+ SafeAutoCorrect: false
3080
3259
  VersionAdded: '0.51'
3081
- VersionChanged: '1.7'
3260
+ VersionChanged: '1.19'
3082
3261
 
3083
3262
  Style/ConditionalAssignment:
3084
3263
  Description: >-
@@ -3331,6 +3510,18 @@ Style/ExponentialNotation:
3331
3510
  - engineering
3332
3511
  - integral
3333
3512
 
3513
+ Style/FileRead:
3514
+ Description: 'Favor `File.(bin)read` convenience methods.'
3515
+ StyleGuide: '#file-read'
3516
+ Enabled: true
3517
+ VersionAdded: '1.24'
3518
+
3519
+ Style/FileWrite:
3520
+ Description: 'Favor `File.(bin)write` convenience methods.'
3521
+ StyleGuide: '#file-write'
3522
+ Enabled: true
3523
+ VersionAdded: '1.24'
3524
+
3334
3525
  Style/FloatDivision:
3335
3526
  Description: 'For performing float division, coerce one side only.'
3336
3527
  StyleGuide: '#float-division'
@@ -3450,6 +3641,7 @@ Style/HashAsLastArrayItem:
3450
3641
 
3451
3642
  Style/HashConversion:
3452
3643
  Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
3644
+ StyleGuide: '#avoid-hash-constructor'
3453
3645
  Enabled: true
3454
3646
  VersionAdded: '1.10'
3455
3647
  VersionChanged: '1.11'
@@ -3459,8 +3651,10 @@ Style/HashEachMethods:
3459
3651
  Description: 'Use Hash#each_key and Hash#each_value.'
3460
3652
  StyleGuide: '#hash-each'
3461
3653
  Enabled: true
3462
- VersionAdded: '0.80'
3463
3654
  Safe: false
3655
+ VersionAdded: '0.80'
3656
+ VersionChanged: '1.16'
3657
+ AllowedReceivers: []
3464
3658
 
3465
3659
  Style/HashExcept:
3466
3660
  Description: >-
@@ -3486,7 +3680,7 @@ Style/HashSyntax:
3486
3680
  StyleGuide: '#hash-literals'
3487
3681
  Enabled: true
3488
3682
  VersionAdded: '0.9'
3489
- VersionChanged: '0.43'
3683
+ VersionChanged: '1.24'
3490
3684
  EnforcedStyle: ruby19
3491
3685
  SupportedStyles:
3492
3686
  # checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
@@ -3497,6 +3691,13 @@ Style/HashSyntax:
3497
3691
  - no_mixed_keys
3498
3692
  # enforces both ruby19 and no_mixed_keys styles
3499
3693
  - ruby19_no_mixed_keys
3694
+ # Force hashes that have a hash value omission
3695
+ EnforcedShorthandSyntax: always
3696
+ SupportedShorthandSyntax:
3697
+ # forces use of the 3.1 syntax (e.g. {foo:}) when the hash key and value are the same.
3698
+ - always
3699
+ # forces use of explicit hash literal value.
3700
+ - never
3500
3701
  # Force hashes that have a symbol value to use hash rockets
3501
3702
  UseHashRocketsWithSymbolValues: false
3502
3703
  # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
@@ -3522,7 +3723,9 @@ Style/IdenticalConditionalBranches:
3522
3723
  line at the end of each branch, which can validly be moved
3523
3724
  out of the conditional.
3524
3725
  Enabled: true
3726
+ SafeAutoCorrect: false
3525
3727
  VersionAdded: '0.36'
3728
+ VersionChanged: '1.19'
3526
3729
 
3527
3730
  Style/IfInsideElse:
3528
3731
  Description: 'Finds if nodes inside else, which can be converted to elsif.'
@@ -3569,10 +3772,16 @@ Style/ImplicitRuntimeError:
3569
3772
  Enabled: false
3570
3773
  VersionAdded: '0.41'
3571
3774
 
3775
+ Style/InPatternThen:
3776
+ Description: 'Checks for `in;` uses in `case` expressions.'
3777
+ StyleGuide: '#no-in-pattern-semicolons'
3778
+ Enabled: true
3779
+ VersionAdded: '1.16'
3780
+
3572
3781
  Style/InfiniteLoop:
3573
3782
  Description: >-
3574
3783
  Use Kernel#loop for infinite loops.
3575
- This cop is unsafe in the body may raise a `StopIteration` exception.
3784
+ This cop is unsafe if the body may raise a `StopIteration` exception.
3576
3785
  Safe: false
3577
3786
  StyleGuide: '#infinite-loop'
3578
3787
  Enabled: true
@@ -3665,6 +3874,12 @@ Style/LineEndConcatenation:
3665
3874
  VersionAdded: '0.18'
3666
3875
  VersionChanged: '0.64'
3667
3876
 
3877
+ Style/MapToHash:
3878
+ Description: 'Prefer `to_h` with a block over `map.to_h`.'
3879
+ Enabled: true
3880
+ VersionAdded: '1.24'
3881
+ Safe: false
3882
+
3668
3883
  Style/MethodCallWithArgsParentheses:
3669
3884
  Description: 'Use parentheses for method calls with arguments.'
3670
3885
  StyleGuide: '#method-invocation-parens'
@@ -3797,6 +4012,12 @@ Style/MultilineIfThen:
3797
4012
  VersionAdded: '0.9'
3798
4013
  VersionChanged: '0.26'
3799
4014
 
4015
+ Style/MultilineInPatternThen:
4016
+ Description: 'Do not use `then` for multi-line `in` statement.'
4017
+ StyleGuide: '#no-then'
4018
+ Enabled: true
4019
+ VersionAdded: '1.16'
4020
+
3800
4021
  Style/MultilineMemoization:
3801
4022
  Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
3802
4023
  Enabled: true
@@ -3835,6 +4056,7 @@ Style/MultipleComparison:
3835
4056
  Enabled: true
3836
4057
  VersionAdded: '0.49'
3837
4058
  VersionChanged: '1.1'
4059
+ AllowMethodComparison: true
3838
4060
 
3839
4061
  Style/MutableConstant:
3840
4062
  Description: 'Do not assign mutable objects to constants.'
@@ -3968,6 +4190,7 @@ Style/NilLambda:
3968
4190
  Description: 'Prefer `-> {}` to `-> { nil }`.'
3969
4191
  Enabled: true
3970
4192
  VersionAdded: '1.3'
4193
+ VersionChanged: '1.15'
3971
4194
 
3972
4195
  Style/NonNilCheck:
3973
4196
  Description: 'Checks for redundant nil checks.'
@@ -3990,6 +4213,21 @@ Style/Not:
3990
4213
  VersionAdded: '0.9'
3991
4214
  VersionChanged: '0.20'
3992
4215
 
4216
+ Style/NumberedParameters:
4217
+ Description: 'Restrict the usage of numbered parameters.'
4218
+ Enabled: true
4219
+ VersionAdded: '1.22'
4220
+ EnforcedStyle: allow_single_line
4221
+ SupportedStyles:
4222
+ - allow_single_line
4223
+ - disallow
4224
+
4225
+ Style/NumberedParametersLimit:
4226
+ Description: 'Avoid excessive numbered params in a single block.'
4227
+ Enabled: true
4228
+ VersionAdded: '1.22'
4229
+ Max: 1
4230
+
3993
4231
  Style/NumericLiteralPrefix:
3994
4232
  Description: 'Use smallcase prefixes for numeric literals.'
3995
4233
  StyleGuide: '#numeric-literal-prefixes'
@@ -4000,7 +4238,6 @@ Style/NumericLiteralPrefix:
4000
4238
  - zero_with_o
4001
4239
  - zero_only
4002
4240
 
4003
-
4004
4241
  Style/NumericLiterals:
4005
4242
  Description: >-
4006
4243
  Add underscores to large numeric literals to improve their
@@ -4011,6 +4248,8 @@ Style/NumericLiterals:
4011
4248
  VersionChanged: '0.48'
4012
4249
  MinDigits: 5
4013
4250
  Strict: false
4251
+ # You can specify allowed numbers. (e.g. port number 3000, 8080, and etc)
4252
+ AllowedNumbers: []
4014
4253
 
4015
4254
  Style/NumericPredicate:
4016
4255
  Description: >-
@@ -4045,6 +4284,16 @@ Style/OneLineConditional:
4045
4284
  VersionAdded: '0.9'
4046
4285
  VersionChanged: '0.90'
4047
4286
 
4287
+ Style/OpenStructUse:
4288
+ Description: >-
4289
+ Avoid using OpenStruct. As of Ruby 3.0, use is officially discouraged due to performance,
4290
+ version compatibility, and potential security issues.
4291
+ Reference:
4292
+ - https://docs.ruby-lang.org/en/3.0.0/OpenStruct.html#class-OpenStruct-label-Caveats
4293
+
4294
+ Enabled: true
4295
+ VersionAdded: '1.23'
4296
+
4048
4297
  Style/OptionHash:
4049
4298
  Description: "Don't use option hashes when you can use keyword arguments."
4050
4299
  Enabled: false
@@ -4057,6 +4306,7 @@ Style/OptionHash:
4057
4306
  - args
4058
4307
  - params
4059
4308
  - parameters
4309
+ Allowlist: []
4060
4310
 
4061
4311
  Style/OptionalArguments:
4062
4312
  Description: >-
@@ -4158,6 +4408,16 @@ Style/Proc:
4158
4408
  VersionAdded: '0.9'
4159
4409
  VersionChanged: '0.18'
4160
4410
 
4411
+ Style/QuotedSymbols:
4412
+ Description: 'Use a consistent style for quoted symbols.'
4413
+ Enabled: true
4414
+ VersionAdded: '1.16'
4415
+ EnforcedStyle: same_as_string_literals
4416
+ SupportedStyles:
4417
+ - same_as_string_literals
4418
+ - single_quotes
4419
+ - double_quotes
4420
+
4161
4421
  Style/RaiseArgs:
4162
4422
  Description: 'Checks the arguments passed to raise/fail.'
4163
4423
  StyleGuide: '#exception-class-messages'
@@ -4303,12 +4563,19 @@ Style/RedundantSelfAssignment:
4303
4563
  Safe: false
4304
4564
  VersionAdded: '0.90'
4305
4565
 
4566
+ Style/RedundantSelfAssignmentBranch:
4567
+ Description: 'Checks for places where conditional branch makes redundant self-assignment.'
4568
+ Enabled: true
4569
+ VersionAdded: '1.19'
4570
+
4306
4571
  Style/RedundantSort:
4307
4572
  Description: >-
4308
4573
  Use `min` instead of `sort.first`,
4309
4574
  `max_by` instead of `sort_by...last`, etc.
4310
4575
  Enabled: true
4311
4576
  VersionAdded: '0.76'
4577
+ VersionChanged: '1.22'
4578
+ Safe: false
4312
4579
 
4313
4580
  Style/RedundantSortBy:
4314
4581
  Description: 'Use `sort` instead of `sort_by { |x| x }`.'
@@ -4389,6 +4656,12 @@ Style/Sample:
4389
4656
  Enabled: true
4390
4657
  VersionAdded: '0.30'
4391
4658
 
4659
+ Style/SelectByRegexp:
4660
+ Description: 'Prefer grep/grep_v to select/reject with a regexp match.'
4661
+ Enabled: true
4662
+ SafeAutoCorrect: false
4663
+ VersionAdded: '1.22'
4664
+
4392
4665
  Style/SelfAssignment:
4393
4666
  Description: >-
4394
4667
  Checks for places where self-assignment shorthand should have
@@ -4474,6 +4747,7 @@ Style/SpecialGlobalVars:
4474
4747
  VersionAdded: '0.13'
4475
4748
  VersionChanged: '0.36'
4476
4749
  SafeAutoCorrect: false
4750
+ RequireEnglish: true
4477
4751
  EnforcedStyle: use_english_names
4478
4752
  SupportedStyles:
4479
4753
  - use_perl_names
@@ -4515,7 +4789,8 @@ Style/StringConcatenation:
4515
4789
  Enabled: true
4516
4790
  Safe: false
4517
4791
  VersionAdded: '0.89'
4518
- VersionChanged: '1.6'
4792
+ VersionChanged: '1.18'
4793
+ Mode: aggressive
4519
4794
 
4520
4795
  Style/StringHashKeys:
4521
4796
  Description: 'Prefer symbols instead of strings as hash keys.'
@@ -4573,8 +4848,9 @@ Style/StructInheritance:
4573
4848
  Description: 'Checks for inheritance from Struct.new.'
4574
4849
  StyleGuide: '#no-extend-struct-new'
4575
4850
  Enabled: true
4851
+ SafeAutoCorrect: false
4576
4852
  VersionAdded: '0.29'
4577
- VersionChanged: '0.86'
4853
+ VersionChanged: '1.20'
4578
4854
 
4579
4855
  Style/SwapValues:
4580
4856
  Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
@@ -4625,6 +4901,12 @@ Style/TernaryParentheses:
4625
4901
  - require_parentheses_when_complex
4626
4902
  AllowSafeAssignment: true
4627
4903
 
4904
+ Style/TopLevelMethodDefinition:
4905
+ Description: 'This cop looks for top-level method definitions.'
4906
+ StyleGuide: '#top-level-methods'
4907
+ Enabled: false
4908
+ VersionAdded: '1.15'
4909
+
4628
4910
  Style/TrailingBodyOnClass:
4629
4911
  Description: 'Class body goes below class statement.'
4630
4912
  Enabled: true
@@ -4711,7 +4993,7 @@ Style/TrivialAccessors:
4711
4993
  StyleGuide: '#attr_family'
4712
4994
  Enabled: true
4713
4995
  VersionAdded: '0.9'
4714
- VersionChanged: '0.77'
4996
+ VersionChanged: '1.15'
4715
4997
  # When set to `false` the cop will suggest the use of accessor methods
4716
4998
  # in situations like:
4717
4999
  #
@@ -4730,7 +5012,7 @@ Style/TrivialAccessors:
4730
5012
  # on_exception :restart
4731
5013
  #
4732
5014
  # Commonly used in DSLs
4733
- AllowDSLWriters: false
5015
+ AllowDSLWriters: true
4734
5016
  IgnoreClassMethods: false
4735
5017
  AllowedMethods:
4736
5018
  - to_ary
@@ -4787,7 +5069,7 @@ Style/VariableInterpolation:
4787
5069
 
4788
5070
  Style/WhenThen:
4789
5071
  Description: 'Use when x then ... for one-line cases.'
4790
- StyleGuide: '#one-line-cases'
5072
+ StyleGuide: '#no-when-semicolons'
4791
5073
  Enabled: true
4792
5074
  VersionAdded: '0.9'
4793
5075
 
@@ -4811,7 +5093,7 @@ Style/WordArray:
4811
5093
  StyleGuide: '#percent-w'
4812
5094
  Enabled: false
4813
5095
  VersionAdded: '0.9'
4814
- VersionChanged: '0.36'
5096
+ VersionChanged: '1.19'
4815
5097
  EnforcedStyle: percent
4816
5098
  SupportedStyles:
4817
5099
  # percent style: %w(word1 word2)