ffi-geos 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6489cba5533e2154d395430af2b57dedd195f431ab1ae63ef4a1be3307870d8
4
- data.tar.gz: dbb16e1d9215fc4319ea2bc1e3c4ad0e09d4680f9bb414305409510c52847eba
3
+ metadata.gz: ad455c6601540ad458633400a3d4b55722b5dff1415514e3cece263b29e79984
4
+ data.tar.gz: 5f4e7646fb59267100418c6c4d6f2478f1dc9f6f8b49ac5d04fb0cf5b960a4b3
5
5
  SHA512:
6
- metadata.gz: 270ba46d702eceb2bccf449530b95e31bcc47789737daed07de74923df4d30ca5e73f0408b9baf62a1e4e373c6dd0728bc13038aa833a00791e502d58f54f5f7
7
- data.tar.gz: 53e9981f5a55363b4aeaae90aa4edb3328cace0e909689f5673a65075e7fff6bb62704a4ce7aeab3514998818e51380b6ec31b9d12dd15f898f3627f5e1c439e
6
+ metadata.gz: 90248b57a990f2ffdaae1fab6bcf0a8ff4a0e2616642ee3bd93eca9307a1c2a833d738b1dd4a62a16ea4421f14e221fa19b0e1299de596bbb6876fdcbae44c61
7
+ data.tar.gz: db4b787c80d3274530da0a396bf3ad39affc1f7881cb715e019d4333db45bca5ff01ec4bb5052038f049e1456ef389ab972bf9116aebc6004f8f1dc0b208b965
data/.rubocop.yml CHANGED
@@ -35,6 +35,7 @@ AllCops:
35
35
  - '**/*.watchr'
36
36
  - '**/.irbrc'
37
37
  - '**/.pryrc'
38
+ - '**/.simplecov'
38
39
  - '**/buildfile'
39
40
  - '**/Appraisals'
40
41
  - '**/Berksfile'
@@ -53,7 +54,9 @@ AllCops:
53
54
  - '**/Podfile'
54
55
  - '**/Puppetfile'
55
56
  - '**/Rakefile'
57
+ - '**/rakefile'
56
58
  - '**/Snapfile'
59
+ - '**/Steepfile'
57
60
  - '**/Thorfile'
58
61
  - '**/Vagabondfile'
59
62
  - '**/Vagrantfile'
@@ -98,6 +101,14 @@ AllCops:
98
101
  # to true in the same configuration.
99
102
  EnabledByDefault: false
100
103
  DisabledByDefault: false
104
+ # New cops introduced between major versions are set to a special pending status
105
+ # and are not enabled by default with warning message.
106
+ # Change this behavior by overriding either `NewCops: enable` or `NewCops: disable`.
107
+ # When `NewCops` is `enable`, pending cops are enabled in bulk. Can be overridden by
108
+ # the `--enable-pending-cops` command-line option.
109
+ # When `NewCops` is `disable`, pending cops are disabled in bulk. Can be overridden by
110
+ # the `--disable-pending-cops` command-line option.
111
+ NewCops: pending
101
112
  # Enables the result cache if `true`. Can be overridden by the `--cache` command
102
113
  # line option.
103
114
  UseCache: true
@@ -108,6 +119,8 @@ AllCops:
108
119
  # CacheRootDirectory is ~ (nil), which it is by default, the root will be
109
120
  # taken from the environment variable `$XDG_CACHE_HOME` if it is set, or if
110
121
  # `$XDG_CACHE_HOME` is not set, it will be `$HOME/.cache/`.
122
+ # The CacheRootDirectory can be overwritten by passing the `--cache-root` command
123
+ # line option or by setting `$RUBOCOP_CACHE_ROOT` environment variable.
111
124
  CacheRootDirectory: ~
112
125
  # It is possible for a malicious user to know the location of RuboCop's cache
113
126
  # directory by looking at CacheRootDirectory, and create a symlink in its
@@ -121,13 +134,24 @@ AllCops:
121
134
  # If a value is specified for TargetRubyVersion then it is used. Acceptable
122
135
  # values are specificed as a float (i.e. 2.5); the teeny version of Ruby
123
136
  # should not be included. If the project specifies a Ruby version in the
124
- # .ruby-version file, Gemfile or gems.rb file, RuboCop will try to determine
125
- # the desired version of Ruby by inspecting the .ruby-version file first,
126
- # followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
127
- # is specified in the Gemfile or gems.rb file, RuboCop reads the final value
128
- # from the lock file.) If the Ruby version is still unresolved, RuboCop will
129
- # use the oldest officially supported Ruby version (currently Ruby 2.3).
137
+ # .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
138
+ # try to determine the desired version of Ruby by inspecting the
139
+ # .tool-versions file first, then .ruby-version, followed by the Gemfile.lock
140
+ # or gems.locked file. (Although the Ruby version is specified in the Gemfile
141
+ # or gems.rb file, RuboCop reads the final value from the lock file.) If the
142
+ # Ruby version is still unresolved, RuboCop will use the oldest officially
143
+ # supported Ruby version (currently Ruby 2.4).
130
144
  TargetRubyVersion: ~
145
+ # Determines if a notification for extension libraries should be shown when
146
+ # rubocop is run. Keys are the name of the extension, and values are an array
147
+ # of gems in the Gemfile that the extension is suggested for, if not already
148
+ # included.
149
+ SuggestExtensions:
150
+ rubocop-rails: [rails]
151
+ rubocop-rspec: [rspec, rspec-rails]
152
+ rubocop-minitest: [minitest]
153
+ rubocop-sequel: [sequel]
154
+ rubocop-rake: [rake]
131
155
 
132
156
  #################### Bundler ###############################
133
157
 
@@ -144,12 +168,13 @@ Bundler/GemComment:
144
168
  Description: 'Add a comment describing each gem.'
145
169
  Enabled: false
146
170
  VersionAdded: '0.59'
147
- VersionChanged: '0.77'
171
+ VersionChanged: '0.85'
148
172
  Include:
149
173
  - '**/*.gemfile'
150
174
  - '**/Gemfile'
151
175
  - '**/gems.rb'
152
176
  IgnoredGems: []
177
+ OnlyFor: []
153
178
 
154
179
  Bundler/InsecureProtocolSource:
155
180
  Description: >-
@@ -170,6 +195,9 @@ Bundler/OrderedGems:
170
195
  VersionAdded: '0.46'
171
196
  VersionChanged: '0.47'
172
197
  TreatCommentsAsGroupSeparators: true
198
+ # By default, "-" and "_" are ignored for order purposes.
199
+ # This can be overridden by setting this parameter to true.
200
+ ConsiderPunctuation: false
173
201
  Include:
174
202
  - '**/*.gemfile'
175
203
  - '**/Gemfile'
@@ -177,6 +205,13 @@ Bundler/OrderedGems:
177
205
 
178
206
  #################### Gemspec ###############################
179
207
 
208
+ Gemspec/DateAssignment:
209
+ Description: 'Checks that `date =` is not used in gemspec file, it is set automatically when the gem is packaged.'
210
+ Enabled: true
211
+ VersionAdded: '1.10'
212
+ Include:
213
+ - '**/*.gemspec'
214
+
180
215
  Gemspec/DuplicatedAssignment:
181
216
  Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
182
217
  Enabled: true
@@ -190,13 +225,17 @@ Gemspec/OrderedDependencies:
190
225
  Enabled: true
191
226
  VersionAdded: '0.51'
192
227
  TreatCommentsAsGroupSeparators: true
228
+ # By default, "-" and "_" are ignored for order purposes.
229
+ # This can be overridden by setting this parameter to true.
230
+ ConsiderPunctuation: false
193
231
  Include:
194
232
  - '**/*.gemspec'
195
233
 
196
234
  Gemspec/RequiredRubyVersion:
197
- Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
235
+ Description: 'Checks that `required_ruby_version` of gemspec is specified and equal to `TargetRubyVersion` of .rubocop.yml.'
198
236
  Enabled: true
199
237
  VersionAdded: '0.52'
238
+ VersionChanged: '0.89'
200
239
  Include:
201
240
  - '**/*.gemspec'
202
241
 
@@ -256,10 +295,30 @@ Layout/ArrayAlignment:
256
295
  Description: >-
257
296
  Align the elements of an array literal if they span more than
258
297
  one line.
259
- StyleGuide: '#align-multiline-arrays'
298
+ StyleGuide: '#no-double-indent'
260
299
  Enabled: true
261
300
  VersionAdded: '0.49'
262
301
  VersionChanged: '0.77'
302
+ # Alignment of elements of a multi-line array.
303
+ #
304
+ # The `with_first_parameter` style aligns the following lines along the same
305
+ # column as the first element.
306
+ #
307
+ # array = [1, 2, 3,
308
+ # 4, 5, 6]
309
+ #
310
+ # The `with_fixed_indentation` style aligns the following lines with one
311
+ # level of indentation relative to the start of the line with start of array.
312
+ #
313
+ # array = [1, 2, 3,
314
+ # 4, 5, 6]
315
+ EnforcedStyle: with_first_element
316
+ SupportedStyles:
317
+ - with_first_element
318
+ - with_fixed_indentation
319
+ # By default, the indentation width from Layout/IndentationWidth is used
320
+ # But it can be overridden by setting this parameter
321
+ IndentationWidth: ~
263
322
 
264
323
  Layout/AssignmentIndentation:
265
324
  Description: >-
@@ -272,6 +331,19 @@ Layout/AssignmentIndentation:
272
331
  # But it can be overridden by setting this parameter
273
332
  IndentationWidth: ~
274
333
 
334
+ Layout/BeginEndAlignment:
335
+ Description: 'Align ends corresponding to begins correctly.'
336
+ Enabled: true
337
+ VersionAdded: '0.91'
338
+ # The value `start_of_line` means that `end` should be aligned the start of the line
339
+ # where the `begin` keyword is.
340
+ # The value `begin` means that `end` should be aligned with the `begin` keyword.
341
+ EnforcedStyleAlignWith: start_of_line
342
+ SupportedStylesAlignWith:
343
+ - start_of_line
344
+ - begin
345
+ Severity: warning
346
+
275
347
  Layout/BlockAlignment:
276
348
  Description: 'Align block ends correctly.'
277
349
  Enabled: true
@@ -348,6 +420,7 @@ Layout/ConditionPosition:
348
420
  StyleGuide: '#same-line-condition'
349
421
  Enabled: true
350
422
  VersionAdded: '0.53'
423
+ VersionChanged: '0.83'
351
424
 
352
425
  Layout/DefEndAlignment:
353
426
  Description: 'Align ends corresponding to defs correctly.'
@@ -361,7 +434,6 @@ Layout/DefEndAlignment:
361
434
  SupportedStylesAlignWith:
362
435
  - start_of_line
363
436
  - def
364
- AutoCorrect: false
365
437
  Severity: warning
366
438
 
367
439
  Layout/DotPosition:
@@ -398,11 +470,23 @@ Layout/EmptyLineAfterMagicComment:
398
470
  Enabled: true
399
471
  VersionAdded: '0.49'
400
472
 
473
+ Layout/EmptyLineAfterMultilineCondition:
474
+ Description: 'Enforces empty line after multiline condition.'
475
+ # This is disabled, because this style is not very common in practice.
476
+ Enabled: false
477
+ VersionAdded: '0.90'
478
+ Reference:
479
+ - https://github.com/airbnb/ruby#multiline-if-newline
480
+
401
481
  Layout/EmptyLineBetweenDefs:
402
- Description: 'Use empty lines between defs.'
482
+ Description: 'Use empty lines between class/module/method defs.'
403
483
  StyleGuide: '#empty-lines-between-methods'
404
484
  Enabled: true
405
485
  VersionAdded: '0.49'
486
+ VersionChanged: '1.7'
487
+ EmptyLineBetweenMethodDefs: true
488
+ EmptyLineBetweenClassDefs: true
489
+ EmptyLineBetweenModuleDefs: true
406
490
  # If `true`, this parameter means that single line method definitions don't
407
491
  # need an empty line between them.
408
492
  AllowAdjacentOneLineDefs: false
@@ -433,6 +517,19 @@ Layout/EmptyLinesAroundArguments:
433
517
  Enabled: true
434
518
  VersionAdded: '0.52'
435
519
 
520
+ Layout/EmptyLinesAroundAttributeAccessor:
521
+ Description: "Keep blank lines around attribute accessors."
522
+ StyleGuide: '#empty-lines-around-attribute-accessor'
523
+ Enabled: true
524
+ VersionAdded: '0.83'
525
+ VersionChanged: '0.84'
526
+ AllowAliasSyntax: true
527
+ AllowedMethods:
528
+ - alias_method
529
+ - public
530
+ - protected
531
+ - private
532
+
436
533
  Layout/EmptyLinesAroundBeginBody:
437
534
  Description: "Keeps track of empty lines around begin-end bodies."
