chefstyle 1.4.3 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/chefstyle.yml +24 -4
- data/config/disable_all.yml +34 -0
- data/config/upstream.yml +234 -69
- data/lib/chefstyle/version.rb +2 -2
- data/lib/rubocop/cop/chef/ruby/gemspec_require_rubygems.rb +1 -1
- data/lib/rubocop/cop/chef/ruby/require_net_https.rb +1 -1
- data/lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb +1 -1
- data/lib/rubocop/cop/chef/ruby/unless_defined_require.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbf6452b0cab1ef46383080fe18fa78d21aa00066abc1df2bbc0705a6721d753
|
4
|
+
data.tar.gz: be21de8c4bc2f9681e8da6f23f0cff755e50b4a4300e84b03df4d2bbd92f829a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e77886f2e3067aa56a3202803dba4ac0d5f18533f0dc2d65c0bc5431fe17be09e9a00126f157bfb12d81649c4001a4d4eb2420ef672f80af28c7ec719d6dd0e7
|
7
|
+
data.tar.gz: dbb8488366023a4d1986e5694cb7a09b38683b5392d8e6ca4a520cdd11b1bc73597a46b5af180aba81cd20e8e96dffcd0dd19bf545221feab9a54f9d121415e6
|
data/config/chefstyle.yml
CHANGED
@@ -665,26 +665,46 @@ Style/Dir:
|
|
665
665
|
Style/ExpandPathArguments:
|
666
666
|
Enabled: true
|
667
667
|
|
668
|
-
|
668
|
+
# more code you don't need
|
669
|
+
Lint/RedundantSafeNavigation:
|
670
|
+
Enabled: true
|
671
|
+
|
672
|
+
# Eases readability
|
673
|
+
Lint/RedundantStringCoercion:
|
674
|
+
Enabled: true
|
675
|
+
|
676
|
+
# unnecessary complexity
|
677
|
+
Lint/RedundantWithObject:
|
678
|
+
Enabled: true
|
679
|
+
|
680
|
+
# unnecessary complexity
|
681
|
+
Lint/RedundantWithIndex:
|
682
|
+
Enabled: true
|
683
|
+
|
684
|
+
# avoid requiring twice
|
685
|
+
Lint/DuplicateRequire:
|
686
|
+
Enabled: true
|
687
|
+
|
688
|
+
Chef/Ruby/Ruby27KeywordArgumentWarnings:
|
669
689
|
Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
|
670
690
|
Enabled: true
|
671
691
|
VersionAdded: '1.3.0'
|
672
692
|
|
673
|
-
|
693
|
+
Chef/Ruby/UnlessDefinedRequire:
|
674
694
|
Description: Workaround RubyGems' slow requires by only running require if the constant isn't already defined
|
675
695
|
Enabled: true
|
676
696
|
VersionAdded: '1.3.0'
|
677
697
|
Include:
|
678
698
|
- 'lib/**/*'
|
679
699
|
|
680
|
-
|
700
|
+
Chef/Ruby/GemspecRequireRubygems:
|
681
701
|
Description: Rubygems does not need to be required in a Gemspec
|
682
702
|
Enabled: true
|
683
703
|
VersionAdded: '1.3.0'
|
684
704
|
Include:
|
685
705
|
- '**/*.gemspec'
|
686
706
|
|
687
|
-
|
707
|
+
Chef/Ruby/RequireNetHttps:
|
688
708
|
Description: net/https is deprecated and just includes net/http and openssl. We should include those directly instead
|
689
709
|
Enabled: true
|
690
710
|
VersionAdded: '1.3.0'
|
data/config/disable_all.yml
CHANGED
@@ -229,6 +229,8 @@ Lint/DeprecatedOpenSSLConstant:
|
|
229
229
|
Enabled: false
|
230
230
|
Lint/DisjunctiveAssignmentInConstructor:
|
231
231
|
Enabled: false
|
232
|
+
Lint/DuplicateBranch:
|
233
|
+
Enabled: false
|
232
234
|
Lint/DuplicateCaseCondition:
|
233
235
|
Enabled: false
|
234
236
|
Lint/DuplicateElsifCondition:
|
@@ -237,6 +239,8 @@ Lint/DuplicateHashKey:
|
|
237
239
|
Enabled: false
|
238
240
|
Lint/DuplicateMethods:
|
239
241
|
Enabled: false
|
242
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
243
|
+
Enabled: false
|
240
244
|
Lint/DuplicateRequire:
|
241
245
|
Enabled: false
|
242
246
|
Lint/DuplicateRescueException:
|
@@ -245,6 +249,10 @@ Lint/EachWithObjectArgument:
|
|
245
249
|
Enabled: false
|
246
250
|
Lint/ElseLayout:
|
247
251
|
Enabled: false
|
252
|
+
Lint/EmptyBlock:
|
253
|
+
Enabled: false
|
254
|
+
Lint/EmptyClass:
|
255
|
+
Enabled: false
|
248
256
|
Lint/EmptyConditionalBody:
|
249
257
|
Enabled: false
|
250
258
|
Lint/EmptyEnsure:
|
@@ -269,6 +277,8 @@ Lint/FloatOutOfRange:
|
|
269
277
|
Enabled: false
|
270
278
|
Lint/FormatParameterMismatch:
|
271
279
|
Enabled: false
|
280
|
+
Lint/HashCompareByIdentity:
|
281
|
+
Enabled: false
|
272
282
|
Lint/HeredocMethodCallPosition:
|
273
283
|
Enabled: false
|
274
284
|
Lint/IdentityComparison:
|
@@ -301,6 +311,8 @@ Lint/NestedPercentLiteral:
|
|
301
311
|
Enabled: false
|
302
312
|
Lint/NextWithoutAccumulator:
|
303
313
|
Enabled: false
|
314
|
+
Lint/NoReturnInBeginEndBlocks:
|
315
|
+
Enabled: false
|
304
316
|
Lint/NonDeterministicRequireOrder:
|
305
317
|
Enabled: false
|
306
318
|
Lint/NonLocalExitFromIterator:
|
@@ -327,6 +339,8 @@ Lint/RedundantCopEnableDirective:
|
|
327
339
|
Enabled: false
|
328
340
|
Lint/RedundantRequireStatement:
|
329
341
|
Enabled: false
|
342
|
+
Lint/RedundantSafeNavigation:
|
343
|
+
Enabled: false
|
330
344
|
Lint/RedundantSplatExpansion:
|
331
345
|
Enabled: false
|
332
346
|
Lint/RedundantStringCoercion:
|
@@ -369,6 +383,8 @@ Lint/SuppressedException:
|
|
369
383
|
Enabled: false
|
370
384
|
Lint/Syntax:
|
371
385
|
Enabled: false
|
386
|
+
Lint/ToEnumArguments:
|
387
|
+
Enabled: false
|
372
388
|
Lint/ToJSON:
|
373
389
|
Enabled: false
|
374
390
|
Lint/TopLevelReturnWithArgument:
|
@@ -379,6 +395,8 @@ Lint/UnderscorePrefixedVariableName:
|
|
379
395
|
Enabled: false
|
380
396
|
Lint/UnifiedInteger:
|
381
397
|
Enabled: false
|
398
|
+
Lint/UnmodifiedReduceAccumulator:
|
399
|
+
Enabled: false
|
382
400
|
Lint/UnreachableCode:
|
383
401
|
Enabled: false
|
384
402
|
Lint/UnreachableLoop:
|
@@ -463,6 +481,8 @@ Style/Alias:
|
|
463
481
|
Enabled: false
|
464
482
|
Style/AndOr:
|
465
483
|
Enabled: false
|
484
|
+
Style/ArgumentsForwarding:
|
485
|
+
Enabled: false
|
466
486
|
Style/ArrayCoercion:
|
467
487
|
Enabled: false
|
468
488
|
Style/ArrayJoin:
|
@@ -493,12 +513,16 @@ Style/ClassAndModuleChildren:
|
|
493
513
|
Enabled: false
|
494
514
|
Style/ClassCheck:
|
495
515
|
Enabled: false
|
516
|
+
Style/ClassEqualityComparison:
|
517
|
+
Enabled: false
|
496
518
|
Style/ClassMethods:
|
497
519
|
Enabled: false
|
498
520
|
Style/ClassMethodsDefinitions:
|
499
521
|
Enabled: false
|
500
522
|
Style/ClassVars:
|
501
523
|
Enabled: false
|
524
|
+
Style/CollectionCompact:
|
525
|
+
Enabled: false
|
502
526
|
Style/CollectionMethods:
|
503
527
|
Enabled: false
|
504
528
|
Style/ColonMethodCall:
|
@@ -531,6 +555,8 @@ Style/DocumentationMethod:
|
|
531
555
|
Enabled: false
|
532
556
|
Style/Documentation:
|
533
557
|
Enabled: false
|
558
|
+
Style/DocumentDynamicEvalDefinition:
|
559
|
+
Enabled: false
|
534
560
|
Style/DoubleCopDisableDirective:
|
535
561
|
Enabled: false
|
536
562
|
Style/DoubleNegation:
|
@@ -635,6 +661,8 @@ Style/RedundantSelfAssignment:
|
|
635
661
|
Enabled: false
|
636
662
|
Style/SoleNestedConditional:
|
637
663
|
Enabled: false
|
664
|
+
Style/StaticClass:
|
665
|
+
Enabled: false
|
638
666
|
Style/MethodCalledOnDoEndBlock:
|
639
667
|
Enabled: false
|
640
668
|
Style/MethodDefParentheses:
|
@@ -671,6 +699,8 @@ Style/MutableConstant:
|
|
671
699
|
Enabled: false
|
672
700
|
Style/NegatedIf:
|
673
701
|
Enabled: false
|
702
|
+
Style/NegatedIfElseCondition:
|
703
|
+
Enabled: false
|
674
704
|
Style/NegatedUnless:
|
675
705
|
Enabled: false
|
676
706
|
Style/NegatedWhile:
|
@@ -685,6 +715,8 @@ Style/Next:
|
|
685
715
|
Enabled: false
|
686
716
|
Style/NilComparison:
|
687
717
|
Enabled: false
|
718
|
+
Style/NilLambda:
|
719
|
+
Enabled: false
|
688
720
|
Style/NonNilCheck:
|
689
721
|
Enabled: false
|
690
722
|
Style/Not:
|
@@ -801,6 +833,8 @@ Style/Strip:
|
|
801
833
|
Enabled: false
|
802
834
|
Style/StructInheritance:
|
803
835
|
Enabled: false
|
836
|
+
Style/SwapValues:
|
837
|
+
Enabled: false
|
804
838
|
Style/SymbolArray:
|
805
839
|
Enabled: false
|
806
840
|
Style/SymbolLiteral:
|
data/config/upstream.yml
CHANGED
@@ -313,7 +313,7 @@ Layout/AssignmentIndentation:
|
|
313
313
|
|
314
314
|
Layout/BeginEndAlignment:
|
315
315
|
Description: 'Align ends corresponding to begins correctly.'
|
316
|
-
Enabled:
|
316
|
+
Enabled: true
|
317
317
|
VersionAdded: '0.91'
|
318
318
|
# The value `start_of_line` means that `end` should be aligned the start of the line
|
319
319
|
# where the `begin` keyword is.
|
@@ -496,7 +496,7 @@ Layout/EmptyLinesAroundArguments:
|
|
496
496
|
Layout/EmptyLinesAroundAttributeAccessor:
|
497
497
|
Description: "Keep blank lines around attribute accessors."
|
498
498
|
StyleGuide: '#empty-lines-around-attribute-accessor'
|
499
|
-
Enabled:
|
499
|
+
Enabled: true
|
500
500
|
VersionAdded: '0.83'
|
501
501
|
VersionChanged: '0.84'
|
502
502
|
AllowAliasSyntax: true
|
@@ -891,7 +891,7 @@ Layout/LineLength:
|
|
891
891
|
StyleGuide: '#max-line-length'
|
892
892
|
Enabled: true
|
893
893
|
VersionAdded: '0.25'
|
894
|
-
VersionChanged: '
|
894
|
+
VersionChanged: '1.3'
|
895
895
|
AutoCorrect: false
|
896
896
|
Max: 120
|
897
897
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
@@ -1145,7 +1145,7 @@ Layout/SpaceAroundKeyword:
|
|
1145
1145
|
|
1146
1146
|
Layout/SpaceAroundMethodCallOperator:
|
1147
1147
|
Description: 'Checks method call operators to not have spaces around them.'
|
1148
|
-
Enabled:
|
1148
|
+
Enabled: true
|
1149
1149
|
VersionAdded: '0.82'
|
1150
1150
|
|
1151
1151
|
Layout/SpaceAroundOperators:
|
@@ -1176,7 +1176,7 @@ Layout/SpaceBeforeBlockBraces:
|
|
1176
1176
|
SupportedStylesForEmptyBraces:
|
1177
1177
|
- space
|
1178
1178
|
- no_space
|
1179
|
-
VersionChanged: '0.52
|
1179
|
+
VersionChanged: '0.52'
|
1180
1180
|
|
1181
1181
|
Layout/SpaceBeforeComma:
|
1182
1182
|
Description: 'No spaces before commas.'
|
@@ -1334,8 +1334,8 @@ Layout/TrailingWhitespace:
|
|
1334
1334
|
StyleGuide: '#no-trailing-whitespace'
|
1335
1335
|
Enabled: true
|
1336
1336
|
VersionAdded: '0.49'
|
1337
|
-
VersionChanged: '0
|
1338
|
-
AllowInHeredoc:
|
1337
|
+
VersionChanged: '1.0'
|
1338
|
+
AllowInHeredoc: false
|
1339
1339
|
|
1340
1340
|
#################### Lint ##################################
|
1341
1341
|
### Warnings
|
@@ -1379,7 +1379,7 @@ Lint/BigDecimalNew:
|
|
1379
1379
|
|
1380
1380
|
Lint/BinaryOperatorWithIdenticalOperands:
|
1381
1381
|
Description: 'This cop checks for places where binary operator has identical operands.'
|
1382
|
-
Enabled:
|
1382
|
+
Enabled: true
|
1383
1383
|
Safe: false
|
1384
1384
|
VersionAdded: '0.89'
|
1385
1385
|
|
@@ -1398,8 +1398,13 @@ Lint/CircularArgumentReference:
|
|
1398
1398
|
Lint/ConstantDefinitionInBlock:
|
1399
1399
|
Description: 'Do not define constants within a block.'
|
1400
1400
|
StyleGuide: '#no-constant-definition-in-block'
|
1401
|
-
Enabled:
|
1401
|
+
Enabled: true
|
1402
1402
|
VersionAdded: '0.91'
|
1403
|
+
VersionChanged: '1.3'
|
1404
|
+
# `enums` for Typed Enums via T::Enum in Sorbet.
|
1405
|
+
# https://sorbet.org/docs/tenum
|
1406
|
+
AllowedMethods:
|
1407
|
+
- enums
|
1403
1408
|
|
1404
1409
|
Lint/ConstantResolution:
|
1405
1410
|
Description: 'Check that constants are fully qualified with `::`.'
|
@@ -1415,6 +1420,22 @@ Lint/Debugger:
|
|
1415
1420
|
Enabled: true
|
1416
1421
|
VersionAdded: '0.14'
|
1417
1422
|
VersionChanged: '0.49'
|
1423
|
+
DebuggerReceivers:
|
1424
|
+
- binding
|
1425
|
+
- Kernel
|
1426
|
+
- Pry
|
1427
|
+
DebuggerMethods:
|
1428
|
+
- debugger
|
1429
|
+
- byebug
|
1430
|
+
- remote_byebug
|
1431
|
+
- pry
|
1432
|
+
- remote_pry
|
1433
|
+
- pry_remote
|
1434
|
+
- console
|
1435
|
+
- rescue
|
1436
|
+
- save_and_open_page
|
1437
|
+
- save_and_open_screenshot
|
1438
|
+
- irb
|
1418
1439
|
|
1419
1440
|
Lint/DeprecatedClassMethods:
|
1420
1441
|
Description: 'Check for deprecated class method calls.'
|
@@ -1423,7 +1444,7 @@ Lint/DeprecatedClassMethods:
|
|
1423
1444
|
|
1424
1445
|
Lint/DeprecatedOpenSSLConstant:
|
1425
1446
|
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
1426
|
-
Enabled:
|
1447
|
+
Enabled: true
|
1427
1448
|
VersionAdded: '0.84'
|
1428
1449
|
|
1429
1450
|
Lint/DisjunctiveAssignmentInConstructor:
|
@@ -1433,6 +1454,11 @@ Lint/DisjunctiveAssignmentInConstructor:
|
|
1433
1454
|
VersionAdded: '0.62'
|
1434
1455
|
VersionChanged: '0.88'
|
1435
1456
|
|
1457
|
+
Lint/DuplicateBranch:
|
1458
|
+
Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
|
1459
|
+
Enabled: pending
|
1460
|
+
VersionAdded: '1.3'
|
1461
|
+
|
1436
1462
|
Lint/DuplicateCaseCondition:
|
1437
1463
|
Description: 'Do not repeat values in case conditionals.'
|
1438
1464
|
Enabled: true
|
@@ -1440,7 +1466,7 @@ Lint/DuplicateCaseCondition:
|
|
1440
1466
|
|
1441
1467
|
Lint/DuplicateElsifCondition:
|
1442
1468
|
Description: 'Do not repeat conditions used in if `elsif`.'
|
1443
|
-
Enabled:
|
1469
|
+
Enabled: true
|
1444
1470
|
VersionAdded: '0.88'
|
1445
1471
|
|
1446
1472
|
Lint/DuplicateHashKey:
|
@@ -1454,14 +1480,19 @@ Lint/DuplicateMethods:
|
|
1454
1480
|
Enabled: true
|
1455
1481
|
VersionAdded: '0.29'
|
1456
1482
|
|
1483
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
1484
|
+
Description: 'Checks for duplicate elements in Regexp character classes.'
|
1485
|
+
Enabled: pending
|
1486
|
+
VersionAdded: '1.1'
|
1487
|
+
|
1457
1488
|
Lint/DuplicateRequire:
|
1458
1489
|
Description: 'Check for duplicate `require`s and `require_relative`s.'
|
1459
|
-
Enabled:
|
1490
|
+
Enabled: true
|
1460
1491
|
VersionAdded: '0.90'
|
1461
1492
|
|
1462
1493
|
Lint/DuplicateRescueException:
|
1463
1494
|
Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
|
1464
|
-
Enabled:
|
1495
|
+
Enabled: true
|
1465
1496
|
VersionAdded: '0.89'
|
1466
1497
|
|
1467
1498
|
Lint/EachWithObjectArgument:
|
@@ -1473,10 +1504,25 @@ Lint/ElseLayout:
|
|
1473
1504
|
Description: 'Check for odd code arrangement in an else block.'
|
1474
1505
|
Enabled: true
|
1475
1506
|
VersionAdded: '0.17'
|
1507
|
+
VersionChanged: '1.2'
|
1508
|
+
|
1509
|
+
Lint/EmptyBlock:
|
1510
|
+
Description: 'This cop checks for blocks without a body.'
|
1511
|
+
Enabled: pending
|
1512
|
+
VersionAdded: '1.1'
|
1513
|
+
VersionChanged: '1.3'
|
1514
|
+
AllowComments: true
|
1515
|
+
AllowEmptyLambdas: true
|
1516
|
+
|
1517
|
+
Lint/EmptyClass:
|
1518
|
+
Description: 'Checks for classes and metaclasses without a body.'
|
1519
|
+
Enabled: pending
|
1520
|
+
VersionAdded: '1.3'
|
1521
|
+
AllowComments: false
|
1476
1522
|
|
1477
1523
|
Lint/EmptyConditionalBody:
|
1478
1524
|
Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
|
1479
|
-
Enabled:
|
1525
|
+
Enabled: true
|
1480
1526
|
AllowComments: true
|
1481
1527
|
VersionAdded: '0.89'
|
1482
1528
|
|
@@ -1493,7 +1539,7 @@ Lint/EmptyExpression:
|
|
1493
1539
|
|
1494
1540
|
Lint/EmptyFile:
|
1495
1541
|
Description: 'Enforces that Ruby source files are not empty.'
|
1496
|
-
Enabled:
|
1542
|
+
Enabled: true
|
1497
1543
|
AllowComments: true
|
1498
1544
|
VersionAdded: '0.90'
|
1499
1545
|
|
@@ -1531,7 +1577,7 @@ Lint/FlipFlop:
|
|
1531
1577
|
Lint/FloatComparison:
|
1532
1578
|
Description: 'Checks for the presence of precise comparison of floating point numbers.'
|
1533
1579
|
StyleGuide: '#float-comparison'
|
1534
|
-
Enabled:
|
1580
|
+
Enabled: true
|
1535
1581
|
VersionAdded: '0.89'
|
1536
1582
|
|
1537
1583
|
Lint/FloatOutOfRange:
|
@@ -1546,6 +1592,13 @@ Lint/FormatParameterMismatch:
|
|
1546
1592
|
Enabled: true
|
1547
1593
|
VersionAdded: '0.33'
|
1548
1594
|
|
1595
|
+
Lint/HashCompareByIdentity:
|
1596
|
+
Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
|
1597
|
+
StyleGuide: '#identity-comparison'
|
1598
|
+
Enabled: true
|
1599
|
+
Safe: false
|
1600
|
+
VersionAdded: '0.93'
|
1601
|
+
|
1549
1602
|
Lint/HeredocMethodCallPosition:
|
1550
1603
|
Description: >-
|
1551
1604
|
Checks for the ordering of a method call where
|
@@ -1556,7 +1609,7 @@ Lint/HeredocMethodCallPosition:
|
|
1556
1609
|
|
1557
1610
|
Lint/IdentityComparison:
|
1558
1611
|
Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
|
1559
|
-
Enabled:
|
1612
|
+
Enabled: true
|
1560
1613
|
StyleGuide: '#identity-comparison'
|
1561
1614
|
VersionAdded: '0.91'
|
1562
1615
|
|
@@ -1609,7 +1662,8 @@ Lint/Loop:
|
|
1609
1662
|
StyleGuide: '#loop-with-break'
|
1610
1663
|
Enabled: true
|
1611
1664
|
VersionAdded: '0.9'
|
1612
|
-
VersionChanged: '
|
1665
|
+
VersionChanged: '1.3'
|
1666
|
+
Safe: false
|
1613
1667
|
|
1614
1668
|
Lint/MissingCopEnableDirective:
|
1615
1669
|
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.'
|
@@ -1628,19 +1682,20 @@ Lint/MissingSuper:
|
|
1628
1682
|
Description: >-
|
1629
1683
|
This cop checks for the presence of constructors and lifecycle callbacks
|
1630
1684
|
without calls to `super`'.
|
1631
|
-
Enabled:
|
1685
|
+
Enabled: true
|
1632
1686
|
VersionAdded: '0.89'
|
1633
1687
|
|
1634
1688
|
Lint/MixedRegexpCaptureTypes:
|
1635
1689
|
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1636
|
-
Enabled:
|
1690
|
+
Enabled: true
|
1637
1691
|
VersionAdded: '0.85'
|
1638
1692
|
|
1639
1693
|
Lint/MultipleComparison:
|
1640
1694
|
Description: "Use `&&` operator to compare multiple values."
|
1641
1695
|
Enabled: true
|
1642
1696
|
VersionAdded: '0.47'
|
1643
|
-
VersionChanged: '
|
1697
|
+
VersionChanged: '1.1'
|
1698
|
+
AllowMethodComparison: true
|
1644
1699
|
|
1645
1700
|
Lint/NestedMethodDefinition:
|
1646
1701
|
Description: 'Do not use nested method definitions.'
|
@@ -1660,6 +1715,11 @@ Lint/NextWithoutAccumulator:
|
|
1660
1715
|
Enabled: true
|
1661
1716
|
VersionAdded: '0.36'
|
1662
1717
|
|
1718
|
+
Lint/NoReturnInBeginEndBlocks:
|
1719
|
+
Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
|
1720
|
+
Enabled: pending
|
1721
|
+
VersionAdded: '1.2'
|
1722
|
+
|
1663
1723
|
Lint/NonDeterministicRequireOrder:
|
1664
1724
|
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1665
1725
|
Enabled: true
|
@@ -1675,8 +1735,12 @@ Lint/NumberConversion:
|
|
1675
1735
|
Description: 'Checks unsafe usage of number conversion methods.'
|
1676
1736
|
Enabled: false
|
1677
1737
|
VersionAdded: '0.53'
|
1678
|
-
VersionChanged: '
|
1738
|
+
VersionChanged: '1.1'
|
1679
1739
|
SafeAutoCorrect: false
|
1740
|
+
IgnoredMethods: []
|
1741
|
+
IgnoredClasses:
|
1742
|
+
- Time
|
1743
|
+
- DateTime
|
1680
1744
|
|
1681
1745
|
Lint/OrderedMagicComments:
|
1682
1746
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
@@ -1685,7 +1749,7 @@ Lint/OrderedMagicComments:
|
|
1685
1749
|
|
1686
1750
|
Lint/OutOfRangeRegexpRef:
|
1687
1751
|
Description: 'Checks for out of range reference for Regexp because it always returns nil.'
|
1688
|
-
Enabled:
|
1752
|
+
Enabled: true
|
1689
1753
|
Safe: false
|
1690
1754
|
VersionAdded: '0.89'
|
1691
1755
|
|
@@ -1714,7 +1778,7 @@ Lint/PercentSymbolArray:
|
|
1714
1778
|
Lint/RaiseException:
|
1715
1779
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1716
1780
|
StyleGuide: '#raise-exception'
|
1717
|
-
Enabled:
|
1781
|
+
Enabled: true
|
1718
1782
|
Safe: false
|
1719
1783
|
VersionAdded: '0.81'
|
1720
1784
|
VersionChanged: '0.86'
|
@@ -1746,6 +1810,19 @@ Lint/RedundantRequireStatement:
|
|
1746
1810
|
Enabled: true
|
1747
1811
|
VersionAdded: '0.76'
|
1748
1812
|
|
1813
|
+
Lint/RedundantSafeNavigation:
|
1814
|
+
Description: 'Checks for redundant safe navigation calls.'
|
1815
|
+
Enabled: true
|
1816
|
+
VersionAdded: '0.93'
|
1817
|
+
AllowedMethods:
|
1818
|
+
- instance_of?
|
1819
|
+
- kind_of?
|
1820
|
+
- is_a?
|
1821
|
+
- eql?
|
1822
|
+
- respond_to?
|
1823
|
+
- equal?
|
1824
|
+
Safe: false
|
1825
|
+
|
1749
1826
|
Lint/RedundantSplatExpansion:
|
1750
1827
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
1751
1828
|
Enabled: true
|
@@ -1788,7 +1865,7 @@ Lint/RescueException:
|
|
1788
1865
|
StyleGuide: '#no-blind-rescues'
|
1789
1866
|
Enabled: true
|
1790
1867
|
VersionAdded: '0.9'
|
1791
|
-
VersionChanged: '0.27
|
1868
|
+
VersionChanged: '0.27'
|
1792
1869
|
|
1793
1870
|
Lint/RescueType:
|
1794
1871
|
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
|
@@ -1842,7 +1919,7 @@ Lint/ScriptPermission:
|
|
1842
1919
|
|
1843
1920
|
Lint/SelfAssignment:
|
1844
1921
|
Description: 'Checks for self-assignments.'
|
1845
|
-
Enabled:
|
1922
|
+
Enabled: true
|
1846
1923
|
VersionAdded: '0.89'
|
1847
1924
|
|
1848
1925
|
Lint/SendWithMixinArgument:
|
@@ -1873,7 +1950,7 @@ Lint/ShadowingOuterLocalVariable:
|
|
1873
1950
|
|
1874
1951
|
Lint/StructNewOverride:
|
1875
1952
|
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1876
|
-
Enabled:
|
1953
|
+
Enabled: true
|
1877
1954
|
VersionAdded: '0.81'
|
1878
1955
|
|
1879
1956
|
Lint/SuppressedException:
|
@@ -1890,6 +1967,11 @@ Lint/Syntax:
|
|
1890
1967
|
VersionAdded: '0.9'
|
1891
1968
|
|
1892
1969
|
|
1970
|
+
Lint/ToEnumArguments:
|
1971
|
+
Description: 'This cop ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
1972
|
+
Enabled: pending
|
1973
|
+
VersionAdded: '1.1'
|
1974
|
+
|
1893
1975
|
Lint/ToJSON:
|
1894
1976
|
Description: 'Ensure #to_json includes an optional argument.'
|
1895
1977
|
Enabled: true
|
@@ -1897,12 +1979,12 @@ Lint/ToJSON:
|
|
1897
1979
|
|
1898
1980
|
Lint/TopLevelReturnWithArgument:
|
1899
1981
|
Description: 'This cop detects top level return statements with argument.'
|
1900
|
-
Enabled:
|
1982
|
+
Enabled: true
|
1901
1983
|
VersionAdded: '0.89'
|
1902
1984
|
|
1903
1985
|
Lint/TrailingCommaInAttributeDeclaration:
|
1904
1986
|
Description: 'This cop checks for trailing commas in attribute declarations.'
|
1905
|
-
Enabled:
|
1987
|
+
Enabled: true
|
1906
1988
|
VersionAdded: '0.90'
|
1907
1989
|
|
1908
1990
|
Lint/UnderscorePrefixedVariableName:
|
@@ -1916,6 +1998,11 @@ Lint/UnifiedInteger:
|
|
1916
1998
|
Enabled: true
|
1917
1999
|
VersionAdded: '0.43'
|
1918
2000
|
|
2001
|
+
Lint/UnmodifiedReduceAccumulator:
|
2002
|
+
Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
|
2003
|
+
Enabled: pending
|
2004
|
+
VersionAdded: '1.1'
|
2005
|
+
|
1919
2006
|
Lint/UnreachableCode:
|
1920
2007
|
Description: 'Unreachable code.'
|
1921
2008
|
Enabled: true
|
@@ -1923,7 +2010,7 @@ Lint/UnreachableCode:
|
|
1923
2010
|
|
1924
2011
|
Lint/UnreachableLoop:
|
1925
2012
|
Description: 'This cop checks for loops that will have at most one iteration.'
|
1926
|
-
Enabled:
|
2013
|
+
Enabled: true
|
1927
2014
|
VersionAdded: '0.89'
|
1928
2015
|
|
1929
2016
|
Lint/UnusedBlockArgument:
|
@@ -1982,7 +2069,7 @@ Lint/UselessElseWithoutRescue:
|
|
1982
2069
|
|
1983
2070
|
Lint/UselessMethodDefinition:
|
1984
2071
|
Description: 'Checks for useless method definitions.'
|
1985
|
-
Enabled:
|
2072
|
+
Enabled: true
|
1986
2073
|
VersionAdded: '0.90'
|
1987
2074
|
Safe: false
|
1988
2075
|
AllowComments: true
|
@@ -1990,13 +2077,14 @@ Lint/UselessMethodDefinition:
|
|
1990
2077
|
Lint/UselessSetterCall:
|
1991
2078
|
Description: 'Checks for useless setter call to a local variable.'
|
1992
2079
|
Enabled: true
|
2080
|
+
SafeAutoCorrect: false
|
1993
2081
|
VersionAdded: '0.13'
|
1994
|
-
VersionChanged: '
|
2082
|
+
VersionChanged: '1.2'
|
1995
2083
|
Safe: false
|
1996
2084
|
|
1997
2085
|
Lint/UselessTimes:
|
1998
2086
|
Description: 'Checks for useless `Integer#times` calls.'
|
1999
|
-
Enabled:
|
2087
|
+
Enabled: true
|
2000
2088
|
VersionAdded: '0.91'
|
2001
2089
|
Safe: false
|
2002
2090
|
|
@@ -2135,6 +2223,7 @@ Naming/BinaryOperatorParameterName:
|
|
2135
2223
|
StyleGuide: '#other-arg'
|
2136
2224
|
Enabled: true
|
2137
2225
|
VersionAdded: '0.50'
|
2226
|
+
VersionChanged: '1.2'
|
2138
2227
|
|
2139
2228
|
Naming/BlockParameterName:
|
2140
2229
|
Description: >-
|
@@ -2241,6 +2330,7 @@ Naming/HeredocDelimiterCase:
|
|
2241
2330
|
StyleGuide: '#heredoc-delimiters'
|
2242
2331
|
Enabled: true
|
2243
2332
|
VersionAdded: '0.50'
|
2333
|
+
VersionChanged: '1.2'
|
2244
2334
|
EnforcedStyle: uppercase
|
2245
2335
|
SupportedStyles:
|
2246
2336
|
- lowercase
|
@@ -2259,7 +2349,7 @@ Naming/MemoizedInstanceVariableName:
|
|
2259
2349
|
Memoized method name should match memo instance variable name.
|
2260
2350
|
Enabled: true
|
2261
2351
|
VersionAdded: '0.53'
|
2262
|
-
VersionChanged: '
|
2352
|
+
VersionChanged: '1.2'
|
2263
2353
|
EnforcedStyleForLeadingUnderscores: disallowed
|
2264
2354
|
SupportedStylesForLeadingUnderscores:
|
2265
2355
|
- disallowed
|
@@ -2357,14 +2447,19 @@ Naming/VariableName:
|
|
2357
2447
|
- camelCase
|
2358
2448
|
|
2359
2449
|
Naming/VariableNumber:
|
2360
|
-
Description: 'Use the configured style when numbering variables.'
|
2450
|
+
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
2451
|
+
StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
|
2361
2452
|
Enabled: true
|
2362
2453
|
VersionAdded: '0.50'
|
2454
|
+
VersionChanged: '1.3'
|
2363
2455
|
EnforcedStyle: normalcase
|
2364
2456
|
SupportedStyles:
|
2365
2457
|
- snake_case
|
2366
2458
|
- normalcase
|
2367
2459
|
- non_integer
|
2460
|
+
CheckMethodNames: true
|
2461
|
+
CheckSymbols: true
|
2462
|
+
AllowedIdentifiers: []
|
2368
2463
|
|
2369
2464
|
#################### Security ##############################
|
2370
2465
|
|
@@ -2395,9 +2490,10 @@ Security/MarshalLoad:
|
|
2395
2490
|
VersionAdded: '0.47'
|
2396
2491
|
|
2397
2492
|
Security/Open:
|
2398
|
-
Description: 'The use of Kernel#open
|
2493
|
+
Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
|
2399
2494
|
Enabled: true
|
2400
2495
|
VersionAdded: '0.53'
|
2496
|
+
VersionChanged: '1.0'
|
2401
2497
|
Safe: false
|
2402
2498
|
|
2403
2499
|
Security/YAMLLoad:
|
@@ -2424,7 +2520,7 @@ Style/AccessModifierDeclarations:
|
|
2424
2520
|
|
2425
2521
|
Style/AccessorGrouping:
|
2426
2522
|
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
2427
|
-
Enabled:
|
2523
|
+
Enabled: true
|
2428
2524
|
VersionAdded: '0.87'
|
2429
2525
|
EnforcedStyle: grouped
|
2430
2526
|
SupportedStyles:
|
@@ -2457,6 +2553,13 @@ Style/AndOr:
|
|
2457
2553
|
- always
|
2458
2554
|
- conditionals
|
2459
2555
|
|
2556
|
+
Style/ArgumentsForwarding:
|
2557
|
+
Description: 'Use arguments forwarding.'
|
2558
|
+
StyleGuide: '#arguments-forwarding'
|
2559
|
+
Enabled: pending
|
2560
|
+
AllowOnlyRestArgument: true
|
2561
|
+
VersionAdded: '1.1'
|
2562
|
+
|
2460
2563
|
Style/ArrayCoercion:
|
2461
2564
|
Description: >-
|
2462
2565
|
Use Array() instead of explicit Array check or [*var], when dealing
|
@@ -2513,7 +2616,7 @@ Style/BisectedAttrAccessor:
|
|
2513
2616
|
Description: >-
|
2514
2617
|
Checks for places where `attr_reader` and `attr_writer`
|
2515
2618
|
for the same method can be combined into single `attr_accessor`.
|
2516
|
-
Enabled:
|
2619
|
+
Enabled: true
|
2517
2620
|
VersionAdded: '0.87'
|
2518
2621
|
|
2519
2622
|
Style/BlockComments:
|
@@ -2652,7 +2755,7 @@ Style/CaseEquality:
|
|
2652
2755
|
Style/CaseLikeIf:
|
2653
2756
|
Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
2654
2757
|
StyleGuide: '#case-vs-if-else'
|
2655
|
-
Enabled:
|
2758
|
+
Enabled: true
|
2656
2759
|
Safe: false
|
2657
2760
|
VersionAdded: '0.88'
|
2658
2761
|
|
@@ -2702,6 +2805,16 @@ Style/ClassCheck:
|
|
2702
2805
|
- is_a?
|
2703
2806
|
- kind_of?
|
2704
2807
|
|
2808
|
+
Style/ClassEqualityComparison:
|
2809
|
+
Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
|
2810
|
+
StyleGuide: '#instance-of-vs-class-comparison'
|
2811
|
+
Enabled: true
|
2812
|
+
VersionAdded: '0.93'
|
2813
|
+
IgnoredMethods:
|
2814
|
+
- ==
|
2815
|
+
- equal?
|
2816
|
+
- eql?
|
2817
|
+
|
2705
2818
|
Style/ClassMethods:
|
2706
2819
|
Description: 'Use self when defining module/class methods.'
|
2707
2820
|
StyleGuide: '#def-self-class-methods'
|
@@ -2725,6 +2838,13 @@ Style/ClassVars:
|
|
2725
2838
|
Enabled: true
|
2726
2839
|
VersionAdded: '0.13'
|
2727
2840
|
|
2841
|
+
Style/CollectionCompact:
|
2842
|
+
Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
|
2843
|
+
Enabled: pending
|
2844
|
+
Safe: false
|
2845
|
+
VersionAdded: '1.2'
|
2846
|
+
VersionChanged: '1.3'
|
2847
|
+
|
2728
2848
|
# Align with the style guide.
|
2729
2849
|
Style/CollectionMethods:
|
2730
2850
|
Description: 'Preferred collection methods.'
|
@@ -2763,7 +2883,7 @@ Style/CombinableLoops:
|
|
2763
2883
|
Description: >-
|
2764
2884
|
Checks for places where multiple consecutive loops over the same data
|
2765
2885
|
can be combined into a single loop.
|
2766
|
-
Enabled:
|
2886
|
+
Enabled: true
|
2767
2887
|
Safe: false
|
2768
2888
|
VersionAdded: '0.90'
|
2769
2889
|
|
@@ -2788,17 +2908,18 @@ Style/CommandLiteral:
|
|
2788
2908
|
Style/CommentAnnotation:
|
2789
2909
|
Description: >-
|
2790
2910
|
Checks formatting of special comments
|
2791
|
-
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
2911
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE).
|
2792
2912
|
StyleGuide: '#annotate-keywords'
|
2793
2913
|
Enabled: true
|
2794
2914
|
VersionAdded: '0.10'
|
2795
|
-
VersionChanged: '
|
2915
|
+
VersionChanged: '1.3'
|
2796
2916
|
Keywords:
|
2797
2917
|
- TODO
|
2798
2918
|
- FIXME
|
2799
2919
|
- OPTIMIZE
|
2800
2920
|
- HACK
|
2801
2921
|
- REVIEW
|
2922
|
+
- NOTE
|
2802
2923
|
|
2803
2924
|
Style/CommentedKeyword:
|
2804
2925
|
Description: 'Do not place comments on the same line as certain keywords.'
|
@@ -2887,6 +3008,15 @@ Style/DisableCopsWithinSourceCodeDirective:
|
|
2887
3008
|
Enabled: false
|
2888
3009
|
VersionAdded: '0.82'
|
2889
3010
|
|
3011
|
+
Style/DocumentDynamicEvalDefinition:
|
3012
|
+
Description: >-
|
3013
|
+
When using `class_eval` (or other `eval`) with string interpolation,
|
3014
|
+
add a comment block showing its appearance if interpolated.
|
3015
|
+
StyleGuide: '#eval-comment-docs'
|
3016
|
+
Enabled: pending
|
3017
|
+
VersionAdded: '1.1'
|
3018
|
+
VersionChanged: '1.3'
|
3019
|
+
|
2890
3020
|
Style/Documentation:
|
2891
3021
|
Description: 'Document classes and non-namespace modules.'
|
2892
3022
|
Enabled: true
|
@@ -2914,7 +3044,7 @@ Style/DoubleNegation:
|
|
2914
3044
|
StyleGuide: '#no-bang-bang'
|
2915
3045
|
Enabled: true
|
2916
3046
|
VersionAdded: '0.19'
|
2917
|
-
VersionChanged: '
|
3047
|
+
VersionChanged: '1.2'
|
2918
3048
|
EnforcedStyle: allowed_in_returns
|
2919
3049
|
SafeAutoCorrect: false
|
2920
3050
|
SupportedStyles:
|
@@ -3016,7 +3146,7 @@ Style/ExplicitBlockArgument:
|
|
3016
3146
|
Consider using explicit block argument to avoid writing block literal
|
3017
3147
|
that just passes its arguments to another block.
|
3018
3148
|
StyleGuide: '#block-argument'
|
3019
|
-
Enabled:
|
3149
|
+
Enabled: true
|
3020
3150
|
# May change the yielding arity.
|
3021
3151
|
Safe: false
|
3022
3152
|
VersionAdded: '0.89'
|
@@ -3024,7 +3154,7 @@ Style/ExplicitBlockArgument:
|
|
3024
3154
|
Style/ExponentialNotation:
|
3025
3155
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
3026
3156
|
StyleGuide: '#exponential-notation'
|
3027
|
-
Enabled:
|
3157
|
+
Enabled: true
|
3028
3158
|
VersionAdded: '0.82'
|
3029
3159
|
EnforcedStyle: scientific
|
3030
3160
|
SupportedStyles:
|
@@ -3079,8 +3209,12 @@ Style/FormatStringToken:
|
|
3079
3209
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
3080
3210
|
- template
|
3081
3211
|
- unannotated
|
3212
|
+
# `MaxUnannotatedPlaceholdersAllowed` defines the number of `unannotated`
|
3213
|
+
# style token in a format string to be allowed when enforced style is not
|
3214
|
+
# `unannotated`.
|
3215
|
+
MaxUnannotatedPlaceholdersAllowed: 1
|
3082
3216
|
VersionAdded: '0.49'
|
3083
|
-
VersionChanged: '0
|
3217
|
+
VersionChanged: '1.0'
|
3084
3218
|
|
3085
3219
|
Style/FrozenStringLiteralComment:
|
3086
3220
|
Description: >-
|
@@ -3107,7 +3241,7 @@ Style/FrozenStringLiteralComment:
|
|
3107
3241
|
Style/GlobalStdStream:
|
3108
3242
|
Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
|
3109
3243
|
StyleGuide: '#global-stdout'
|
3110
|
-
Enabled:
|
3244
|
+
Enabled: true
|
3111
3245
|
VersionAdded: '0.89'
|
3112
3246
|
SafeAutoCorrect: false
|
3113
3247
|
|
@@ -3135,7 +3269,7 @@ Style/HashAsLastArrayItem:
|
|
3135
3269
|
Checks for presence or absence of braces around hash literal as a last
|
3136
3270
|
array item depending on configuration.
|
3137
3271
|
StyleGuide: '#hash-literal-as-last-array-item'
|
3138
|
-
Enabled:
|
3272
|
+
Enabled: true
|
3139
3273
|
VersionAdded: '0.88'
|
3140
3274
|
EnforcedStyle: braces
|
3141
3275
|
SupportedStyles:
|
@@ -3145,7 +3279,7 @@ Style/HashAsLastArrayItem:
|
|
3145
3279
|
Style/HashEachMethods:
|
3146
3280
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
3147
3281
|
StyleGuide: '#hash-each'
|
3148
|
-
Enabled:
|
3282
|
+
Enabled: true
|
3149
3283
|
VersionAdded: '0.80'
|
3150
3284
|
Safe: false
|
3151
3285
|
|
@@ -3153,7 +3287,7 @@ Style/HashLikeCase:
|
|
3153
3287
|
Description: >-
|
3154
3288
|
Checks for places where `case-when` represents a simple 1:1
|
3155
3289
|
mapping and can be replaced with a hash lookup.
|
3156
|
-
Enabled:
|
3290
|
+
Enabled: true
|
3157
3291
|
VersionAdded: '0.88'
|
3158
3292
|
# `MinBranchesCount` defines the number of branches `case` needs to have
|
3159
3293
|
# to trigger this cop
|
@@ -3184,14 +3318,14 @@ Style/HashSyntax:
|
|
3184
3318
|
|
3185
3319
|
Style/HashTransformKeys:
|
3186
3320
|
Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
|
3187
|
-
Enabled:
|
3321
|
+
Enabled: true
|
3188
3322
|
VersionAdded: '0.80'
|
3189
3323
|
VersionChanged: '0.90'
|
3190
3324
|
Safe: false
|
3191
3325
|
|
3192
3326
|
Style/HashTransformValues:
|
3193
3327
|
Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
|
3194
|
-
Enabled:
|
3328
|
+
Enabled: true
|
3195
3329
|
VersionAdded: '0.80'
|
3196
3330
|
VersionChanged: '0.90'
|
3197
3331
|
Safe: false
|
@@ -3209,6 +3343,7 @@ Style/IfInsideElse:
|
|
3209
3343
|
Enabled: true
|
3210
3344
|
AllowIfModifier: false
|
3211
3345
|
VersionAdded: '0.36'
|
3346
|
+
VersionChanged: '1.3'
|
3212
3347
|
|
3213
3348
|
Style/IfUnlessModifier:
|
3214
3349
|
Description: >-
|
@@ -3241,12 +3376,14 @@ Style/ImplicitRuntimeError:
|
|
3241
3376
|
VersionAdded: '0.41'
|
3242
3377
|
|
3243
3378
|
Style/InfiniteLoop:
|
3244
|
-
Description:
|
3379
|
+
Description: >-
|
3380
|
+
Use Kernel#loop for infinite loops.
|
3381
|
+
This cop is unsafe in the body may raise a `StopIteration` exception.
|
3382
|
+
Safe: false
|
3245
3383
|
StyleGuide: '#infinite-loop'
|
3246
3384
|
Enabled: true
|
3247
3385
|
VersionAdded: '0.26'
|
3248
3386
|
VersionChanged: '0.61'
|
3249
|
-
SafeAutoCorrect: true
|
3250
3387
|
|
3251
3388
|
Style/InlineComment:
|
3252
3389
|
Description: 'Avoid trailing inline comments.'
|
@@ -3298,7 +3435,7 @@ Style/IpAddresses:
|
|
3298
3435
|
Style/KeywordParametersOrder:
|
3299
3436
|
Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
|
3300
3437
|
StyleGuide: '#keyword-parameters-order'
|
3301
|
-
Enabled:
|
3438
|
+
Enabled: true
|
3302
3439
|
VersionAdded: '0.90'
|
3303
3440
|
|
3304
3441
|
Style/Lambda:
|
@@ -3500,6 +3637,7 @@ Style/MultipleComparison:
|
|
3500
3637
|
use Array#include? instead.
|
3501
3638
|
Enabled: true
|
3502
3639
|
VersionAdded: '0.49'
|
3640
|
+
VersionChanged: '1.1'
|
3503
3641
|
|
3504
3642
|
Style/MutableConstant:
|
3505
3643
|
Description: 'Do not assign mutable objects to constants.'
|
@@ -3534,6 +3672,13 @@ Style/NegatedIf:
|
|
3534
3672
|
- prefix
|
3535
3673
|
- postfix
|
3536
3674
|
|
3675
|
+
Style/NegatedIfElseCondition:
|
3676
|
+
Description: >-
|
3677
|
+
This cop checks for uses of `if-else` and ternary operators with a negated condition
|
3678
|
+
which can be simplified by inverting condition and swapping branches.
|
3679
|
+
Enabled: pending
|
3680
|
+
VersionAdded: '1.2'
|
3681
|
+
|
3537
3682
|
Style/NegatedUnless:
|
3538
3683
|
Description: 'Favor if over unless for negative conditions.'
|
3539
3684
|
StyleGuide: '#if-for-negatives'
|
@@ -3621,6 +3766,11 @@ Style/NilComparison:
|
|
3621
3766
|
- predicate
|
3622
3767
|
- comparison
|
3623
3768
|
|
3769
|
+
Style/NilLambda:
|
3770
|
+
Description: 'Prefer `-> {}` to `-> { nil }`.'
|
3771
|
+
Enabled: pending
|
3772
|
+
VersionAdded: '1.3'
|
3773
|
+
|
3624
3774
|
Style/NonNilCheck:
|
3625
3775
|
Description: 'Checks for redundant nil checks.'
|
3626
3776
|
StyleGuide: '#no-non-nil-checks'
|
@@ -3723,7 +3873,7 @@ Style/OptionalArguments:
|
|
3723
3873
|
Style/OptionalBooleanParameter:
|
3724
3874
|
Description: 'Use keyword arguments when defining method with boolean argument.'
|
3725
3875
|
StyleGuide: '#boolean-keyword-arguments'
|
3726
|
-
Enabled:
|
3876
|
+
Enabled: true
|
3727
3877
|
Safe: false
|
3728
3878
|
VersionAdded: '0.89'
|
3729
3879
|
AllowedMethods:
|
@@ -3770,7 +3920,7 @@ Style/PercentLiteralDelimiters:
|
|
3770
3920
|
'%r': '{}'
|
3771
3921
|
'%w': '[]'
|
3772
3922
|
'%W': '[]'
|
3773
|
-
VersionChanged: '0.48
|
3923
|
+
VersionChanged: '0.48'
|
3774
3924
|
|
3775
3925
|
Style/PercentQLiterals:
|
3776
3926
|
Description: 'Checks if uses of %Q/%q match the configured preference.'
|
@@ -3811,11 +3961,12 @@ Style/RaiseArgs:
|
|
3811
3961
|
StyleGuide: '#exception-class-messages'
|
3812
3962
|
Enabled: true
|
3813
3963
|
VersionAdded: '0.14'
|
3814
|
-
VersionChanged: '
|
3964
|
+
VersionChanged: '1.2'
|
3815
3965
|
EnforcedStyle: exploded
|
3816
3966
|
SupportedStyles:
|
3817
3967
|
- compact # raise Exception.new(msg)
|
3818
3968
|
- exploded # raise Exception, msg
|
3969
|
+
AllowedCompactTypes: []
|
3819
3970
|
|
3820
3971
|
Style/RandomWithOffset:
|
3821
3972
|
Description: >-
|
@@ -3827,7 +3978,7 @@ Style/RandomWithOffset:
|
|
3827
3978
|
|
3828
3979
|
Style/RedundantAssignment:
|
3829
3980
|
Description: 'Checks for redundant assignment before returning.'
|
3830
|
-
Enabled:
|
3981
|
+
Enabled: true
|
3831
3982
|
VersionAdded: '0.87'
|
3832
3983
|
|
3833
3984
|
Style/RedundantBegin:
|
@@ -3864,7 +4015,7 @@ Style/RedundantFetchBlock:
|
|
3864
4015
|
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
3865
4016
|
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
3866
4017
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
3867
|
-
Enabled:
|
4018
|
+
Enabled: true
|
3868
4019
|
Safe: false
|
3869
4020
|
# If enabled, this cop will autocorrect usages of
|
3870
4021
|
# `fetch` being called with block returning a constant.
|
@@ -3877,7 +4028,7 @@ Style/RedundantFileExtensionInRequire:
|
|
3877
4028
|
Checks for the presence of superfluous `.rb` extension in
|
3878
4029
|
the filename provided to `require` and `require_relative`.
|
3879
4030
|
StyleGuide: '#no-explicit-rb-to-require'
|
3880
|
-
Enabled:
|
4031
|
+
Enabled: true
|
3881
4032
|
VersionAdded: '0.88'
|
3882
4033
|
|
3883
4034
|
Style/RedundantFreeze:
|
@@ -3904,12 +4055,12 @@ Style/RedundantPercentQ:
|
|
3904
4055
|
|
3905
4056
|
Style/RedundantRegexpCharacterClass:
|
3906
4057
|
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
3907
|
-
Enabled:
|
4058
|
+
Enabled: true
|
3908
4059
|
VersionAdded: '0.85'
|
3909
4060
|
|
3910
4061
|
Style/RedundantRegexpEscape:
|
3911
4062
|
Description: 'Checks for redundant escapes in Regexps.'
|
3912
|
-
Enabled:
|
4063
|
+
Enabled: true
|
3913
4064
|
VersionAdded: '0.85'
|
3914
4065
|
|
3915
4066
|
Style/RedundantReturn:
|
@@ -3930,7 +4081,7 @@ Style/RedundantSelf:
|
|
3930
4081
|
|
3931
4082
|
Style/RedundantSelfAssignment:
|
3932
4083
|
Description: 'Checks for places where redundant assignments are made for in place modification methods.'
|
3933
|
-
Enabled:
|
4084
|
+
Enabled: true
|
3934
4085
|
Safe: false
|
3935
4086
|
VersionAdded: '0.90'
|
3936
4087
|
|
@@ -4058,7 +4209,7 @@ Style/SignalException:
|
|
4058
4209
|
|
4059
4210
|
Style/SingleArgumentDig:
|
4060
4211
|
Description: 'Avoid using single argument dig method.'
|
4061
|
-
Enabled:
|
4212
|
+
Enabled: true
|
4062
4213
|
VersionAdded: '0.89'
|
4063
4214
|
Safe: false
|
4064
4215
|
|
@@ -4085,7 +4236,7 @@ Style/SingleLineMethods:
|
|
4085
4236
|
|
4086
4237
|
Style/SlicingWithRange:
|
4087
4238
|
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
4088
|
-
Enabled:
|
4239
|
+
Enabled: true
|
4089
4240
|
VersionAdded: '0.83'
|
4090
4241
|
Safe: false
|
4091
4242
|
|
@@ -4093,7 +4244,7 @@ Style/SoleNestedConditional:
|
|
4093
4244
|
Description: >-
|
4094
4245
|
Finds sole nested conditional nodes
|
4095
4246
|
which can be merged into outer conditional node.
|
4096
|
-
Enabled:
|
4247
|
+
Enabled: true
|
4097
4248
|
VersionAdded: '0.89'
|
4098
4249
|
AllowModifier: false
|
4099
4250
|
|
@@ -4119,6 +4270,13 @@ Style/StabbyLambdaParentheses:
|
|
4119
4270
|
- require_parentheses
|
4120
4271
|
- require_no_parentheses
|
4121
4272
|
|
4273
|
+
Style/StaticClass:
|
4274
|
+
Description: 'Prefer modules to classes with only class methods.'
|
4275
|
+
StyleGuide: '#modules-vs-classes'
|
4276
|
+
Enabled: false
|
4277
|
+
Safe: false
|
4278
|
+
VersionAdded: '1.3'
|
4279
|
+
|
4122
4280
|
Style/StderrPuts:
|
4123
4281
|
Description: 'Use `warn` instead of `$stderr.puts`.'
|
4124
4282
|
StyleGuide: '#warn'
|
@@ -4128,7 +4286,7 @@ Style/StderrPuts:
|
|
4128
4286
|
Style/StringConcatenation:
|
4129
4287
|
Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
|
4130
4288
|
StyleGuide: '#string-interpolation'
|
4131
|
-
Enabled:
|
4289
|
+
Enabled: true
|
4132
4290
|
Safe: false
|
4133
4291
|
VersionAdded: '0.89'
|
4134
4292
|
|
@@ -4169,7 +4327,7 @@ Style/StringMethods:
|
|
4169
4327
|
Description: 'Checks if configured preferred methods are used over non-preferred.'
|
4170
4328
|
Enabled: false
|
4171
4329
|
VersionAdded: '0.34'
|
4172
|
-
VersionChanged: '0.34
|
4330
|
+
VersionChanged: '0.34'
|
4173
4331
|
# Mapping from undesired method to desired_method
|
4174
4332
|
# e.g. to use `to_sym` over `intern`:
|
4175
4333
|
#
|
@@ -4191,6 +4349,13 @@ Style/StructInheritance:
|
|
4191
4349
|
VersionAdded: '0.29'
|
4192
4350
|
VersionChanged: '0.86'
|
4193
4351
|
|
4352
|
+
Style/SwapValues:
|
4353
|
+
Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
|
4354
|
+
StyleGuide: '#values-swapping'
|
4355
|
+
Enabled: pending
|
4356
|
+
VersionAdded: '1.1'
|
4357
|
+
SafeAutoCorrect: false
|
4358
|
+
|
4194
4359
|
Style/SymbolArray:
|
4195
4360
|
Description: 'Use %i or %I for arrays of symbols.'
|
4196
4361
|
StyleGuide: '#percent-i'
|
data/lib/chefstyle/version.rb
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
module RuboCop
|
20
20
|
module Cop
|
21
21
|
module Chef
|
22
|
-
module
|
22
|
+
module Ruby
|
23
23
|
# Rubygems does not need to be required in a Gemspec. It's already loaded out of the box in Ruby now.
|
24
24
|
class GemspecRequireRubygems < Base
|
25
25
|
extend RuboCop::Cop::AutoCorrector
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chefstyle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.3.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.3.1
|
27
27
|
description:
|
28
28
|
email:
|
29
29
|
- oss@chef.io
|