438
535
  StyleGuide: '#empty-lines-around-bodies'
@@ -504,7 +601,6 @@ Layout/EndAlignment:
504
601
  - keyword
505
602
  - variable
506
603
  - start_of_line
507
- AutoCorrect: false
508
604
  Severity: warning
509
605
 
510
606
  Layout/EndOfLine:
@@ -747,13 +843,7 @@ Layout/HeredocIndentation:
747
843
  StyleGuide: '#squiggly-heredocs'
748
844
  Enabled: true
749
845
  VersionAdded: '0.49'
750
- VersionChanged: '0.77'
751
- EnforcedStyle: squiggly
752
- SupportedStyles:
753
- - squiggly
754
- - active_support
755
- - powerpack
756
- - unindent
846
+ VersionChanged: '0.85'
757
847
 
758
848
  Layout/IndentationConsistency:
759
849
  Description: 'Keep indentation straight.'
@@ -774,6 +864,22 @@ Layout/IndentationConsistency:
774
864
  # A reference to `EnforcedStyle: indented_internal_methods`.
775
865
  - https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions
776
866
 
867
+ Layout/IndentationStyle:
868
+ Description: 'Consistent indentation either with tabs only or spaces only.'
869
+ StyleGuide: '#spaces-indentation'
870
+ Enabled: true
871
+ VersionAdded: '0.49'
872
+ VersionChanged: '0.82'
873
+ # By default, the indentation width from Layout/IndentationWidth is used
874
+ # But it can be overridden by setting this parameter
875
+ # It is used during auto-correction to determine how many spaces should
876
+ # replace each tab.
877
+ IndentationWidth: ~
878
+ EnforcedStyle: spaces
879
+ SupportedStyles:
880
+ - spaces
881
+ - tabs
882
+
777
883
  Layout/IndentationWidth:
778
884
  Description: 'Use 2 spaces for indentation.'
779
885
  StyleGuide: '#spaces-indentation'
@@ -796,6 +902,7 @@ Layout/LeadingCommentSpace:
796
902
  VersionAdded: '0.49'
797
903
  VersionChanged: '0.73'
798
904
  AllowDoxygenCommentStyle: false
905
+ AllowGemfileRubyComment: false
799
906
 
800
907
  Layout/LeadingEmptyLines:
801
908
  Description: Check for unnecessary blank lines at the beginning of a file.
@@ -804,12 +911,12 @@ Layout/LeadingEmptyLines:
804
911
  VersionChanged: '0.77'
805
912
 
806
913
  Layout/LineLength:
807
- Description: 'Limit lines to 80 characters.'
808
- StyleGuide: '#80-character-limits'
914
+ Description: 'Checks that line length does not exceed the configured limit.'
915
+ StyleGuide: '#max-line-length'
809
916
  Enabled: true
810
917
  VersionAdded: '0.25'
811
- VersionChanged: '0.78'
812
- AutoCorrect: false
918
+ VersionChanged: '1.4'
919
+ AutoCorrect: true
813
920
  Max: 300
814
921
  # To make it possible to copy or click on URIs in the code, we allow lines
815
922
  # containing a URI to be longer than Max.
@@ -1060,6 +1167,11 @@ Layout/SpaceAroundKeyword:
1060
1167
  Enabled: true
1061
1168
  VersionAdded: '0.49'
1062
1169
 
1170
+ Layout/SpaceAroundMethodCallOperator:
1171
+ Description: 'Checks method call operators to not have spaces around them.'
1172
+ Enabled: true
1173
+ VersionAdded: '0.82'
1174
+
1063
1175
  Layout/SpaceAroundOperators:
1064
1176
  Description: 'Use a single space around operators.'
1065
1177
  StyleGuide: '#spaces-operators'
@@ -1088,7 +1200,13 @@ Layout/SpaceBeforeBlockBraces:
1088
1200
  SupportedStylesForEmptyBraces:
1089
1201
  - space
1090
1202
  - no_space
1091
- VersionChanged: '0.52.1'
1203
+ VersionChanged: '0.52'
1204
+
1205
+ Layout/SpaceBeforeBrackets:
1206
+ Description: 'Checks for receiver with a space before the opening brackets.'
1207
+ StyleGuide: '#space-in-brackets-access'
1208
+ Enabled: true
1209
+ VersionAdded: '1.7'
1092
1210
 
1093
1211
  Layout/SpaceBeforeComma:
1094
1212
  Description: 'No spaces before commas.'
@@ -1230,18 +1348,6 @@ Layout/SpaceInsideStringInterpolation:
1230
1348
  - space
1231
1349
  - no_space
1232
1350
 
1233
- Layout/Tab:
1234
- Description: 'No hard tabs.'
1235
- StyleGuide: '#spaces-indentation'
1236
- Enabled: true
1237
- VersionAdded: '0.49'
1238
- VersionChanged: '0.51'
1239
- # By default, the indentation width from Layout/IndentationWidth is used
1240
- # But it can be overridden by setting this parameter
1241
- # It is used during auto-correction to determine how many spaces should
1242
- # replace each tab.
1243
- IndentationWidth: ~
1244
-
1245
1351
  Layout/TrailingEmptyLines:
1246
1352
  Description: 'Checks trailing blank lines and final newline.'
1247
1353
  StyleGuide: '#newline-eof'
@@ -1258,12 +1364,17 @@ Layout/TrailingWhitespace:
1258
1364
  StyleGuide: '#no-trailing-whitespace'
1259
1365
  Enabled: true
1260
1366
  VersionAdded: '0.49'
1261
- VersionChanged: '0.55'
1367
+ VersionChanged: '1.0'
1262
1368
  AllowInHeredoc: false
1263
1369
 
1264
1370
  #################### Lint ##################################
1265
1371
  ### Warnings
1266
1372
 
1373
+ Lint/AmbiguousAssignment:
1374
+ Description: 'Checks for mistyped shorthand assignments.'
1375
+ Enabled: true
1376
+ VersionAdded: '1.7'
1377
+
1267
1378
  Lint/AmbiguousBlockAssociation:
1268
1379
  Description: >-
1269
1380
  Checks for ambiguous block association with method when param passed without
@@ -1279,6 +1390,7 @@ Lint/AmbiguousOperator:
1279
1390
  StyleGuide: '#method-invocation-parens'
1280
1391
  Enabled: true
1281
1392
  VersionAdded: '0.17'
1393
+ VersionChanged: '0.83'
1282
1394
 
1283
1395
  Lint/AmbiguousRegexpLiteral:
1284
1396
  Description: >-
@@ -1286,6 +1398,7 @@ Lint/AmbiguousRegexpLiteral:
1286
1398
  a method invocation without parentheses.
1287
1399
  Enabled: true
1288
1400
  VersionAdded: '0.17'
1401
+ VersionChanged: '0.83'
1289
1402
 
1290
1403
  Lint/AssignmentInCondition:
1291
1404
  Description: "Don't use assignment in conditions."
@@ -1299,38 +1412,137 @@ Lint/BigDecimalNew:
1299
1412
  Enabled: true
1300
1413
  VersionAdded: '0.53'
1301
1414
 
1415
+ Lint/BinaryOperatorWithIdenticalOperands:
1416
+ Description: 'This cop checks for places where binary operator has identical operands.'
1417
+ Enabled: true
1418
+ Safe: false
1419
+ VersionAdded: '0.89'
1420
+ VersionChanged: '1.7'
1421
+
1302
1422
  Lint/BooleanSymbol:
1303
1423
  Description: 'Check for `:true` and `:false` symbols.'
1304
1424
  Enabled: true
1425
+ Safe: false
1305
1426
  VersionAdded: '0.50'
1427
+ VersionChanged: '0.83'
1306
1428
 
1307
1429
  Lint/CircularArgumentReference:
1308
1430
  Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
1309
1431
  Enabled: true
1310
1432
  VersionAdded: '0.33'
1311
1433
 
1434
+ Lint/ConstantDefinitionInBlock:
1435
+ Description: 'Do not define constants within a block.'
1436
+ StyleGuide: '#no-constant-definition-in-block'
1437
+ Enabled: true
1438
+ VersionAdded: '0.91'
1439
+ VersionChanged: '1.3'
1440
+ # `enums` for Typed Enums via T::Enum in Sorbet.
1441
+ # https://sorbet.org/docs/tenum
1442
+ AllowedMethods:
1443
+ - enums
1444
+
1445
+ Lint/ConstantResolution:
1446
+ Description: 'Check that constants are fully qualified with `::`.'
1447
+ Enabled: false
1448
+ VersionAdded: '0.86'
1449
+ # Restrict this cop to only looking at certain names
1450
+ Only: []
1451
+ # Restrict this cop from only looking at certain names
1452
+ Ignore: []
1453
+
1312
1454
  Lint/Debugger:
1313
1455
  Description: 'Check for debugger calls.'
1314
1456
  Enabled: true
1315
1457
  VersionAdded: '0.14'
1316
- VersionChanged: '0.49'
1458
+ VersionChanged: '1.10'
1459
+ DebuggerMethods:
1460
+ # Groups are available so that a specific group can be disabled in
1461
+ # a user's configuration, but are otherwise not significant.
1462
+ Kernel:
1463
+ - binding.irb
1464
+ Byebug:
1465
+ - byebug
1466
+ - remote_byebug
1467
+ - Kernel.byebug
1468
+ - Kernel.remote_byebug
1469
+ Capybara:
1470
+ - save_and_open_page
1471
+ - save_and_open_screenshot
1472
+ Pry:
1473
+ - binding.pry
1474
+ - binding.remote_pry
1475
+ - binding.pry_remote
1476
+ - Pry.rescue
1477
+ Rails:
1478
+ - debugger
1479
+ - Kernel.debugger
1480
+ WebConsole:
1481
+ - binding.console
1317
1482
 
1318
1483
  Lint/DeprecatedClassMethods:
1319
1484
  Description: 'Check for deprecated class method calls.'
1320
1485
  Enabled: true
1321
1486
  VersionAdded: '0.19'
1322
1487
 
1488
+ Lint/DeprecatedConstants:
1489
+ Description: 'Checks for deprecated constants.'
1490
+ Enabled: true
1491
+ VersionAdded: '1.8'
1492
+ # You can configure deprecated constants.
1493
+ # If there is an alternative method, you can set alternative value as `Alternative`.
1494
+ # And you can set the deprecated version as `DeprecatedVersion`.
1495
+ # These options can be omitted if they are not needed.
1496
+ #
1497
+ # DeprecatedConstants:
1498
+ # 'DEPRECATED_CONSTANT':
1499
+ # Alternative: 'alternative_value'
1500
+ # DeprecatedVersion: 'deprecated_version'
1501
+ #
1502
+ DeprecatedConstants:
1503
+ 'NIL':
1504
+ Alternative: 'nil'
1505
+ DeprecatedVersion: '2.4'
1506
+ 'TRUE':
1507
+ Alternative: 'true'
1508
+ DeprecatedVersion: '2.4'
1509
+ 'FALSE':
1510
+ Alternative: 'false'
1511
+ DeprecatedVersion: '2.4'
1512
+ 'Random::DEFAULT':
1513
+ Alternative: 'Random.new'
1514
+ DeprecatedVersion: '3.0'
1515
+
1516
+ Lint/DeprecatedOpenSSLConstant:
1517
+ Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
1518
+ Enabled: true
1519
+ VersionAdded: '0.84'
1520
+
1323
1521
  Lint/DisjunctiveAssignmentInConstructor:
1324
1522
  Description: 'In constructor, plain assignment is preferred over disjunctive.'
1325
1523
  Enabled: true
1326
1524
  Safe: false
1327
1525
  VersionAdded: '0.62'
1526
+ VersionChanged: '0.88'
1527
+
1528
+ Lint/DuplicateBranch:
1529
+ Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
1530
+ Enabled: true
1531
+ VersionAdded: '1.3'
1532
+ VersionChanged: '1.7'
1533
+ IgnoreLiteralBranches: false
1534
+ IgnoreConstantBranches: false
1328
1535
 
1329
1536
  Lint/DuplicateCaseCondition:
1330
1537
  Description: 'Do not repeat values in case conditionals.'
1331
1538
  Enabled: true
1332
1539
  VersionAdded: '0.45'
1333
1540
 
1541
+ Lint/DuplicateElsifCondition:
1542
+ Description: 'Do not repeat conditions used in if `elsif`.'
1543
+ Enabled: true
1544
+ VersionAdded: '0.88'
1545
+
1334
1546
  Lint/DuplicateHashKey:
1335
1547
  Description: 'Check for duplicate keys in hash literals.'
1336
1548
  Enabled: true
@@ -1342,6 +1554,21 @@ Lint/DuplicateMethods:
1342
1554
  Enabled: true
1343
1555
  VersionAdded: '0.29'
1344
1556
 
1557
+ Lint/DuplicateRegexpCharacterClassElement:
1558
+ Description: 'Checks for duplicate elements in Regexp character classes.'
1559
+ Enabled: true
1560
+ VersionAdded: '1.1'
1561
+
1562
+ Lint/DuplicateRequire:
1563
+ Description: 'Check for duplicate `require`s and `require_relative`s.'
1564
+ Enabled: true
1565
+ VersionAdded: '0.90'
1566
+
1567
+ Lint/DuplicateRescueException:
1568
+ Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
1569
+ Enabled: true
1570
+ VersionAdded: '0.89'
1571
+
1345
1572
  Lint/EachWithObjectArgument:
1346
1573
  Description: 'Check for immutable argument given to each_with_object.'
1347
1574
  Enabled: true
@@ -1351,19 +1578,45 @@ Lint/ElseLayout:
1351
1578
  Description: 'Check for odd code arrangement in an else block.'
1352
1579
  Enabled: true
1353
1580
  VersionAdded: '0.17'
1581
+ VersionChanged: '1.2'
1582
+
1583
+ Lint/EmptyBlock:
1584
+ Description: 'This cop checks for blocks without a body.'
1585
+ Enabled: true
1586
+ VersionAdded: '1.1'
1587
+ VersionChanged: '1.3'
1588
+ AllowComments: true
1589
+ AllowEmptyLambdas: true
1590
+
1591
+ Lint/EmptyClass:
1592
+ Description: 'Checks for classes and metaclasses without a body.'
1593
+ Enabled: true
1594
+ VersionAdded: '1.3'
1595
+ AllowComments: false
1596
+
1597
+ Lint/EmptyConditionalBody:
1598
+ Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
1599
+ Enabled: true
1600
+ AllowComments: true
1601
+ VersionAdded: '0.89'
1354
1602
 
1355
1603
  Lint/EmptyEnsure:
1356
1604
  Description: 'Checks for empty ensure block.'
1357
1605
  Enabled: true
1358
1606
  VersionAdded: '0.10'
1359
1607
  VersionChanged: '0.48'
1360
- AutoCorrect: false
1361
1608
 
1362
1609
  Lint/EmptyExpression:
1363
1610
  Description: 'Checks for empty expressions.'
1364
1611
  Enabled: true
1365
1612
  VersionAdded: '0.45'
1366
1613
 
1614
+ Lint/EmptyFile:
1615
+ Description: 'Enforces that Ruby source files are not empty.'
1616
+ Enabled: true
1617
+ AllowComments: true
1618
+ VersionAdded: '0.90'
1619
+
1367
1620
  Lint/EmptyInterpolation:
1368
1621
  Description: 'Checks for empty string interpolation.'
1369
1622
  Enabled: true
@@ -1373,18 +1626,16 @@ Lint/EmptyInterpolation:
1373
1626
  Lint/EmptyWhen:
1374
1627
  Description: 'Checks for `when` branches with empty bodies.'
1375
1628
  Enabled: true
1629
+ AllowComments: true
1376
1630
  VersionAdded: '0.45'
1377
-
1378
- Lint/EndInMethod:
1379
- Description: 'END blocks should not be placed inside method definitions.'
1380
- Enabled: true
1381
- VersionAdded: '0.9'
1631
+ VersionChanged: '0.83'
1382
1632
 
1383
1633
  Lint/EnsureReturn:
1384
1634
  Description: 'Do not use return in an ensure block.'
1385
1635
  StyleGuide: '#no-return-ensure'
1386
1636
  Enabled: true
1387
1637
  VersionAdded: '0.9'
1638
+ VersionChanged: '0.83'
1388
1639
 
1389
1640
  Lint/ErbNewArguments:
1390
1641
  Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
@@ -1397,6 +1648,12 @@ Lint/FlipFlop:
1397
1648
  Enabled: true
1398
1649
  VersionAdded: '0.16'
1399
1650
 
1651
+ Lint/FloatComparison:
1652
+ Description: 'Checks for the presence of precise comparison of floating point numbers.'
1653
+ StyleGuide: '#float-comparison'
1654
+ Enabled: true
1655
+ VersionAdded: '0.89'
1656
+
1400
1657
  Lint/FloatOutOfRange:
1401
1658
  Description: >-
1402
1659
  Catches floating-point literals too large or small for Ruby to
@@ -1409,6 +1666,13 @@ Lint/FormatParameterMismatch:
1409
1666
  Enabled: true
1410
1667
  VersionAdded: '0.33'
1411
1668
 
1669
+ Lint/HashCompareByIdentity:
1670
+ Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
1671
+ StyleGuide: '#identity-comparison'
1672
+ Enabled: true
1673
+ Safe: false
1674
+ VersionAdded: '0.93'
1675
+
1412
1676
  Lint/HeredocMethodCallPosition:
1413
1677
  Description: >-
1414
1678
  Checks for the ordering of a method call where
@@ -1417,6 +1681,12 @@ Lint/HeredocMethodCallPosition:
1417
1681
  StyleGuide: '#heredoc-method-calls'
1418
1682
  VersionAdded: '0.68'
1419
1683
 
1684
+ Lint/IdentityComparison:
1685
+ Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
1686
+ Enabled: true
1687
+ StyleGuide: '#identity-comparison'
1688
+ VersionAdded: '0.91'
1689
+
1420
1690
  Lint/ImplicitStringConcatenation:
1421
1691
  Description: >-
1422
1692
  Checks for adjacent string literals on the same line, which
@@ -1444,7 +1714,14 @@ Lint/InheritException:
1444
1714
  Lint/InterpolationCheck:
1445
1715
  Description: 'Raise warning for interpolation in single q strs.'
1446
1716
  Enabled: true
1717
+ Safe: false
1447
1718
  VersionAdded: '0.50'
1719
+ VersionChanged: '0.87'
1720
+
1721
+ Lint/LambdaWithoutLiteralBlock:
1722
+ Description: 'Checks uses of lambda without a literal block.'
1723
+ Enabled: true
1724
+ VersionAdded: '1.8'
1448
1725
 
1449
1726
  Lint/LiteralAsCondition:
1450
1727
  Description: 'Checks of literals used in conditions.'
@@ -1464,6 +1741,8 @@ Lint/Loop:
1464
1741
  StyleGuide: '#loop-with-break'
1465
1742
  Enabled: true
1466
1743
  VersionAdded: '0.9'
1744
+ VersionChanged: '1.3'
1745
+ Safe: false
1467
1746
 
1468
1747
  Lint/MissingCopEnableDirective:
1469
1748
  Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
@@ -1478,11 +1757,25 @@ Lint/MissingCopEnableDirective:
1478
1757
  # .inf for any size
1479
1758
  MaximumRangeSize: .inf
1480
1759
 
1760
+ Lint/MissingSuper:
1761
+ Description: >-
1762
+ This cop checks for the presence of constructors and lifecycle callbacks
1763
+ without calls to `super`'.
1764
+ Enabled: true
1765
+ VersionAdded: '0.89'
1766
+ VersionChanged: '1.4'
1767
+
1768
+ Lint/MixedRegexpCaptureTypes:
1769
+ Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
1770
+ Enabled: true
1771
+ VersionAdded: '0.85'
1772
+
1481
1773
  Lint/MultipleComparison:
1482
1774
  Description: "Use `&&` operator to compare multiple values."
1483
1775
  Enabled: true
1484
1776
  VersionAdded: '0.47'
1485
- VersionChanged: '0.77'
1777
+ VersionChanged: '1.1'
1778
+ AllowMethodComparison: true
1486
1779
 
1487
1780
  Lint/NestedMethodDefinition:
1488
1781
  Description: 'Do not use nested method definitions.'
@@ -1502,6 +1795,11 @@ Lint/NextWithoutAccumulator:
1502
1795
  Enabled: true
1503
1796
  VersionAdded: '0.36'
1504
1797
 
1798
+ Lint/NoReturnInBeginEndBlocks:
1799
+ Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
1800
+ Enabled: true
1801
+ VersionAdded: '1.2'
1802
+
1505
1803
  Lint/NonDeterministicRequireOrder:
1506
1804
  Description: 'Always sort arrays returned by Dir.glob when requiring files.'
1507
1805
  Enabled: true
@@ -1517,14 +1815,35 @@ Lint/NumberConversion:
1517
1815
  Description: 'Checks unsafe usage of number conversion methods.'
1518
1816
  Enabled: false
1519
1817
  VersionAdded: '0.53'
1520
- VersionChanged: '0.70'
1818
+ VersionChanged: '1.1'
1521
1819
  SafeAutoCorrect: false
1820
+ IgnoredMethods: []
1821
+ IgnoredClasses:
1822
+ - Time
1823
+ - DateTime
1824
+
1825
+ Lint/NumberedParameterAssignment:
1826
+ Description: 'Checks for uses of numbered parameter assignment.'
1827
+ Enabled: true
1828
+ VersionAdded: '1.9'
1829
+
1830
+ Lint/OrAssignmentToConstant:
1831
+ Description: 'Checks unintended or-assignment to constant.'
1832
+ Enabled: true
1833
+ Safe: false
1834
+ VersionAdded: '1.9'
1522
1835
 
1523
1836
  Lint/OrderedMagicComments:
1524
1837
  Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
1525
1838
  Enabled: true
1526
1839
  VersionAdded: '0.53'
1527
1840
 
1841
+ Lint/OutOfRangeRegexpRef:
1842
+ Description: 'Checks for out of range reference for Regexp because it always returns nil.'
1843
+ Enabled: true
1844
+ Safe: false
1845
+ VersionAdded: '0.89'
1846
+
1528
1847
  Lint/ParenthesesAsGroupedExpression:
1529
1848
  Description: >-
1530
1849
  Checks for method calls with a space before the opening
@@ -1532,6 +1851,7 @@ Lint/ParenthesesAsGroupedExpression:
1532
1851
  StyleGuide: '#parens-no-spaces'
1533
1852
  Enabled: true
1534
1853
  VersionAdded: '0.12'
1854
+ VersionChanged: '0.83'
1535
1855
 
1536
1856
  Lint/PercentStringArray:
1537
1857
  Description: >-
@@ -1546,6 +1866,16 @@ Lint/PercentSymbolArray:
1546
1866
  Enabled: true
1547
1867
  VersionAdded: '0.41'
1548
1868
 
1869
+ Lint/RaiseException:
1870
+ Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
1871
+ StyleGuide: '#raise-exception'
1872
+ Enabled: true
1873
+ Safe: false
1874
+ VersionAdded: '0.81'
1875
+ VersionChanged: '0.86'
1876
+ AllowedImplicitNamespaces:
1877
+ - 'Gem'
1878
+
1549
1879
  Lint/RandOne:
1550
1880
  Description: >-
1551
1881
  Checks for `rand(1)` calls. Such calls always return `0`
@@ -1566,15 +1896,35 @@ Lint/RedundantCopEnableDirective:
1566
1896
  Enabled: true
1567
1897
  VersionAdded: '0.76'
1568
1898
 
1899
+ Lint/RedundantDirGlobSort:
1900
+ Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
1901
+ Enabled: true
1902
+ VersionAdded: '1.8'
1903
+
1569
1904
  Lint/RedundantRequireStatement:
1570
1905
  Description: 'Checks for unnecessary `require` statement.'
1571
1906
  Enabled: true
1572
1907
  VersionAdded: '0.76'
1573
1908
 
1909
+ Lint/RedundantSafeNavigation:
1910
+ Description: 'Checks for redundant safe navigation calls.'
1911
+ Enabled: true
1912
+ VersionAdded: '0.93'
1913
+ AllowedMethods:
1914
+ - instance_of?
1915
+ - kind_of?
1916
+ - is_a?
1917
+ - eql?
1918
+ - respond_to?
1919
+ - equal?
1920
+ Safe: false
1921
+
1574
1922
  Lint/RedundantSplatExpansion:
1575
1923
  Description: 'Checks for splat unnecessarily being called on literals.'
1576
1924
  Enabled: true
1577
- VersionChanged: '0.76'
1925
+ VersionAdded: '0.76'
1926
+ VersionChanged: '1.7'
1927
+ AllowPercentLiteralArrayArgument: true
1578
1928
 
1579
1929
  Lint/RedundantStringCoercion:
1580
1930
  Description: 'Checks for Object#to_s usage in string interpolation.'
@@ -1599,6 +1949,7 @@ Lint/RegexpAsCondition:
1599
1949
  The regexp literal matches `$_` implicitly.
1600
1950
  Enabled: true
1601
1951
  VersionAdded: '0.51'
1952
+ VersionChanged: '0.86'
1602
1953
 
1603
1954
  Lint/RequireParentheses:
1604
1955
  Description: >-
@@ -1612,7 +1963,7 @@ Lint/RescueException:
1612
1963
  StyleGuide: '#no-blind-rescues'
1613
1964
  Enabled: true
1614
1965
  VersionAdded: '0.9'
1615
- VersionChanged: '0.27.1'
1966
+ VersionChanged: '0.27'
1616
1967
 
1617
1968
  Lint/RescueType:
1618
1969
  Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
@@ -1635,6 +1986,7 @@ Lint/SafeNavigationChain:
1635
1986
  - presence
1636
1987
  - try
1637
1988
  - try!
1989
+ - in?
1638
1990
 
1639
1991
  Lint/SafeNavigationConsistency:
1640
1992
  Description: >-
@@ -1655,6 +2007,7 @@ Lint/SafeNavigationWithEmpty:
1655
2007
  Description: 'Avoid `foo&.empty?` in conditionals.'
1656
2008
  Enabled: true
1657
2009
  VersionAdded: '0.62'
2010
+ VersionChanged: '0.87'
1658
2011
 
1659
2012
  Lint/ScriptPermission:
1660
2013
  Description: 'Grant script file execute permission.'
@@ -1662,6 +2015,11 @@ Lint/ScriptPermission:
1662
2015
  VersionAdded: '0.49'
1663
2016
  VersionChanged: '0.50'
1664
2017
 
2018
+ Lint/SelfAssignment:
2019
+ Description: 'Checks for self-assignments.'
2020
+ Enabled: true
2021
+ VersionAdded: '0.89'
2022
+
1665
2023
  Lint/SendWithMixinArgument:
1666
2024
  Description: 'Checks for `send` method when using mixin.'
1667
2025
  Enabled: true
@@ -1688,23 +2046,58 @@ Lint/ShadowingOuterLocalVariable:
1688
2046
  Enabled: true
1689
2047
  VersionAdded: '0.9'
1690
2048
 
2049
+ Lint/StructNewOverride:
2050
+ Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
2051
+ Enabled: true
2052
+ VersionAdded: '0.81'
2053
+
1691
2054
  Lint/SuppressedException:
1692
2055
  Description: "Don't suppress exceptions."
1693
2056
  StyleGuide: '#dont-hide-exceptions'
1694
2057
  Enabled: true
1695
- AllowComments: false
2058
+ AllowComments: true
2059
+ AllowNil: true
1696
2060
  VersionAdded: '0.9'
1697
- VersionChanged: '0.77'
2061
+ VersionChanged: '1.12'
2062
+
2063
+ Lint/SymbolConversion:
2064
+ Description: 'Checks for unnecessary symbol conversions.'
2065
+ Enabled: true
2066
+ VersionAdded: '1.9'
2067
+ EnforcedStyle: strict
2068
+ SupportedStyles:
2069
+ - strict
2070
+ - consistent
1698
2071
 
1699
2072
  Lint/Syntax:
1700
- Description: 'Checks syntax error.'
2073
+ Description: 'Checks for syntax errors.'
1701
2074
  Enabled: true
1702
2075
  VersionAdded: '0.9'
1703
2076
 
2077
+ Lint/ToEnumArguments:
2078
+ Description: 'This cop ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
2079
+ Enabled: true
2080
+ VersionAdded: '1.1'
1704
2081
 
1705
2082
  Lint/ToJSON:
1706
2083
  Description: 'Ensure #to_json includes an optional argument.'
1707
2084
  Enabled: true
2085
+ VersionAdded: '0.66'
2086
+
2087
+ Lint/TopLevelReturnWithArgument:
2088
+ Description: 'This cop detects top level return statements with argument.'
2089
+ Enabled: true
2090
+ VersionAdded: '0.89'
2091
+
2092
+ Lint/TrailingCommaInAttributeDeclaration:
2093
+ Description: 'This cop checks for trailing commas in attribute declarations.'
2094
+ Enabled: true
2095
+ VersionAdded: '0.90'
2096
+
2097
+ Lint/TripleQuotes:
2098
+ Description: 'Checks for useless triple quote constructs.'
2099
+ Enabled: true
2100
+ VersionAdded: '1.9'
1708
2101
 
1709
2102
  Lint/UnderscorePrefixedVariableName:
1710
2103
  Description: 'Do not use prefix `_` for a variable that is used.'
@@ -1712,16 +2105,49 @@ Lint/UnderscorePrefixedVariableName:
1712
2105
  VersionAdded: '0.21'
1713
2106
  AllowKeywordBlockArguments: false
1714
2107
 
2108
+ Lint/UnexpectedBlockArity:
2109
+ Description: 'Looks for blocks that have fewer arguments that the calling method expects.'
2110
+ Enabled: true
2111
+ Safe: false
2112
+ VersionAdded: '1.5'
2113
+ Methods:
2114
+ chunk_while: 2
2115
+ each_with_index: 2
2116
+ each_with_object: 2
2117
+ inject: 2
2118
+ max: 2
2119
+ min: 2
2120
+ minmax: 2
2121
+ reduce: 2
2122
+ slice_when: 2
2123
+ sort: 2
2124
+
1715
2125
  Lint/UnifiedInteger:
1716
2126
  Description: 'Use Integer instead of Fixnum or Bignum.'
1717
2127
  Enabled: true
1718
2128
  VersionAdded: '0.43'
1719
2129
 
2130
+ Lint/UnmodifiedReduceAccumulator:
2131
+ Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
2132
+ Enabled: true
2133
+ VersionAdded: '1.1'
2134
+ VersionChanged: '1.5'
2135
+
1720
2136
  Lint/UnreachableCode:
1721
2137
  Description: 'Unreachable code.'
1722
2138
  Enabled: true
1723
2139
  VersionAdded: '0.9'
1724
2140
 
2141
+ Lint/UnreachableLoop:
2142
+ Description: 'This cop checks for loops that will have at most one iteration.'
2143
+ Enabled: true
2144
+ VersionAdded: '0.89'
2145
+ VersionChanged: '1.7'
2146
+ IgnoredPatterns:
2147
+ # RSpec uses `times` in its message expectations
2148
+ # eg. `exactly(2).times`
2149
+ - !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
2150
+
1725
2151
  Lint/UnusedBlockArgument:
1726
2152
  Description: 'Checks for unused block arguments.'
1727
2153
  StyleGuide: '#underscore-unused-vars'
@@ -1736,9 +2162,10 @@ Lint/UnusedMethodArgument:
1736
2162
  StyleGuide: '#underscore-unused-vars'
1737
2163
  Enabled: true
1738
2164
  VersionAdded: '0.21'
1739
- VersionChanged: '0.35'
2165
+ VersionChanged: '0.81'
1740
2166
  AllowUnusedKeywordArguments: false
1741
2167
  IgnoreEmptyMethods: true
2168
+ IgnoreNotImplementedMethods: true
1742
2169
 
1743
2170
  Lint/UriEscapeUnescape:
1744
2171
  Description: >-
@@ -1760,7 +2187,7 @@ Lint/UselessAccessModifier:
1760
2187
  Description: 'Checks for useless access modifiers.'
1761
2188
  Enabled: true
1762
2189
  VersionAdded: '0.20'
1763
- VersionChanged: '0.47'
2190
+ VersionChanged: '0.83'
1764
2191
  ContextCreatingMethods: []
1765
2192
  MethodCreatingMethods: []
1766
2193
 
@@ -1770,20 +2197,31 @@ Lint/UselessAssignment:
1770
2197
  Enabled: true
1771
2198
  VersionAdded: '0.11'
1772
2199
 
1773
- Lint/UselessComparison:
1774
- Description: 'Checks for comparison of something with itself.'
1775
- Enabled: true
1776
- VersionAdded: '0.11'
1777
-
1778
2200
  Lint/UselessElseWithoutRescue:
1779
2201
  Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
1780
2202
  Enabled: true
1781
2203
  VersionAdded: '0.17'
1782
2204
 
2205
+ Lint/UselessMethodDefinition:
2206
+ Description: 'Checks for useless method definitions.'
2207
+ Enabled: true
2208
+ VersionAdded: '0.90'
2209
+ Safe: false
2210
+ AllowComments: true
2211
+
1783
2212
  Lint/UselessSetterCall:
1784
2213
  Description: 'Checks for useless setter call to a local variable.'
1785
2214
  Enabled: true
2215
+ SafeAutoCorrect: false
1786
2216
  VersionAdded: '0.13'
2217
+ VersionChanged: '1.2'
2218
+ Safe: false
2219
+
2220
+ Lint/UselessTimes:
2221
+ Description: 'Checks for useless `Integer#times` calls.'
2222
+ Enabled: true
2223
+ VersionAdded: '0.91'
2224
+ Safe: false
1787
2225
 
1788
2226
  Lint/Void:
1789
2227
  Description: 'Possible use of operator/literal/variable in void context.'
@@ -1802,19 +2240,22 @@ Metrics/AbcSize:
1802
2240
  - https://en.wikipedia.org/wiki/ABC_Software_Metric
1803
2241
  Enabled: true
1804
2242
  VersionAdded: '0.27'
1805
- VersionChanged: '0.66'
2243
+ VersionChanged: '1.5'
1806
2244
  # The ABC size is a calculated magnitude, so this number can be an Integer or
1807
2245
  # a Float.
2246
+ IgnoredMethods: []
2247
+ CountRepeatedAttributes: true
1808
2248
  Max: 30
1809
2249
 
1810
2250
  Metrics/BlockLength:
1811
2251
  Description: 'Avoid long blocks with many lines.'
1812
2252
  Enabled: true
1813
2253
  VersionAdded: '0.44'
1814
- VersionChanged: '0.66'
2254
+ VersionChanged: '1.5'
1815
2255
  CountComments: false # count full line comments?
1816
2256
  Max: 50
1817
- ExcludedMethods:
2257
+ CountAsOne: []
2258
+ IgnoredMethods:
1818
2259
  # By default, exclude the `#refine` method, as it tends to have larger
1819
2260
  # associated blocks.
1820
2261
  - refine
@@ -1834,8 +2275,10 @@ Metrics/ClassLength:
1834
2275
  Description: 'Avoid classes longer than 100 lines of code.'
1835
2276
  Enabled: true
1836
2277
  VersionAdded: '0.25'
2278
+ VersionChanged: '0.87'
1837
2279
  CountComments: false # count full line comments?
1838
2280
  Max: 300
2281
+ CountAsOne: []
1839
2282
 
1840
2283
  # Avoid complex methods.
1841
2284
  Metrics/CyclomaticComplexity:
@@ -1844,6 +2287,8 @@ Metrics/CyclomaticComplexity:
1844
2287
  of test cases needed to validate a method.
1845
2288
  Enabled: true
1846
2289
  VersionAdded: '0.25'
2290
+ VersionChanged: '0.81'
2291
+ IgnoredMethods: []
1847
2292
  Max: 10
1848
2293
 
1849
2294
  Metrics/MethodLength:
@@ -1851,25 +2296,30 @@ Metrics/MethodLength:
1851
2296
  StyleGuide: '#short-methods'
1852
2297
  Enabled: true
1853
2298
  VersionAdded: '0.25'
1854
- VersionChanged: '0.59.2'
2299
+ VersionChanged: '1.5'
1855
2300
  CountComments: false # count full line comments?
1856
2301
  Max: 50
1857
- ExcludedMethods: []
2302
+ CountAsOne: []
2303
+ IgnoredMethods: []
1858
2304
 
1859
2305
  Metrics/ModuleLength:
1860
2306
  Description: 'Avoid modules longer than 100 lines of code.'
1861
2307
  Enabled: true
1862
2308
  VersionAdded: '0.31'
2309
+ VersionChanged: '0.87'
1863
2310
  CountComments: false # count full line comments?
1864
2311
  Max: 300
2312
+ CountAsOne: []
1865
2313
 
1866
2314
  Metrics/ParameterLists:
1867
2315
  Description: 'Avoid parameter lists longer than three or four parameters.'
1868
2316
  StyleGuide: '#too-many-params'
1869
2317
  Enabled: true
1870
2318
  VersionAdded: '0.25'
2319
+ VersionChanged: '1.5'
1871
2320
  Max: 5
1872
2321
  CountKeywordArgs: true
2322
+ MaxOptionalParameters: 3
1873
2323
 
1874
2324
  Metrics/PerceivedComplexity:
1875
2325
  Description: >-
@@ -1877,7 +2327,9 @@ Metrics/PerceivedComplexity:
1877
2327
  human reader.
1878
2328
  Enabled: true
1879
2329
  VersionAdded: '0.25'
1880
- Max: 7
2330
+ VersionChanged: '0.81'
2331
+ IgnoredMethods: []
2332
+ Max: 8
1881
2333
 
1882
2334
  ################## Migration #############################
1883
2335
 
@@ -1885,7 +2337,8 @@ Migration/DepartmentName:
1885
2337
  Description: >-
1886
2338
  Check that cop names in rubocop:disable (etc) comments are
1887
2339
  given with department name.
1888
- Enabled: false
2340
+ Enabled: true
2341
+ VersionAdded: '0.75'
1889
2342
 
1890
2343
  #################### Naming ##############################
1891
2344
 
@@ -1896,16 +2349,19 @@ Naming/AccessorMethodName:
1896
2349
  VersionAdded: '0.50'
1897
2350
 
1898
2351
  Naming/AsciiIdentifiers:
1899
- Description: 'Use only ascii symbols in identifiers.'
2352
+ Description: 'Use only ascii symbols in identifiers and constants.'
1900
2353
  StyleGuide: '#english-identifiers'
1901
2354
  Enabled: true
1902
2355
  VersionAdded: '0.50'
2356
+ VersionChanged: '0.87'
2357
+ AsciiConstants: true
1903
2358
 
1904
2359
  Naming/BinaryOperatorParameterName:
1905
2360
  Description: 'When defining binary operators, name the argument other.'
1906
2361
  StyleGuide: '#other-arg'
1907
2362
  Enabled: true
1908
2363
  VersionAdded: '0.50'
2364
+ VersionChanged: '1.2'
1909
2365
 
1910
2366
  Naming/BlockParameterName:
1911
2367
  Description: >-
@@ -1927,6 +2383,11 @@ Naming/ClassAndModuleCamelCase:
1927
2383
  StyleGuide: '#camelcase-classes'
1928
2384
  Enabled: true
1929
2385
  VersionAdded: '0.50'
2386
+ VersionChanged: '0.85'
2387
+ # Allowed class/module names can be specified here.
2388
+ # These can be full or part of the name.
2389
+ AllowedNames:
2390
+ - module_parent
1930
2391
 
1931
2392
  Naming/ConstantName:
1932
2393
  Description: 'Constants should use SCREAMING_SNAKE_CASE.'
@@ -1947,6 +2408,10 @@ Naming/FileName:
1947
2408
  # It further expects it to be nested inside modules which match the names
1948
2409
  # of subdirectories in its path.
1949
2410
  ExpectMatchingDefinition: false
2411
+ # When `false`, changes the behavior of ExpectMatchingDefinition to match only
2412
+ # whether each source file's class or module name matches the file name --
2413
+ # not whether the nested module hierarchy matches the subdirectory path.
2414
+ CheckDefinitionPathHierarchy: true
1950
2415
  # If non-`nil`, expect all source file names to match the following regex.
1951
2416
  # Only the file name itself is matched, not the entire file path.
1952
2417
  # Use anchors as necessary if you want to match the entire name rather than
@@ -2003,6 +2468,7 @@ Naming/HeredocDelimiterCase:
2003
2468
  StyleGuide: '#heredoc-delimiters'
2004
2469
  Enabled: true
2005
2470
  VersionAdded: '0.50'
2471
+ VersionChanged: '1.2'
2006
2472
  EnforcedStyle: uppercase
2007
2473
  SupportedStyles:
2008
2474
  - lowercase
@@ -2021,12 +2487,13 @@ Naming/MemoizedInstanceVariableName:
2021
2487
  Memoized method name should match memo instance variable name.
2022
2488
  Enabled: true
2023
2489
  VersionAdded: '0.53'
2024
- VersionChanged: '0.58'
2490
+ VersionChanged: '1.2'
2025
2491
  EnforcedStyleForLeadingUnderscores: disallowed
2026
2492
  SupportedStylesForLeadingUnderscores:
2027
2493
  - disallowed
2028
2494
  - required
2029
2495
  - optional
2496
+ Safe: false
2030
2497
 
2031
2498
  Naming/MethodName:
2032
2499
  Description: 'Use the configured style when naming methods.'
@@ -2057,16 +2524,18 @@ Naming/MethodParameterName:
2057
2524
  AllowNamesEndingInNumbers: true
2058
2525
  # Allowed names that will not register an offense
2059
2526
  AllowedNames:
2060
- - io
2061
- - id
2062
- - to
2527
+ - at
2063
2528
  - by
2064
- - 'on'
2529
+ - db
2530
+ - id
2065
2531
  - in
2066
- - at
2532
+ - io
2067
2533
  - ip
2068
- - db
2534
+ - of
2535
+ - 'on'
2069
2536
  - os
2537
+ - pp
2538
+ - to
2070
2539
  # Forbidden names that will register an offense
2071
2540
  ForbiddenNames: []
2072
2541
 
@@ -2111,20 +2580,33 @@ Naming/VariableName:
2111
2580
  StyleGuide: '#snake-case-symbols-methods-vars'
2112
2581
  Enabled: true
2113
2582
  VersionAdded: '0.50'
2583
+ VersionChanged: '1.8'
2114
2584
  EnforcedStyle: snake_case
2115
2585
  SupportedStyles:
2116
2586
  - snake_case
2117
2587
  - camelCase
2588
+ AllowedIdentifiers: []
2118
2589
 
2119
2590
  Naming/VariableNumber:
2120
- Description: 'Use the configured style when numbering variables.'
2591
+ Description: 'Use the configured style when numbering symbols, methods and variables.'
2592
+ StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
2121
2593
  Enabled: true
2122
2594
  VersionAdded: '0.50'
2595
+ VersionChanged: '1.4'
2123
2596
  EnforcedStyle: snake_case
2124
2597
  SupportedStyles:
2125
2598
  - snake_case
2126
2599
  - normalcase
2127
2600
  - non_integer
2601
+ CheckMethodNames: true
2602
+ CheckSymbols: true
2603
+ AllowedIdentifiers:
2604
+ - capture3 # Open3.capture3
2605
+ - iso8601 # Time#iso8601
2606
+ - rfc1123_date # CGI.rfc1123_date
2607
+ - rfc822 # Time#rfc822
2608
+ - rfc2822 # Time#rfc2822
2609
+ - rfc3339 # DateTime.rfc3339
2128
2610
 
2129
2611
  #################### Security ##############################
2130
2612
 
@@ -2137,7 +2619,7 @@ Security/JSONLoad:
2137
2619
  Description: >-
2138
2620
  Prefer usage of `JSON.parse` over `JSON.load` due to potential
2139
2621
  security issues. See reference for more information.
2140
- Reference: 'https://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
2622
+ Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
2141
2623
  Enabled: true
2142
2624
  VersionAdded: '0.43'
2143
2625
  VersionChanged: '0.44'
@@ -2150,21 +2632,22 @@ Security/MarshalLoad:
2150
2632
  Description: >-
2151
2633
  Avoid using of `Marshal.load` or `Marshal.restore` due to potential
2152
2634
  security issues. See reference for more information.
2153
- Reference: 'https://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
2635
+ Reference: 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
2154
2636
  Enabled: true
2155
2637
  VersionAdded: '0.47'
2156
2638
 
2157
2639
  Security/Open:
2158
- Description: 'The use of Kernel#open represents a serious security risk.'
2640
+ Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
2159
2641
  Enabled: true
2160
2642
  VersionAdded: '0.53'
2643
+ VersionChanged: '1.0'
2161
2644
  Safe: false
2162
2645
 
2163
2646
  Security/YAMLLoad:
2164
2647
  Description: >-
2165
2648
  Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
2166
2649
  security issues. See reference for more information.
2167
- Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
2650
+ Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
2168
2651
  Enabled: true
2169
2652
  VersionAdded: '0.47'
2170
2653
  SafeAutoCorrect: false
@@ -2175,10 +2658,23 @@ Style/AccessModifierDeclarations:
2175
2658
  Description: 'Checks style of how access modifiers are used.'
2176
2659
  Enabled: true
2177
2660
  VersionAdded: '0.57'
2661
+ VersionChanged: '0.81'
2178
2662
  EnforcedStyle: group
2179
2663
  SupportedStyles:
2180
2664
  - inline
2181
2665
  - group
2666
+ AllowModifiersOnSymbols: true
2667
+
2668
+ Style/AccessorGrouping:
2669
+ Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
2670
+ Enabled: true
2671
+ VersionAdded: '0.87'
2672
+ EnforcedStyle: grouped
2673
+ SupportedStyles:
2674
+ # separated: each accessor goes in a separate statement.
2675
+ # grouped: accessors are grouped into a single statement.
2676
+ - separated
2677
+ - grouped
2182
2678
 
2183
2679
  Style/Alias:
2184
2680
  Description: 'Use alias instead of alias_method.'
@@ -2204,6 +2700,22 @@ Style/AndOr:
2204
2700
  - always
2205
2701
  - conditionals
2206
2702
 
2703
+ Style/ArgumentsForwarding:
2704
+ Description: 'Use arguments forwarding.'
2705
+ StyleGuide: '#arguments-forwarding'
2706
+ Enabled: true
2707
+ AllowOnlyRestArgument: true
2708
+ VersionAdded: '1.1'
2709
+
2710
+ Style/ArrayCoercion:
2711
+ Description: >-
2712
+ Use Array() instead of explicit Array check or [*var], when dealing
2713
+ with a variable you want to treat as an Array, but you're not certain it's an array.
2714
+ StyleGuide: '#array-coercion'
2715
+ Safe: false
2716
+ Enabled: true
2717
+ VersionAdded: '0.88'
2718
+
2207
2719
  Style/ArrayJoin:
2208
2720
  Description: 'Use Array#join instead of Array#*.'
2209
2721
  StyleGuide: '#array-join'
@@ -2217,7 +2729,8 @@ Style/AsciiComments:
2217
2729
  Enabled: true
2218
2730
  VersionAdded: '0.9'
2219
2731
  VersionChanged: '0.52'
2220
- AllowedChars: []
2732
+ AllowedChars:
2733
+ - ©
2221
2734
 
2222
2735
  Style/Attr:
2223
2736
  Description: 'Checks for uses of Module#attr.'
@@ -2247,6 +2760,13 @@ Style/BeginBlock:
2247
2760
  Enabled: true
2248
2761
  VersionAdded: '0.9'
2249
2762
 
2763
+ Style/BisectedAttrAccessor:
2764
+ Description: >-
2765
+ Checks for places where `attr_reader` and `attr_writer`
2766
+ for the same method can be combined into single `attr_accessor`.
2767
+ Enabled: true
2768
+ VersionAdded: '0.87'
2769
+
2250
2770
  Style/BlockComments:
2251
2771
  Description: 'Do not use block comments.'
2252
2772
  StyleGuide: '#no-block-comments'
@@ -2357,30 +2877,35 @@ Style/BlockDelimiters:
2357
2877
  # # also good
2358
2878
  # collection.each do |element| puts element end
2359
2879
  AllowBracesOnProceduralOneLiners: false
2360
-
2361
- Style/BracesAroundHashParameters:
2362
- Description: 'Enforce braces style around hash parameters.'
2363
- Enabled: true
2364
- VersionAdded: '0.14.1'
2365
- VersionChanged: '0.28'
2366
- EnforcedStyle: no_braces
2367
- SupportedStyles:
2368
- # The `braces` style enforces braces around all method parameters that are
2369
- # hashes.
2370
- - braces
2371
- # The `no_braces` style checks that the last parameter doesn't have braces
2372
- # around it.
2373
- - no_braces
2374
- # The `context_dependent` style checks that the last parameter doesn't have
2375
- # braces around it, but requires braces if the second to last parameter is
2376
- # also a hash literal.
2377
- - context_dependent
2880
+ # The BracesRequiredMethods overrides all other configurations except
2881
+ # IgnoredMethods. It can be used to enforce that all blocks for specific
2882
+ # methods use braces. For example, you can use this to enforce Sorbet
2883
+ # signatures use braces even when the rest of your codebase enforces
2884
+ # the `line_count_based` style.
2885
+ BracesRequiredMethods: []
2378
2886
 
2379
2887
  Style/CaseEquality:
2380
2888
  Description: 'Avoid explicit use of the case equality operator(===).'
2381
2889
  StyleGuide: '#no-case-equality'
2382
2890
  Enabled: true
2383
2891
  VersionAdded: '0.9'
2892
+ VersionChanged: '0.89'
2893
+ # If AllowOnConstant is enabled, the cop will ignore violations when the receiver of
2894
+ # the case equality operator is a constant.
2895
+ #
2896
+ # # bad
2897
+ # /string/ === "string"
2898
+ #
2899
+ # # good
2900
+ # String === "string"
2901
+ AllowOnConstant: false
2902
+
2903
+ Style/CaseLikeIf:
2904
+ Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
2905
+ StyleGuide: '#case-vs-if-else'
2906
+ Enabled: true
2907
+ Safe: false
2908
+ VersionAdded: '0.88'
2384
2909
 
2385
2910
  Style/CharacterLiteral:
2386
2911
  Description: 'Checks for uses of character literals.'
@@ -2397,7 +2922,6 @@ Style/ClassAndModuleChildren:
2397
2922
  # have the knowledge to perform either operation safely and thus requires
2398
2923
  # manual oversight.
2399
2924
  SafeAutoCorrect: false
2400
- AutoCorrect: false
2401
2925
  Enabled: true
2402
2926
  VersionAdded: '0.19'
2403
2927
  #
@@ -2421,6 +2945,7 @@ Style/ClassAndModuleChildren:
2421
2945
 
2422
2946
  Style/ClassCheck:
2423
2947
  Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
2948
+ StyleGuide: '#is-a-vs-kind-of'
2424
2949
  Enabled: true
2425
2950
  VersionAdded: '0.24'
2426
2951
  EnforcedStyle: is_a?
@@ -2428,6 +2953,16 @@ Style/ClassCheck:
2428
2953
  - is_a?
2429
2954
  - kind_of?
2430
2955
 
2956
+ Style/ClassEqualityComparison:
2957
+ Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
2958
+ StyleGuide: '#instance-of-vs-class-comparison'
2959
+ Enabled: true
2960
+ VersionAdded: '0.93'
2961
+ IgnoredMethods:
2962
+ - ==
2963
+ - equal?
2964
+ - eql?
2965
+
2431
2966
  Style/ClassMethods:
2432
2967
  Description: 'Use self when defining module/class methods.'
2433
2968
  StyleGuide: '#def-self-class-methods'
@@ -2435,19 +2970,36 @@ Style/ClassMethods:
2435
2970
  VersionAdded: '0.9'
2436
2971
  VersionChanged: '0.20'
2437
2972
 
2973
+ Style/ClassMethodsDefinitions:
2974
+ Description: 'Enforces using `def self.method_name` or `class << self` to define class methods.'
2975
+ StyleGuide: '#def-self-class-methods'
2976
+ Enabled: false
2977
+ VersionAdded: '0.89'
2978
+ EnforcedStyle: def_self
2979
+ SupportedStyles:
2980
+ - def_self
2981
+ - self_class
2982
+
2438
2983
  Style/ClassVars:
2439
2984
  Description: 'Avoid the use of class variables.'
2440
2985
  StyleGuide: '#no-class-vars'
2441
2986
  Enabled: true
2442
2987
  VersionAdded: '0.13'
2443
2988
 
2989
+ Style/CollectionCompact:
2990
+ Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
2991
+ Enabled: true
2992
+ Safe: false
2993
+ VersionAdded: '1.2'
2994
+ VersionChanged: '1.3'
2995
+
2444
2996
  # Align with the style guide.
2445
2997
  Style/CollectionMethods:
2446
2998
  Description: 'Preferred collection methods.'
2447
- StyleGuide: '#map-find-select-reduce-size'
2999
+ StyleGuide: '#map-find-select-reduce-include-size'
2448
3000
  Enabled: false
2449
3001
  VersionAdded: '0.9'
2450
- VersionChanged: '0.27'
3002
+ VersionChanged: '1.7'
2451
3003
  Safe: false
2452
3004
  # Mapping from undesired method to desired method
2453
3005
  # e.g. to use `detect` over `find`:
@@ -2461,6 +3013,12 @@ Style/CollectionMethods:
2461
3013
  inject: 'reduce'
2462
3014
  detect: 'find'
2463
3015
  find_all: 'select'
3016
+ member?: 'include?'
3017
+ # Methods in this array accept a final symbol as an implicit block
3018
+ # eg. `inject(:+)`
3019
+ MethodsAcceptingSymbol:
3020
+ - inject
3021
+ - reduce
2464
3022
 
2465
3023
  Style/ColonMethodCall:
2466
3024
  Description: 'Do not use :: for method call.'
@@ -2474,6 +3032,14 @@ Style/ColonMethodDefinition:
2474
3032
  Enabled: true
2475
3033
  VersionAdded: '0.52'
2476
3034
 
3035
+ Style/CombinableLoops:
3036
+ Description: >-
3037
+ Checks for places where multiple consecutive loops over the same data
3038
+ can be combined into a single loop.
3039
+ Enabled: true
3040
+ Safe: false
3041
+ VersionAdded: '0.90'
3042
+
2477
3043
  Style/CommandLiteral:
2478
3044
  Description: 'Use `` or %x around command literals.'
2479
3045
  StyleGuide: '#percent-x'
@@ -2495,22 +3061,24 @@ Style/CommandLiteral:
2495
3061
  Style/CommentAnnotation:
2496
3062
  Description: >-
2497
3063
  Checks formatting of special comments
2498
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
3064
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE).
2499
3065
  StyleGuide: '#annotate-keywords'
2500
3066
  Enabled: true
2501
3067
  VersionAdded: '0.10'
2502
- VersionChanged: '0.31'
3068
+ VersionChanged: '1.3'
2503
3069
  Keywords:
2504
3070
  - TODO
2505
3071
  - FIXME
2506
3072
  - OPTIMIZE
2507
3073
  - HACK
2508
3074
  - REVIEW
3075
+ - NOTE
2509
3076
 
2510
3077
  Style/CommentedKeyword:
2511
3078
  Description: 'Do not place comments on the same line as certain keywords.'
2512
3079
  Enabled: true
2513
3080
  VersionAdded: '0.51'
3081
+ VersionChanged: '1.7'
2514
3082
 
2515
3083
  Style/ConditionalAssignment:
2516
3084
  Description: >-
@@ -2539,6 +3107,8 @@ Style/ConstantVisibility:
2539
3107
  visibility declarations.
2540
3108
  Enabled: false
2541
3109
  VersionAdded: '0.66'
3110
+ VersionChanged: '1.10'
3111
+ IgnoreModules: false
2542
3112
 
2543
3113
  # Checks that you have put a copyright in a comment before any code.
2544
3114
  #
@@ -2570,7 +3140,8 @@ Style/DateTime:
2570
3140
  StyleGuide: '#date--time'
2571
3141
  Enabled: false
2572
3142
  VersionAdded: '0.51'
2573
- VersionChanged: '0.59'
3143
+ VersionChanged: '0.92'
3144
+ SafeAutoCorrect: false
2574
3145
  AllowCoercion: false
2575
3146
 
2576
3147
  Style/DefWithParentheses:
@@ -2587,10 +3158,28 @@ Style/Dir:
2587
3158
  Enabled: true
2588
3159
  VersionAdded: '0.50'
2589
3160
 
3161
+ Style/DisableCopsWithinSourceCodeDirective:
3162
+ Description: >-
3163
+ Forbids disabling/enabling cops within source code.
3164
+ Enabled: false
3165
+ VersionAdded: '0.82'
3166
+ VersionChanged: '1.9'
3167
+ AllowedCops: []
3168
+
3169
+ Style/DocumentDynamicEvalDefinition:
3170
+ Description: >-
3171
+ When using `class_eval` (or other `eval`) with string interpolation,
3172
+ add a comment block showing its appearance if interpolated.
3173
+ StyleGuide: '#eval-comment-docs'
3174
+ Enabled: false
3175
+ VersionAdded: '1.1'
3176
+ VersionChanged: '1.3'
3177
+
2590
3178
  Style/Documentation:
2591
3179
  Description: 'Document classes and non-namespace modules.'
2592
3180
  Enabled: false
2593
3181
  VersionAdded: '0.9'
3182
+ AllowedConstants: []
2594
3183
  Exclude:
2595
3184
  - 'spec/**/*'
2596
3185
  - 'test/**/*'
@@ -2614,6 +3203,12 @@ Style/DoubleNegation:
2614
3203
  StyleGuide: '#no-bang-bang'
2615
3204
  Enabled: false
2616
3205
  VersionAdded: '0.19'
3206
+ VersionChanged: '1.2'
3207
+ EnforcedStyle: allowed_in_returns
3208
+ SafeAutoCorrect: false
3209
+ SupportedStyles:
3210
+ - allowed_in_returns
3211
+ - forbidden
2617
3212
 
2618
3213
  Style/EachForSimpleLoop:
2619
3214
  Description: >-
@@ -2686,6 +3281,18 @@ Style/EndBlock:
2686
3281
  StyleGuide: '#no-END-blocks'
2687
3282
  Enabled: true
2688
3283
  VersionAdded: '0.9'
3284
+ VersionChanged: '0.81'
3285
+
3286
+ Style/EndlessMethod:
3287
+ Description: 'Avoid the use of multi-lined endless method definitions.'
3288
+ StyleGuide: '#endless-methods'
3289
+ Enabled: true
3290
+ VersionAdded: '1.8'
3291
+ EnforcedStyle: allow_single_line
3292
+ SupportedStyles:
3293
+ - allow_single_line
3294
+ - allow_always
3295
+ - disallow
2689
3296
 
2690
3297
  Style/EvalWithLocation:
2691
3298
  Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
@@ -2704,12 +3311,34 @@ Style/ExpandPathArguments:
2704
3311
  Enabled: true
2705
3312
  VersionAdded: '0.53'
2706
3313
 
3314
+ Style/ExplicitBlockArgument:
3315
+ Description: >-
3316
+ Consider using explicit block argument to avoid writing block literal
3317
+ that just passes its arguments to another block.
3318
+ StyleGuide: '#block-argument'
3319
+ Enabled: true
3320
+ VersionAdded: '0.89'
3321
+ VersionChanged: '1.8'
3322
+
3323
+ Style/ExponentialNotation:
3324
+ Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
3325
+ StyleGuide: '#exponential-notation'
3326
+ Enabled: true
3327
+ VersionAdded: '0.82'
3328
+ EnforcedStyle: scientific
3329
+ SupportedStyles:
3330
+ - scientific
3331
+ - engineering
3332
+ - integral
3333
+
2707
3334
  Style/FloatDivision:
2708
3335
  Description: 'For performing float division, coerce one side only.'
2709
3336
  StyleGuide: '#float-division'
2710
- Reference: 'https://github.com/rubocop-hq/ruby-style-guide/issues/628'
3337
+ Reference: 'https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html'
2711
3338
  Enabled: true
2712
3339
  VersionAdded: '0.72'
3340
+ VersionChanged: '1.9'
3341
+ Safe: false
2713
3342
  EnforcedStyle: single_coerce
2714
3343
  SupportedStyles:
2715
3344
  - left_coerce
@@ -2751,8 +3380,13 @@ Style/FormatStringToken:
2751
3380
  # Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
2752
3381
  - template
2753
3382
  - unannotated
3383
+ # `MaxUnannotatedPlaceholdersAllowed` defines the number of `unannotated`
3384
+ # style token in a format string to be allowed when enforced style is not
3385
+ # `unannotated`.
3386
+ MaxUnannotatedPlaceholdersAllowed: 1
2754
3387
  VersionAdded: '0.49'
2755
- VersionChanged: '0.75'
3388
+ VersionChanged: '1.0'
3389
+ IgnoredMethods: []
2756
3390
 
2757
3391
  Style/FrozenStringLiteralComment:
2758
3392
  Description: >-
@@ -2765,13 +3399,23 @@ Style/FrozenStringLiteralComment:
2765
3399
  SupportedStyles:
2766
3400
  # `always` will always add the frozen string literal comment to a file
2767
3401
  # regardless of the Ruby version or if `freeze` or `<<` are called on a
2768
- # string literal. If you run code against multiple versions of Ruby, it is
2769
- # possible that this will create errors in Ruby 2.3.0+.
3402
+ # string literal. It is possible that this will create errors.
2770
3403
  - always
3404
+ # `always_true` will add the frozen string literal comment to a file,
3405
+ # similarly to the `always` style, but will also change any disabled
3406
+ # comments (e.g. `# frozen_string_literal: false`) to be enabled.
3407
+ - always_true
2771
3408
  # `never` will enforce that the frozen string literal comment does not
2772
3409
  # exist in a file.
2773
3410
  - never
2774
- Safe: false
3411
+ SafeAutoCorrect: false
3412
+
3413
+ Style/GlobalStdStream:
3414
+ Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
3415
+ StyleGuide: '#global-stdout'
3416
+ Enabled: true
3417
+ VersionAdded: '0.89'
3418
+ SafeAutoCorrect: false
2775
3419
 
2776
3420
  Style/GlobalVars:
2777
3421
  Description: 'Do not introduce global variables.'
@@ -2792,6 +3436,49 @@ Style/GuardClause:
2792
3436
  # needs to have to trigger this cop
2793
3437
  MinBodyLength: 1
2794
3438
 
3439
+ Style/HashAsLastArrayItem:
3440
+ Description: >-
3441
+ Checks for presence or absence of braces around hash literal as a last
3442
+ array item depending on configuration.
3443
+ StyleGuide: '#hash-literal-as-last-array-item'
3444
+ Enabled: true
3445
+ VersionAdded: '0.88'
3446
+ EnforcedStyle: braces
3447
+ SupportedStyles:
3448
+ - braces
3449
+ - no_braces
3450
+
3451
+ Style/HashConversion:
3452
+ Description: 'Avoid Hash[] in favor of ary.to_h or literal hashes.'
3453
+ Enabled: true
3454
+ VersionAdded: '1.10'
3455
+ VersionChanged: '1.11'
3456
+ AllowSplatArgument: true
3457
+
3458
+ Style/HashEachMethods:
3459
+ Description: 'Use Hash#each_key and Hash#each_value.'
3460
+ StyleGuide: '#hash-each'
3461
+ Enabled: true
3462
+ VersionAdded: '0.80'
3463
+ Safe: false
3464
+
3465
+ Style/HashExcept:
3466
+ Description: >-
3467
+ Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
3468
+ that can be replaced with `Hash#except` method.
3469
+ Enabled: true
3470
+ VersionAdded: '1.7'
3471
+
3472
+ Style/HashLikeCase:
3473
+ Description: >-
3474
+ Checks for places where `case-when` represents a simple 1:1
3475
+ mapping and can be replaced with a hash lookup.
3476
+ Enabled: true
3477
+ VersionAdded: '0.88'
3478
+ # `MinBranchesCount` defines the number of branches `case` needs to have
3479
+ # to trigger this cop
3480
+ MinBranchesCount: 3
3481
+
2795
3482
  Style/HashSyntax:
2796
3483
  Description: >-
2797
3484
  Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
@@ -2815,6 +3502,20 @@ Style/HashSyntax:
2815
3502
  # Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
2816
3503
  PreferHashRocketsForNonAlnumEndingSymbols: false
2817
3504
 
3505
+ Style/HashTransformKeys:
3506
+ Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
3507
+ Enabled: true
3508
+ VersionAdded: '0.80'
3509
+ VersionChanged: '0.90'
3510
+ Safe: false
3511
+
3512
+ Style/HashTransformValues:
3513
+ Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
3514
+ Enabled: true
3515
+ VersionAdded: '0.80'
3516
+ VersionChanged: '0.90'
3517
+ Safe: false
3518
+
2818
3519
  Style/IdenticalConditionalBranches:
2819
3520
  Description: >-
2820
3521
  Checks that conditional statements do not have an identical
@@ -2828,6 +3529,7 @@ Style/IfInsideElse:
2828
3529
  Enabled: true
2829
3530
  AllowIfModifier: false
2830
3531
  VersionAdded: '0.36'
3532
+ VersionChanged: '1.3'
2831
3533
 
2832
3534
  Style/IfUnlessModifier:
2833
3535
  Description: >-
@@ -2843,12 +3545,22 @@ Style/IfUnlessModifierOfIfUnless:
2843
3545
  Avoid modifier if/unless usage on conditionals.
2844
3546
  Enabled: true
2845
3547
  VersionAdded: '0.39'
3548
+ VersionChanged: '0.87'
3549
+
3550
+ Style/IfWithBooleanLiteralBranches:
3551
+ Description: 'Checks for redundant `if` with boolean literal branches.'
3552
+ Enabled: true
3553
+ VersionAdded: '1.9'
3554
+ SafeAutoCorrect: false
3555
+ AllowedMethods:
3556
+ - nonzero?
2846
3557
 
2847
3558
  Style/IfWithSemicolon:
2848
3559
  Description: 'Do not use if x; .... Use the ternary operator instead.'
2849
3560
  StyleGuide: '#no-semicolon-ifs'
2850
3561
  Enabled: true
2851
3562
  VersionAdded: '0.9'
3563
+ VersionChanged: '0.83'
2852
3564
 
2853
3565
  Style/ImplicitRuntimeError:
2854
3566
  Description: >-
@@ -2858,12 +3570,14 @@ Style/ImplicitRuntimeError:
2858
3570
  VersionAdded: '0.41'
2859
3571
 
2860
3572
  Style/InfiniteLoop:
2861
- Description: 'Use Kernel#loop for infinite loops.'
3573
+ Description: >-
3574
+ Use Kernel#loop for infinite loops.
3575
+ This cop is unsafe in the body may raise a `StopIteration` exception.
3576
+ Safe: false
2862
3577
  StyleGuide: '#infinite-loop'
2863
3578
  Enabled: true
2864
3579
  VersionAdded: '0.26'
2865
3580
  VersionChanged: '0.61'
2866
- SafeAutoCorrect: true
2867
3581
 
2868
3582
  Style/InlineComment:
2869
3583
  Description: 'Avoid trailing inline comments.'
@@ -2901,11 +3615,23 @@ Style/IpAddresses:
2901
3615
  Description: "Don't include literal IP addresses in code."
2902
3616
  Enabled: false
2903
3617
  VersionAdded: '0.58'
2904
- VersionChanged: '0.77'
3618
+ VersionChanged: '0.91'
2905
3619
  # Allow addresses to be permitted
2906
3620
  AllowedAddresses:
2907
3621
  - "::"
2908
3622
  # :: is a valid IPv6 address, but could potentially be legitimately in code
3623
+ Exclude:
3624
+ - '**/*.gemfile'
3625
+ - '**/Gemfile'
3626
+ - '**/gems.rb'
3627
+ - '**/*.gemspec'
3628
+
3629
+ Style/KeywordParametersOrder:
3630
+ Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
3631
+ StyleGuide: '#keyword-parameters-order'
3632
+ Enabled: true
3633
+ VersionAdded: '0.90'
3634
+ VersionChanged: '1.7'
2909
3635
 
2910
3636
  Style/Lambda:
2911
3637
  Description: 'Use the new lambda literal syntax for single-line blocks.'
@@ -2923,7 +3649,7 @@ Style/LambdaCall:
2923
3649
  Description: 'Use lambda.call(...) instead of lambda.(...).'
2924
3650
  StyleGuide: '#proc-call'
2925
3651
  Enabled: true
2926
- VersionAdded: '0.13.1'
3652
+ VersionAdded: '0.13'
2927
3653
  VersionChanged: '0.14'
2928
3654
  EnforcedStyle: call
2929
3655
  SupportedStyles:
@@ -2944,7 +3670,7 @@ Style/MethodCallWithArgsParentheses:
2944
3670
  StyleGuide: '#method-invocation-parens'
2945
3671
  Enabled: false
2946
3672
  VersionAdded: '0.47'
2947
- VersionChanged: '0.61'
3673
+ VersionChanged: '1.7'
2948
3674
  IgnoreMacros: true
2949
3675
  IgnoredMethods: []
2950
3676
  IgnoredPatterns: []
@@ -2952,6 +3678,7 @@ Style/MethodCallWithArgsParentheses:
2952
3678
  AllowParenthesesInMultilineCall: false
2953
3679
  AllowParenthesesInChaining: false
2954
3680
  AllowParenthesesInCamelCaseMethod: false
3681
+ AllowParenthesesInStringInterpolation: false
2955
3682
  EnforcedStyle: require_parentheses
2956
3683
  SupportedStyles:
2957
3684
  - require_parentheses
@@ -2978,19 +3705,13 @@ Style/MethodDefParentheses:
2978
3705
  StyleGuide: '#method-parens'
2979
3706
  Enabled: true
2980
3707
  VersionAdded: '0.16'
2981
- VersionChanged: '0.35'
3708
+ VersionChanged: '1.7'
2982
3709
  EnforcedStyle: require_parentheses
2983
3710
  SupportedStyles:
2984
3711
  - require_parentheses
2985
3712
  - require_no_parentheses
2986
3713
  - require_no_parentheses_except_multiline
2987
3714
 
2988
- Style/MethodMissingSuper:
2989
- Description: Checks for `method_missing` to call `super`.
2990
- StyleGuide: '#no-method-missing'
2991
- Enabled: true
2992
- VersionAdded: '0.56'
2993
-
2994
3715
  Style/MinMax:
2995
3716
  Description: >-
2996
3717
  Use `Enumerable#minmax` instead of `Enumerable#min`
@@ -3053,6 +3774,7 @@ Style/ModuleFunction:
3053
3774
  SupportedStyles:
3054
3775
  - module_function
3055
3776
  - extend_self
3777
+ - forbidden
3056
3778
  Autocorrect: false
3057
3779
  SafeAutoCorrect: false
3058
3780
 
@@ -3089,6 +3811,7 @@ Style/MultilineMethodSignature:
3089
3811
  Description: 'Avoid multi-line method signatures.'
3090
3812
  Enabled: false
3091
3813
  VersionAdded: '0.59'
3814
+ VersionChanged: '1.7'
3092
3815
 
3093
3816
  Style/MultilineTernaryOperator:
3094
3817
  Description: >-
@@ -3097,6 +3820,7 @@ Style/MultilineTernaryOperator:
3097
3820
  StyleGuide: '#no-multiline-ternary'
3098
3821
  Enabled: true
3099
3822
  VersionAdded: '0.9'
3823
+ VersionChanged: '0.86'
3100
3824
 
3101
3825
  Style/MultilineWhenThen:
3102
3826
  Description: 'Do not use then for multi-line when statement.'
@@ -3110,12 +3834,14 @@ Style/MultipleComparison:
3110
3834
  use Array#include? instead.
3111
3835
  Enabled: true
3112
3836
  VersionAdded: '0.49'
3837
+ VersionChanged: '1.1'
3113
3838
 
3114
3839
  Style/MutableConstant:
3115
3840
  Description: 'Do not assign mutable objects to constants.'
3116
3841
  Enabled: true
3117
3842
  VersionAdded: '0.34'
3118
- VersionChanged: '0.65'
3843
+ VersionChanged: '1.8'
3844
+ SafeAutoCorrect: false
3119
3845
  EnforcedStyle: literals
3120
3846
  SupportedStyles:
3121
3847
  # literals: freeze literals assigned to constants
@@ -3144,6 +3870,13 @@ Style/NegatedIf:
3144
3870
  - prefix
3145
3871
  - postfix
3146
3872
 
3873
+ Style/NegatedIfElseCondition:
3874
+ Description: >-
3875
+ This cop checks for uses of `if-else` and ternary operators with a negated condition
3876
+ which can be simplified by inverting condition and swapping branches.
3877
+ Enabled: true
3878
+ VersionAdded: '1.2'
3879
+
3147
3880
  Style/NegatedUnless:
3148
3881
  Description: 'Favor if over unless for negative conditions.'
3149
3882
  StyleGuide: '#if-for-negatives'
@@ -3201,6 +3934,7 @@ Style/NestedTernaryOperator:
3201
3934
  StyleGuide: '#no-nested-ternary'
3202
3935
  Enabled: true
3203
3936
  VersionAdded: '0.9'
3937
+ VersionChanged: '0.86'
3204
3938
 
3205
3939
  Style/Next:
3206
3940
  Description: 'Use `next` to skip iteration instead of a condition at the end.'
@@ -3230,6 +3964,11 @@ Style/NilComparison:
3230
3964
  - predicate
3231
3965
  - comparison
3232
3966
 
3967
+ Style/NilLambda:
3968
+ Description: 'Prefer `-> {}` to `-> { nil }`.'
3969
+ Enabled: true
3970
+ VersionAdded: '1.3'
3971
+
3233
3972
  Style/NonNilCheck:
3234
3973
  Description: 'Checks for redundant nil checks.'
3235
3974
  StyleGuide: '#no-non-nil-checks'
@@ -3283,7 +4022,6 @@ Style/NumericPredicate:
3283
4022
  # object. Switching these methods has to be done with knowledge of the types
3284
4023
  # of the variables which rubocop doesn't have.
3285
4024
  SafeAutoCorrect: false
3286
- AutoCorrect: false
3287
4025
  Enabled: true
3288
4026
  VersionAdded: '0.42'
3289
4027
  VersionChanged: '0.59'
@@ -3299,12 +4037,13 @@ Style/NumericPredicate:
3299
4037
 
3300
4038
  Style/OneLineConditional:
3301
4039
  Description: >-
3302
- Favor the ternary operator(?:) over
3303
- if/then/else/end constructs.
4040
+ Favor the ternary operator (?:) or multi-line constructs over
4041
+ single-line if/then/else/end constructs.
3304
4042
  StyleGuide: '#ternary-operator'
3305
4043
  Enabled: true
4044
+ AlwaysCorrectToMultiline: false
3306
4045
  VersionAdded: '0.9'
3307
- VersionChanged: '0.38'
4046
+ VersionChanged: '0.90'
3308
4047
 
3309
4048
  Style/OptionHash:
3310
4049
  Description: "Don't use option hashes when you can use keyword arguments."
@@ -3325,7 +4064,18 @@ Style/OptionalArguments:
3325
4064
  of the argument list.
3326
4065
  StyleGuide: '#optional-arguments'
3327
4066
  Enabled: true
4067
+ Safe: false
3328
4068
  VersionAdded: '0.33'
4069
+ VersionChanged: '0.83'
4070
+
4071
+ Style/OptionalBooleanParameter:
4072
+ Description: 'Use keyword arguments when defining method with boolean argument.'
4073
+ StyleGuide: '#boolean-keyword-arguments'
4074
+ Enabled: true
4075
+ Safe: false
4076
+ VersionAdded: '0.89'
4077
+ AllowedMethods:
4078
+ - respond_to_missing?
3329
4079
 
3330
4080
  Style/OrAssignment:
3331
4081
  Description: 'Recommend usage of double pipe equals (||=) where applicable.'
@@ -3372,7 +4122,7 @@ Style/PercentLiteralDelimiters:
3372
4122
  '%w': '{}'
3373
4123
  '%W': '{}'
3374
4124
  '%x': '{}'
3375
- VersionChanged: '0.48.1'
4125
+ VersionChanged: '0.48'
3376
4126
 
3377
4127
  Style/PercentQLiterals:
3378
4128
  Description: 'Checks if uses of %Q/%q match the configured preference.'
@@ -3413,11 +4163,12 @@ Style/RaiseArgs:
3413
4163
  StyleGuide: '#exception-class-messages'
3414
4164
  Enabled: true
3415
4165
  VersionAdded: '0.14'
3416
- VersionChanged: '0.40'
4166
+ VersionChanged: '1.2'
3417
4167
  EnforcedStyle: exploded
3418
4168
  SupportedStyles:
3419
4169
  - compact # raise Exception.new(msg)
3420
4170
  - exploded # raise Exception, msg
4171
+ AllowedCompactTypes: []
3421
4172
 
3422
4173
  Style/RandomWithOffset:
3423
4174
  Description: >-
@@ -3427,6 +4178,27 @@ Style/RandomWithOffset:
3427
4178
  Enabled: true
3428
4179
  VersionAdded: '0.52'
3429
4180
 
4181
+ Style/RedundantArgument:
4182
+ Description: 'Check for a redundant argument passed to certain methods.'
4183
+ Enabled: true
4184
+ Safe: false
4185
+ VersionAdded: '1.4'
4186
+ VersionChanged: '1.7'
4187
+ Methods:
4188
+ # Array#join
4189
+ join: ''
4190
+ # String#split
4191
+ split: ' '
4192
+ # String#chomp
4193
+ chomp: "\n"
4194
+ # String#chomp!
4195
+ chomp!: "\n"
4196
+
4197
+ Style/RedundantAssignment:
4198
+ Description: 'Checks for redundant assignment before returning.'
4199
+ Enabled: true
4200
+ VersionAdded: '0.87'
4201
+
3430
4202
  Style/RedundantBegin:
3431
4203
  Description: "Don't use begin blocks when they are not needed."
3432
4204
  StyleGuide: '#begin-implicit'
@@ -3456,6 +4228,27 @@ Style/RedundantException:
3456
4228
  VersionAdded: '0.14'
3457
4229
  VersionChanged: '0.29'
3458
4230
 
4231
+ Style/RedundantFetchBlock:
4232
+ Description: >-
4233
+ Use `fetch(key, value)` instead of `fetch(key) { value }`
4234
+ when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
4235
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
4236
+ Enabled: true
4237
+ Safe: false
4238
+ # If enabled, this cop will autocorrect usages of
4239
+ # `fetch` being called with block returning a constant.
4240
+ # This can be dangerous since constants will not be defined at that moment.
4241
+ SafeForConstants: false
4242
+ VersionAdded: '0.86'
4243
+
4244
+ Style/RedundantFileExtensionInRequire:
4245
+ Description: >-
4246
+ Checks for the presence of superfluous `.rb` extension in
4247
+ the filename provided to `require` and `require_relative`.
4248
+ StyleGuide: '#no-explicit-rb-to-require'
4249
+ Enabled: true
4250
+ VersionAdded: '0.88'
4251
+
3459
4252
  Style/RedundantFreeze:
3460
4253
  Description: "Checks usages of Object#freeze on immutable objects."
3461
4254
  Enabled: true
@@ -3478,6 +4271,16 @@ Style/RedundantPercentQ:
3478
4271
  Enabled: true
3479
4272
  VersionAdded: '0.76'
3480
4273
 
4274
+ Style/RedundantRegexpCharacterClass:
4275
+ Description: 'Checks for unnecessary single-element Regexp character classes.'
4276
+ Enabled: true
4277
+ VersionAdded: '0.85'
4278
+
4279
+ Style/RedundantRegexpEscape:
4280
+ Description: 'Checks for redundant escapes in Regexps.'
4281
+ Enabled: true
4282
+ VersionAdded: '0.85'
4283
+
3481
4284
  Style/RedundantReturn:
3482
4285
  Description: "Don't use return where it's not required."
3483
4286
  StyleGuide: '#no-explicit-return'
@@ -3494,6 +4297,12 @@ Style/RedundantSelf:
3494
4297
  VersionAdded: '0.10'
3495
4298
  VersionChanged: '0.13'
3496
4299
 
4300
+ Style/RedundantSelfAssignment:
4301
+ Description: 'Checks for places where redundant assignments are made for in place modification methods.'
4302
+ Enabled: true
4303
+ Safe: false
4304
+ VersionAdded: '0.90'
4305
+
3497
4306
  Style/RedundantSort:
3498
4307
  Description: >-
3499
4308
  Use `min` instead of `sort.first`,
@@ -3556,6 +4365,8 @@ Style/SafeNavigation:
3556
4365
  This cop transforms usages of a method call safeguarded by
3557
4366
  a check for the existence of the object to
3558
4367
  safe navigation (`&.`).
4368
+ Auto-correction is unsafe as it assumes the object will
4369
+ be `nil` or truthy, but never `false`.
3559
4370
  Enabled: true
3560
4371
  VersionAdded: '0.43'
3561
4372
  VersionChanged: '0.77'
@@ -3568,6 +4379,7 @@ Style/SafeNavigation:
3568
4379
  - presence
3569
4380
  - try
3570
4381
  - try!
4382
+ SafeAutoCorrect: false
3571
4383
 
3572
4384
  Style/Sample:
3573
4385
  Description: >-
@@ -3613,11 +4425,17 @@ Style/SignalException:
3613
4425
  - only_fail
3614
4426
  - semantic
3615
4427
 
4428
+ Style/SingleArgumentDig:
4429
+ Description: 'Avoid using single argument dig method.'
4430
+ Enabled: true
4431
+ VersionAdded: '0.89'
4432
+ Safe: false
4433
+
3616
4434
  Style/SingleLineBlockParams:
3617
4435
  Description: 'Enforces the names of some block params.'
3618
4436
  Enabled: false
3619
4437
  VersionAdded: '0.16'
3620
- VersionChanged: '0.47'
4438
+ VersionChanged: '1.6'
3621
4439
  Methods:
3622
4440
  - reduce:
3623
4441
  - acc
@@ -3631,9 +4449,24 @@ Style/SingleLineMethods:
3631
4449
  StyleGuide: '#no-single-line-methods'
3632
4450
  Enabled: true
3633
4451
  VersionAdded: '0.9'
3634
- VersionChanged: '0.19'
4452
+ VersionChanged: '1.8'
3635
4453
  AllowIfMethodIsEmpty: true
3636
4454
 
4455
+ Style/SlicingWithRange:
4456
+ Description: 'Checks array slicing is done with endless ranges when suitable.'
4457
+ Enabled: true
4458
+ VersionAdded: '0.83'
4459
+ Safe: false
4460
+
4461
+ Style/SoleNestedConditional:
4462
+ Description: >-
4463
+ Finds sole nested conditional nodes
4464
+ which can be merged into outer conditional node.
4465
+ Enabled: true
4466
+ VersionAdded: '0.89'
4467
+ VersionChanged: '1.5'
4468
+ AllowModifier: false
4469
+
3637
4470
  Style/SpecialGlobalVars:
3638
4471
  Description: 'Avoid Perl-style global variables.'
3639
4472
  StyleGuide: '#no-cryptic-perlisms'
@@ -3656,12 +4489,34 @@ Style/StabbyLambdaParentheses:
3656
4489
  - require_parentheses
3657
4490
  - require_no_parentheses
3658
4491
 
4492
+ Style/StaticClass:
4493
+ Description: 'Prefer modules to classes with only class methods.'
4494
+ StyleGuide: '#modules-vs-classes'
4495
+ Enabled: false
4496
+ Safe: false
4497
+ VersionAdded: '1.3'
4498
+
3659
4499
  Style/StderrPuts:
3660
4500
  Description: 'Use `warn` instead of `$stderr.puts`.'
3661
4501
  StyleGuide: '#warn'
3662
4502
  Enabled: true
3663
4503
  VersionAdded: '0.51'
3664
4504
 
4505
+ Style/StringChars:
4506
+ Description: 'Checks for uses of `String#split` with empty string or regexp literal argument.'
4507
+ StyleGuide: '#string-chars'
4508
+ Enabled: true
4509
+ Safe: false
4510
+ VersionAdded: '1.12'
4511
+
4512
+ Style/StringConcatenation:
4513
+ Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
4514
+ StyleGuide: '#string-interpolation'
4515
+ Enabled: true
4516
+ Safe: false
4517
+ VersionAdded: '0.89'
4518
+ VersionChanged: '1.6'
4519
+
3665
4520
  Style/StringHashKeys:
3666
4521
  Description: 'Prefer symbols instead of strings as hash keys.'
3667
4522
  StyleGuide: '#symbols-as-keys'
@@ -3699,7 +4554,7 @@ Style/StringMethods:
3699
4554
  Description: 'Checks if configured preferred methods are used over non-preferred.'
3700
4555
  Enabled: false
3701
4556
  VersionAdded: '0.34'
3702
- VersionChanged: '0.34.2'
4557
+ VersionChanged: '0.34'
3703
4558
  # Mapping from undesired method to desired_method
3704
4559
  # e.g. to use `to_sym` over `intern`:
3705
4560
  #
@@ -3719,6 +4574,14 @@ Style/StructInheritance:
3719
4574
  StyleGuide: '#no-extend-struct-new'
3720
4575
  Enabled: true
3721
4576
  VersionAdded: '0.29'
4577
+ VersionChanged: '0.86'
4578
+
4579
+ Style/SwapValues:
4580
+ Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
4581
+ StyleGuide: '#values-swapping'
4582
+ Enabled: true
4583
+ VersionAdded: '1.1'
4584
+ SafeAutoCorrect: false
3722
4585
 
3723
4586
  Style/SymbolArray:
3724
4587
  Description: 'Use %i or %I for arrays of symbols.'
@@ -3740,9 +4603,10 @@ Style/SymbolLiteral:
3740
4603
  Style/SymbolProc:
3741
4604
  Description: 'Use symbols as procs instead of blocks when possible.'
3742
4605
  Enabled: true
3743
- SafeAutoCorrect: false
4606
+ Safe: false
3744
4607
  VersionAdded: '0.26'
3745
- VersionChanged: '0.64'
4608
+ VersionChanged: '1.5'
4609
+ AllowMethodsWithArguments: false
3746
4610
  # A list of method names to be ignored by the check.
3747
4611
  # The names should be fairly unique, otherwise you'll end up ignoring lots of code.
3748
4612
  IgnoredMethods:
@@ -3796,22 +4660,29 @@ Style/TrailingCommaInArrayLiteral:
3796
4660
  StyleGuide: '#no-trailing-array-commas'
3797
4661
  Enabled: true
3798
4662
  VersionAdded: '0.53'
4663
+ # If `comma`, the cop requires a comma after the last item in an array,
3799
4664
  # but only when each item is on its own line.
3800
4665
  # If `consistent_comma`, the cop requires a comma after the last item of all
3801
- # non-empty array literals.
4666
+ # non-empty, multiline array literals.
3802
4667
  EnforcedStyleForMultiline: no_comma
3803
4668
  SupportedStylesForMultiline:
3804
4669
  - comma
3805
4670
  - consistent_comma
3806
4671
  - no_comma
3807
4672
 
4673
+ Style/TrailingCommaInBlockArgs:
4674
+ Description: 'Checks for useless trailing commas in block arguments.'
4675
+ Enabled: false
4676
+ Safe: false
4677
+ VersionAdded: '0.81'
4678
+
3808
4679
  Style/TrailingCommaInHashLiteral:
3809
4680
  Description: 'Checks for trailing comma in hash literals.'
3810
4681
  Enabled: true
3811
4682
  # If `comma`, the cop requires a comma after the last item in a hash,
3812
4683
  # but only when each item is on its own line.
3813
4684
  # If `consistent_comma`, the cop requires a comma after the last item of all
3814
- # non-empty hash literals.
4685
+ # non-empty, multiline hash literals.
3815
4686
  EnforcedStyleForMultiline: no_comma
3816
4687
  SupportedStylesForMultiline:
3817
4688
  - comma
@@ -3888,6 +4759,16 @@ Style/UnlessElse:
3888
4759
  Enabled: true
3889
4760
  VersionAdded: '0.9'
3890
4761
 
4762
+ Style/UnlessLogicalOperators:
4763
+ Description: >-
4764
+ Checks for use of logical operators in an unless condition.
4765
+ Enabled: false
4766
+ VersionAdded: '1.11'
4767
+ EnforcedStyle: forbid_mixed_logical_operators
4768
+ SupportedStyles:
4769
+ - forbid_mixed_logical_operators
4770
+ - forbid_logical_operators
4771
+
3891
4772
  Style/UnpackFirst:
3892
4773
  Description: >-
3893
4774
  Checks for accessing the first element of `String#unpack`