chefstyle 1.4.0 → 1.5.0
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 +26 -0
- data/config/upstream.yml +183 -62
- data/lib/chefstyle.rb +0 -3
- 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 +3 -3
- metadata +4 -5
- data/lib/rubocop/monkey_patches/rescue_ensure_alignment.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd3f70cecc57964cb2e1d13845d9b020e6da508410a64325ad3dc0c0cb7fc9b7
|
4
|
+
data.tar.gz: 60d116b3d374493b84677536b88ac56d4b8641ff8069f488652f4dd04ed57b94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91ef2dc22fd2c69609cb95d322291aadcdd64053851b6a30e01b18706a62a90faeb1142fb3909b26bc119d4b27ca7001591ad5f42c80c3b1c8e5dbeb6ffce750
|
7
|
+
data.tar.gz: 6d163c53de2058f45ff13d1dffc9430e1f70d885404f2d63e30e4ee816c8743294e80878ebc628eef5c70529a88efe58604f06186f0c57a636a6b65023bafc2e
|
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
@@ -237,6 +237,8 @@ Lint/DuplicateHashKey:
|
|
237
237
|
Enabled: false
|
238
238
|
Lint/DuplicateMethods:
|
239
239
|
Enabled: false
|
240
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
241
|
+
Enabled: false
|
240
242
|
Lint/DuplicateRequire:
|
241
243
|
Enabled: false
|
242
244
|
Lint/DuplicateRescueException:
|
@@ -245,6 +247,8 @@ Lint/EachWithObjectArgument:
|
|
245
247
|
Enabled: false
|
246
248
|
Lint/ElseLayout:
|
247
249
|
Enabled: false
|
250
|
+
Lint/EmptyBlock:
|
251
|
+
Enabled: false
|
248
252
|
Lint/EmptyConditionalBody:
|
249
253
|
Enabled: false
|
250
254
|
Lint/EmptyEnsure:
|
@@ -269,6 +273,8 @@ Lint/FloatOutOfRange:
|
|
269
273
|
Enabled: false
|
270
274
|
Lint/FormatParameterMismatch:
|
271
275
|
Enabled: false
|
276
|
+
Lint/HashCompareByIdentity:
|
277
|
+
Enabled: false
|
272
278
|
Lint/HeredocMethodCallPosition:
|
273
279
|
Enabled: false
|
274
280
|
Lint/IdentityComparison:
|
@@ -301,6 +307,8 @@ Lint/NestedPercentLiteral:
|
|
301
307
|
Enabled: false
|
302
308
|
Lint/NextWithoutAccumulator:
|
303
309
|
Enabled: false
|
310
|
+
Lint/NoReturnInBeginEndBlocks:
|
311
|
+
Enabled: false
|
304
312
|
Lint/NonDeterministicRequireOrder:
|
305
313
|
Enabled: false
|
306
314
|
Lint/NonLocalExitFromIterator:
|
@@ -327,6 +335,8 @@ Lint/RedundantCopEnableDirective:
|
|
327
335
|
Enabled: false
|
328
336
|
Lint/RedundantRequireStatement:
|
329
337
|
Enabled: false
|
338
|
+
Lint/RedundantSafeNavigation:
|
339
|
+
Enabled: false
|
330
340
|
Lint/RedundantSplatExpansion:
|
331
341
|
Enabled: false
|
332
342
|
Lint/RedundantStringCoercion:
|
@@ -369,6 +379,8 @@ Lint/SuppressedException:
|
|
369
379
|
Enabled: false
|
370
380
|
Lint/Syntax:
|
371
381
|
Enabled: false
|
382
|
+
Lint/ToEnumArguments:
|
383
|
+
Enabled: false
|
372
384
|
Lint/ToJSON:
|
373
385
|
Enabled: false
|
374
386
|
Lint/TopLevelReturnWithArgument:
|
@@ -379,6 +391,8 @@ Lint/UnderscorePrefixedVariableName:
|
|
379
391
|
Enabled: false
|
380
392
|
Lint/UnifiedInteger:
|
381
393
|
Enabled: false
|
394
|
+
Lint/UnmodifiedReduceAccumulator:
|
395
|
+
Enabled: false
|
382
396
|
Lint/UnreachableCode:
|
383
397
|
Enabled: false
|
384
398
|
Lint/UnreachableLoop:
|
@@ -463,6 +477,8 @@ Style/Alias:
|
|
463
477
|
Enabled: false
|
464
478
|
Style/AndOr:
|
465
479
|
Enabled: false
|
480
|
+
Style/ArgumentsForwarding:
|
481
|
+
Enabled: false
|
466
482
|
Style/ArrayCoercion:
|
467
483
|
Enabled: false
|
468
484
|
Style/ArrayJoin:
|
@@ -493,12 +509,16 @@ Style/ClassAndModuleChildren:
|
|
493
509
|
Enabled: false
|
494
510
|
Style/ClassCheck:
|
495
511
|
Enabled: false
|
512
|
+
Style/ClassEqualityComparison:
|
513
|
+
Enabled: false
|
496
514
|
Style/ClassMethods:
|
497
515
|
Enabled: false
|
498
516
|
Style/ClassMethodsDefinitions:
|
499
517
|
Enabled: false
|
500
518
|
Style/ClassVars:
|
501
519
|
Enabled: false
|
520
|
+
Style/CollectionCompact:
|
521
|
+
Enabled: false
|
502
522
|
Style/CollectionMethods:
|
503
523
|
Enabled: false
|
504
524
|
Style/ColonMethodCall:
|
@@ -531,6 +551,8 @@ Style/DocumentationMethod:
|
|
531
551
|
Enabled: false
|
532
552
|
Style/Documentation:
|
533
553
|
Enabled: false
|
554
|
+
Style/DocumentDynamicEvalDefinition:
|
555
|
+
Enabled: false
|
534
556
|
Style/DoubleCopDisableDirective:
|
535
557
|
Enabled: false
|
536
558
|
Style/DoubleNegation:
|
@@ -671,6 +693,8 @@ Style/MutableConstant:
|
|
671
693
|
Enabled: false
|
672
694
|
Style/NegatedIf:
|
673
695
|
Enabled: false
|
696
|
+
Style/NegatedIfElseCondition:
|
697
|
+
Enabled: false
|
674
698
|
Style/NegatedUnless:
|
675
699
|
Enabled: false
|
676
700
|
Style/NegatedWhile:
|
@@ -801,6 +825,8 @@ Style/Strip:
|
|
801
825
|
Enabled: false
|
802
826
|
Style/StructInheritance:
|
803
827
|
Enabled: false
|
828
|
+
Style/SwapValues:
|
829
|
+
Enabled: false
|
804
830
|
Style/SymbolArray:
|
805
831
|
Enabled: false
|
806
832
|
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
|
@@ -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:
|
@@ -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,7 +1398,7 @@ 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
1403
|
|
1404
1404
|
Lint/ConstantResolution:
|
@@ -1423,7 +1423,7 @@ Lint/DeprecatedClassMethods:
|
|
1423
1423
|
|
1424
1424
|
Lint/DeprecatedOpenSSLConstant:
|
1425
1425
|
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
1426
|
-
Enabled:
|
1426
|
+
Enabled: true
|
1427
1427
|
VersionAdded: '0.84'
|
1428
1428
|
|
1429
1429
|
Lint/DisjunctiveAssignmentInConstructor:
|
@@ -1440,7 +1440,7 @@ Lint/DuplicateCaseCondition:
|
|
1440
1440
|
|
1441
1441
|
Lint/DuplicateElsifCondition:
|
1442
1442
|
Description: 'Do not repeat conditions used in if `elsif`.'
|
1443
|
-
Enabled:
|
1443
|
+
Enabled: true
|
1444
1444
|
VersionAdded: '0.88'
|
1445
1445
|
|
1446
1446
|
Lint/DuplicateHashKey:
|
@@ -1454,14 +1454,19 @@ Lint/DuplicateMethods:
|
|
1454
1454
|
Enabled: true
|
1455
1455
|
VersionAdded: '0.29'
|
1456
1456
|
|
1457
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
1458
|
+
Description: 'Checks for duplicate elements in Regexp character classes.'
|
1459
|
+
Enabled: pending
|
1460
|
+
VersionAdded: '1.1'
|
1461
|
+
|
1457
1462
|
Lint/DuplicateRequire:
|
1458
1463
|
Description: 'Check for duplicate `require`s and `require_relative`s.'
|
1459
|
-
Enabled:
|
1464
|
+
Enabled: true
|
1460
1465
|
VersionAdded: '0.90'
|
1461
1466
|
|
1462
1467
|
Lint/DuplicateRescueException:
|
1463
1468
|
Description: 'Checks that there are no repeated exceptions used in `rescue` expressions.'
|
1464
|
-
Enabled:
|
1469
|
+
Enabled: true
|
1465
1470
|
VersionAdded: '0.89'
|
1466
1471
|
|
1467
1472
|
Lint/EachWithObjectArgument:
|
@@ -1473,10 +1478,17 @@ Lint/ElseLayout:
|
|
1473
1478
|
Description: 'Check for odd code arrangement in an else block.'
|
1474
1479
|
Enabled: true
|
1475
1480
|
VersionAdded: '0.17'
|
1481
|
+
VersionChanged: '1.2'
|
1482
|
+
|
1483
|
+
Lint/EmptyBlock:
|
1484
|
+
Description: 'This cop checks for blocks without a body.'
|
1485
|
+
Enabled: pending
|
1486
|
+
VersionAdded: '1.1'
|
1487
|
+
AllowComments: true
|
1476
1488
|
|
1477
1489
|
Lint/EmptyConditionalBody:
|
1478
1490
|
Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.'
|
1479
|
-
Enabled:
|
1491
|
+
Enabled: true
|
1480
1492
|
AllowComments: true
|
1481
1493
|
VersionAdded: '0.89'
|
1482
1494
|
|
@@ -1493,7 +1505,7 @@ Lint/EmptyExpression:
|
|
1493
1505
|
|
1494
1506
|
Lint/EmptyFile:
|
1495
1507
|
Description: 'Enforces that Ruby source files are not empty.'
|
1496
|
-
Enabled:
|
1508
|
+
Enabled: true
|
1497
1509
|
AllowComments: true
|
1498
1510
|
VersionAdded: '0.90'
|
1499
1511
|
|
@@ -1531,7 +1543,7 @@ Lint/FlipFlop:
|
|
1531
1543
|
Lint/FloatComparison:
|
1532
1544
|
Description: 'Checks for the presence of precise comparison of floating point numbers.'
|
1533
1545
|
StyleGuide: '#float-comparison'
|
1534
|
-
Enabled:
|
1546
|
+
Enabled: true
|
1535
1547
|
VersionAdded: '0.89'
|
1536
1548
|
|
1537
1549
|
Lint/FloatOutOfRange:
|
@@ -1546,6 +1558,13 @@ Lint/FormatParameterMismatch:
|
|
1546
1558
|
Enabled: true
|
1547
1559
|
VersionAdded: '0.33'
|
1548
1560
|
|
1561
|
+
Lint/HashCompareByIdentity:
|
1562
|
+
Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
|
1563
|
+
StyleGuide: '#identity-comparison'
|
1564
|
+
Enabled: true
|
1565
|
+
Safe: false
|
1566
|
+
VersionAdded: '0.93'
|
1567
|
+
|
1549
1568
|
Lint/HeredocMethodCallPosition:
|
1550
1569
|
Description: >-
|
1551
1570
|
Checks for the ordering of a method call where
|
@@ -1556,7 +1575,7 @@ Lint/HeredocMethodCallPosition:
|
|
1556
1575
|
|
1557
1576
|
Lint/IdentityComparison:
|
1558
1577
|
Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
|
1559
|
-
Enabled:
|
1578
|
+
Enabled: true
|
1560
1579
|
StyleGuide: '#identity-comparison'
|
1561
1580
|
VersionAdded: '0.91'
|
1562
1581
|
|
@@ -1628,19 +1647,20 @@ Lint/MissingSuper:
|
|
1628
1647
|
Description: >-
|
1629
1648
|
This cop checks for the presence of constructors and lifecycle callbacks
|
1630
1649
|
without calls to `super`'.
|
1631
|
-
Enabled:
|
1650
|
+
Enabled: true
|
1632
1651
|
VersionAdded: '0.89'
|
1633
1652
|
|
1634
1653
|
Lint/MixedRegexpCaptureTypes:
|
1635
1654
|
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1636
|
-
Enabled:
|
1655
|
+
Enabled: true
|
1637
1656
|
VersionAdded: '0.85'
|
1638
1657
|
|
1639
1658
|
Lint/MultipleComparison:
|
1640
1659
|
Description: "Use `&&` operator to compare multiple values."
|
1641
1660
|
Enabled: true
|
1642
1661
|
VersionAdded: '0.47'
|
1643
|
-
VersionChanged: '
|
1662
|
+
VersionChanged: '1.1'
|
1663
|
+
AllowMethodComparison: true
|
1644
1664
|
|
1645
1665
|
Lint/NestedMethodDefinition:
|
1646
1666
|
Description: 'Do not use nested method definitions.'
|
@@ -1660,6 +1680,11 @@ Lint/NextWithoutAccumulator:
|
|
1660
1680
|
Enabled: true
|
1661
1681
|
VersionAdded: '0.36'
|
1662
1682
|
|
1683
|
+
Lint/NoReturnInBeginEndBlocks:
|
1684
|
+
Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
|
1685
|
+
Enabled: pending
|
1686
|
+
VersionAdded: '1.2'
|
1687
|
+
|
1663
1688
|
Lint/NonDeterministicRequireOrder:
|
1664
1689
|
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1665
1690
|
Enabled: true
|
@@ -1675,8 +1700,12 @@ Lint/NumberConversion:
|
|
1675
1700
|
Description: 'Checks unsafe usage of number conversion methods.'
|
1676
1701
|
Enabled: false
|
1677
1702
|
VersionAdded: '0.53'
|
1678
|
-
VersionChanged: '
|
1703
|
+
VersionChanged: '1.1'
|
1679
1704
|
SafeAutoCorrect: false
|
1705
|
+
IgnoredMethods: []
|
1706
|
+
IgnoredClasses:
|
1707
|
+
- Time
|
1708
|
+
- DateTime
|
1680
1709
|
|
1681
1710
|
Lint/OrderedMagicComments:
|
1682
1711
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
@@ -1685,7 +1714,7 @@ Lint/OrderedMagicComments:
|
|
1685
1714
|
|
1686
1715
|
Lint/OutOfRangeRegexpRef:
|
1687
1716
|
Description: 'Checks for out of range reference for Regexp because it always returns nil.'
|
1688
|
-
Enabled:
|
1717
|
+
Enabled: true
|
1689
1718
|
Safe: false
|
1690
1719
|
VersionAdded: '0.89'
|
1691
1720
|
|
@@ -1714,7 +1743,7 @@ Lint/PercentSymbolArray:
|
|
1714
1743
|
Lint/RaiseException:
|
1715
1744
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1716
1745
|
StyleGuide: '#raise-exception'
|
1717
|
-
Enabled:
|
1746
|
+
Enabled: true
|
1718
1747
|
Safe: false
|
1719
1748
|
VersionAdded: '0.81'
|
1720
1749
|
VersionChanged: '0.86'
|
@@ -1746,6 +1775,19 @@ Lint/RedundantRequireStatement:
|
|
1746
1775
|
Enabled: true
|
1747
1776
|
VersionAdded: '0.76'
|
1748
1777
|
|
1778
|
+
Lint/RedundantSafeNavigation:
|
1779
|
+
Description: 'Checks for redundant safe navigation calls.'
|
1780
|
+
Enabled: true
|
1781
|
+
VersionAdded: '0.93'
|
1782
|
+
AllowedMethods:
|
1783
|
+
- instance_of?
|
1784
|
+
- kind_of?
|
1785
|
+
- is_a?
|
1786
|
+
- eql?
|
1787
|
+
- respond_to?
|
1788
|
+
- equal?
|
1789
|
+
Safe: false
|
1790
|
+
|
1749
1791
|
Lint/RedundantSplatExpansion:
|
1750
1792
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
1751
1793
|
Enabled: true
|
@@ -1842,7 +1884,7 @@ Lint/ScriptPermission:
|
|
1842
1884
|
|
1843
1885
|
Lint/SelfAssignment:
|
1844
1886
|
Description: 'Checks for self-assignments.'
|
1845
|
-
Enabled:
|
1887
|
+
Enabled: true
|
1846
1888
|
VersionAdded: '0.89'
|
1847
1889
|
|
1848
1890
|
Lint/SendWithMixinArgument:
|
@@ -1873,7 +1915,7 @@ Lint/ShadowingOuterLocalVariable:
|
|
1873
1915
|
|
1874
1916
|
Lint/StructNewOverride:
|
1875
1917
|
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1876
|
-
Enabled:
|
1918
|
+
Enabled: true
|
1877
1919
|
VersionAdded: '0.81'
|
1878
1920
|
|
1879
1921
|
Lint/SuppressedException:
|
@@ -1890,6 +1932,11 @@ Lint/Syntax:
|
|
1890
1932
|
VersionAdded: '0.9'
|
1891
1933
|
|
1892
1934
|
|
1935
|
+
Lint/ToEnumArguments:
|
1936
|
+
Description: 'This cop ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
1937
|
+
Enabled: pending
|
1938
|
+
VersionAdded: '1.1'
|
1939
|
+
|
1893
1940
|
Lint/ToJSON:
|
1894
1941
|
Description: 'Ensure #to_json includes an optional argument.'
|
1895
1942
|
Enabled: true
|
@@ -1897,12 +1944,12 @@ Lint/ToJSON:
|
|
1897
1944
|
|
1898
1945
|
Lint/TopLevelReturnWithArgument:
|
1899
1946
|
Description: 'This cop detects top level return statements with argument.'
|
1900
|
-
Enabled:
|
1947
|
+
Enabled: true
|
1901
1948
|
VersionAdded: '0.89'
|
1902
1949
|
|
1903
1950
|
Lint/TrailingCommaInAttributeDeclaration:
|
1904
1951
|
Description: 'This cop checks for trailing commas in attribute declarations.'
|
1905
|
-
Enabled:
|
1952
|
+
Enabled: true
|
1906
1953
|
VersionAdded: '0.90'
|
1907
1954
|
|
1908
1955
|
Lint/UnderscorePrefixedVariableName:
|
@@ -1916,6 +1963,11 @@ Lint/UnifiedInteger:
|
|
1916
1963
|
Enabled: true
|
1917
1964
|
VersionAdded: '0.43'
|
1918
1965
|
|
1966
|
+
Lint/UnmodifiedReduceAccumulator:
|
1967
|
+
Description: Checks for `reduce` or `inject` blocks that do not update the accumulator each iteration.
|
1968
|
+
Enabled: pending
|
1969
|
+
VersionAdded: '1.1'
|
1970
|
+
|
1919
1971
|
Lint/UnreachableCode:
|
1920
1972
|
Description: 'Unreachable code.'
|
1921
1973
|
Enabled: true
|
@@ -1923,7 +1975,7 @@ Lint/UnreachableCode:
|
|
1923
1975
|
|
1924
1976
|
Lint/UnreachableLoop:
|
1925
1977
|
Description: 'This cop checks for loops that will have at most one iteration.'
|
1926
|
-
Enabled:
|
1978
|
+
Enabled: true
|
1927
1979
|
VersionAdded: '0.89'
|
1928
1980
|
|
1929
1981
|
Lint/UnusedBlockArgument:
|
@@ -1982,7 +2034,7 @@ Lint/UselessElseWithoutRescue:
|
|
1982
2034
|
|
1983
2035
|
Lint/UselessMethodDefinition:
|
1984
2036
|
Description: 'Checks for useless method definitions.'
|
1985
|
-
Enabled:
|
2037
|
+
Enabled: true
|
1986
2038
|
VersionAdded: '0.90'
|
1987
2039
|
Safe: false
|
1988
2040
|
AllowComments: true
|
@@ -1990,13 +2042,14 @@ Lint/UselessMethodDefinition:
|
|
1990
2042
|
Lint/UselessSetterCall:
|
1991
2043
|
Description: 'Checks for useless setter call to a local variable.'
|
1992
2044
|
Enabled: true
|
2045
|
+
SafeAutoCorrect: false
|
1993
2046
|
VersionAdded: '0.13'
|
1994
|
-
VersionChanged: '
|
2047
|
+
VersionChanged: '1.2'
|
1995
2048
|
Safe: false
|
1996
2049
|
|
1997
2050
|
Lint/UselessTimes:
|
1998
2051
|
Description: 'Checks for useless `Integer#times` calls.'
|
1999
|
-
Enabled:
|
2052
|
+
Enabled: true
|
2000
2053
|
VersionAdded: '0.91'
|
2001
2054
|
Safe: false
|
2002
2055
|
|
@@ -2135,6 +2188,7 @@ Naming/BinaryOperatorParameterName:
|
|
2135
2188
|
StyleGuide: '#other-arg'
|
2136
2189
|
Enabled: true
|
2137
2190
|
VersionAdded: '0.50'
|
2191
|
+
VersionChanged: '1.2'
|
2138
2192
|
|
2139
2193
|
Naming/BlockParameterName:
|
2140
2194
|
Description: >-
|
@@ -2241,6 +2295,7 @@ Naming/HeredocDelimiterCase:
|
|
2241
2295
|
StyleGuide: '#heredoc-delimiters'
|
2242
2296
|
Enabled: true
|
2243
2297
|
VersionAdded: '0.50'
|
2298
|
+
VersionChanged: '1.2'
|
2244
2299
|
EnforcedStyle: uppercase
|
2245
2300
|
SupportedStyles:
|
2246
2301
|
- lowercase
|
@@ -2259,7 +2314,7 @@ Naming/MemoizedInstanceVariableName:
|
|
2259
2314
|
Memoized method name should match memo instance variable name.
|
2260
2315
|
Enabled: true
|
2261
2316
|
VersionAdded: '0.53'
|
2262
|
-
VersionChanged: '
|
2317
|
+
VersionChanged: '1.2'
|
2263
2318
|
EnforcedStyleForLeadingUnderscores: disallowed
|
2264
2319
|
SupportedStylesForLeadingUnderscores:
|
2265
2320
|
- disallowed
|
@@ -2357,14 +2412,18 @@ Naming/VariableName:
|
|
2357
2412
|
- camelCase
|
2358
2413
|
|
2359
2414
|
Naming/VariableNumber:
|
2360
|
-
Description: 'Use the configured style when numbering variables.'
|
2415
|
+
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
2416
|
+
StyleGuide: '#snake-case-symbols-methods-vars-with-numbers'
|
2361
2417
|
Enabled: true
|
2362
2418
|
VersionAdded: '0.50'
|
2419
|
+
VersionChanged: '1.2'
|
2363
2420
|
EnforcedStyle: normalcase
|
2364
2421
|
SupportedStyles:
|
2365
2422
|
- snake_case
|
2366
2423
|
- normalcase
|
2367
2424
|
- non_integer
|
2425
|
+
CheckMethodNames: true
|
2426
|
+
CheckSymbols: true
|
2368
2427
|
|
2369
2428
|
#################### Security ##############################
|
2370
2429
|
|
@@ -2395,9 +2454,10 @@ Security/MarshalLoad:
|
|
2395
2454
|
VersionAdded: '0.47'
|
2396
2455
|
|
2397
2456
|
Security/Open:
|
2398
|
-
Description: 'The use of Kernel#open
|
2457
|
+
Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
|
2399
2458
|
Enabled: true
|
2400
2459
|
VersionAdded: '0.53'
|
2460
|
+
VersionChanged: '1.0'
|
2401
2461
|
Safe: false
|
2402
2462
|
|
2403
2463
|
Security/YAMLLoad:
|
@@ -2424,7 +2484,7 @@ Style/AccessModifierDeclarations:
|
|
2424
2484
|
|
2425
2485
|
Style/AccessorGrouping:
|
2426
2486
|
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
2427
|
-
Enabled:
|
2487
|
+
Enabled: true
|
2428
2488
|
VersionAdded: '0.87'
|
2429
2489
|
EnforcedStyle: grouped
|
2430
2490
|
SupportedStyles:
|
@@ -2457,13 +2517,20 @@ Style/AndOr:
|
|
2457
2517
|
- always
|
2458
2518
|
- conditionals
|
2459
2519
|
|
2520
|
+
Style/ArgumentsForwarding:
|
2521
|
+
Description: 'Use arguments forwarding.'
|
2522
|
+
StyleGuide: '#arguments-forwarding'
|
2523
|
+
Enabled: pending
|
2524
|
+
AllowOnlyRestArgument: true
|
2525
|
+
VersionAdded: '1.1'
|
2526
|
+
|
2460
2527
|
Style/ArrayCoercion:
|
2461
2528
|
Description: >-
|
2462
2529
|
Use Array() instead of explicit Array check or [*var], when dealing
|
2463
2530
|
with a variable you want to treat as an Array, but you're not certain it's an array.
|
2464
2531
|
StyleGuide: '#array-coercion'
|
2465
2532
|
Safe: false
|
2466
|
-
Enabled:
|
2533
|
+
Enabled: false
|
2467
2534
|
VersionAdded: '0.88'
|
2468
2535
|
|
2469
2536
|
Style/ArrayJoin:
|
@@ -2513,7 +2580,7 @@ Style/BisectedAttrAccessor:
|
|
2513
2580
|
Description: >-
|
2514
2581
|
Checks for places where `attr_reader` and `attr_writer`
|
2515
2582
|
for the same method can be combined into single `attr_accessor`.
|
2516
|
-
Enabled:
|
2583
|
+
Enabled: true
|
2517
2584
|
VersionAdded: '0.87'
|
2518
2585
|
|
2519
2586
|
Style/BlockComments:
|
@@ -2652,7 +2719,7 @@ Style/CaseEquality:
|
|
2652
2719
|
Style/CaseLikeIf:
|
2653
2720
|
Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
2654
2721
|
StyleGuide: '#case-vs-if-else'
|
2655
|
-
Enabled:
|
2722
|
+
Enabled: true
|
2656
2723
|
Safe: false
|
2657
2724
|
VersionAdded: '0.88'
|
2658
2725
|
|
@@ -2702,6 +2769,16 @@ Style/ClassCheck:
|
|
2702
2769
|
- is_a?
|
2703
2770
|
- kind_of?
|
2704
2771
|
|
2772
|
+
Style/ClassEqualityComparison:
|
2773
|
+
Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
|
2774
|
+
StyleGuide: '#instance-of-vs-class-comparison'
|
2775
|
+
Enabled: true
|
2776
|
+
VersionAdded: '0.93'
|
2777
|
+
IgnoredMethods:
|
2778
|
+
- ==
|
2779
|
+
- equal?
|
2780
|
+
- eql?
|
2781
|
+
|
2705
2782
|
Style/ClassMethods:
|
2706
2783
|
Description: 'Use self when defining module/class methods.'
|
2707
2784
|
StyleGuide: '#def-self-class-methods'
|
@@ -2725,6 +2802,11 @@ Style/ClassVars:
|
|
2725
2802
|
Enabled: true
|
2726
2803
|
VersionAdded: '0.13'
|
2727
2804
|
|
2805
|
+
Style/CollectionCompact:
|
2806
|
+
Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.'
|
2807
|
+
Enabled: pending
|
2808
|
+
VersionAdded: '1.2'
|
2809
|
+
|
2728
2810
|
# Align with the style guide.
|
2729
2811
|
Style/CollectionMethods:
|
2730
2812
|
Description: 'Preferred collection methods.'
|
@@ -2763,7 +2845,7 @@ Style/CombinableLoops:
|
|
2763
2845
|
Description: >-
|
2764
2846
|
Checks for places where multiple consecutive loops over the same data
|
2765
2847
|
can be combined into a single loop.
|
2766
|
-
Enabled:
|
2848
|
+
Enabled: true
|
2767
2849
|
Safe: false
|
2768
2850
|
VersionAdded: '0.90'
|
2769
2851
|
|
@@ -2863,7 +2945,8 @@ Style/DateTime:
|
|
2863
2945
|
StyleGuide: '#date--time'
|
2864
2946
|
Enabled: false
|
2865
2947
|
VersionAdded: '0.51'
|
2866
|
-
VersionChanged: '0.
|
2948
|
+
VersionChanged: '0.92'
|
2949
|
+
SafeAutoCorrect: false
|
2867
2950
|
AllowCoercion: false
|
2868
2951
|
|
2869
2952
|
Style/DefWithParentheses:
|
@@ -2886,6 +2969,14 @@ Style/DisableCopsWithinSourceCodeDirective:
|
|
2886
2969
|
Enabled: false
|
2887
2970
|
VersionAdded: '0.82'
|
2888
2971
|
|
2972
|
+
Style/DocumentDynamicEvalDefinition:
|
2973
|
+
Description: >-
|
2974
|
+
When using `class_eval` (or other `eval`) with string interpolation,
|
2975
|
+
add a comment block showing its appearance if interpolated.
|
2976
|
+
StyleGuide: '#eval-comment-docs'
|
2977
|
+
Enabled: pending
|
2978
|
+
VersionAdded: '1.1'
|
2979
|
+
|
2889
2980
|
Style/Documentation:
|
2890
2981
|
Description: 'Document classes and non-namespace modules.'
|
2891
2982
|
Enabled: true
|
@@ -2913,7 +3004,7 @@ Style/DoubleNegation:
|
|
2913
3004
|
StyleGuide: '#no-bang-bang'
|
2914
3005
|
Enabled: true
|
2915
3006
|
VersionAdded: '0.19'
|
2916
|
-
VersionChanged: '
|
3007
|
+
VersionChanged: '1.2'
|
2917
3008
|
EnforcedStyle: allowed_in_returns
|
2918
3009
|
SafeAutoCorrect: false
|
2919
3010
|
SupportedStyles:
|
@@ -3015,7 +3106,7 @@ Style/ExplicitBlockArgument:
|
|
3015
3106
|
Consider using explicit block argument to avoid writing block literal
|
3016
3107
|
that just passes its arguments to another block.
|
3017
3108
|
StyleGuide: '#block-argument'
|
3018
|
-
Enabled:
|
3109
|
+
Enabled: true
|
3019
3110
|
# May change the yielding arity.
|
3020
3111
|
Safe: false
|
3021
3112
|
VersionAdded: '0.89'
|
@@ -3023,7 +3114,7 @@ Style/ExplicitBlockArgument:
|
|
3023
3114
|
Style/ExponentialNotation:
|
3024
3115
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
3025
3116
|
StyleGuide: '#exponential-notation'
|
3026
|
-
Enabled:
|
3117
|
+
Enabled: true
|
3027
3118
|
VersionAdded: '0.82'
|
3028
3119
|
EnforcedStyle: scientific
|
3029
3120
|
SupportedStyles:
|
@@ -3078,8 +3169,12 @@ Style/FormatStringToken:
|
|
3078
3169
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
3079
3170
|
- template
|
3080
3171
|
- unannotated
|
3172
|
+
# `MaxUnannotatedPlaceholdersAllowed` defines the number of `unannotated`
|
3173
|
+
# style token in a format string to be allowed when enforced style is not
|
3174
|
+
# `unannotated`.
|
3175
|
+
MaxUnannotatedPlaceholdersAllowed: 1
|
3081
3176
|
VersionAdded: '0.49'
|
3082
|
-
VersionChanged: '0
|
3177
|
+
VersionChanged: '1.0'
|
3083
3178
|
|
3084
3179
|
Style/FrozenStringLiteralComment:
|
3085
3180
|
Description: >-
|
@@ -3106,7 +3201,7 @@ Style/FrozenStringLiteralComment:
|
|
3106
3201
|
Style/GlobalStdStream:
|
3107
3202
|
Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
|
3108
3203
|
StyleGuide: '#global-stdout'
|
3109
|
-
Enabled:
|
3204
|
+
Enabled: true
|
3110
3205
|
VersionAdded: '0.89'
|
3111
3206
|
SafeAutoCorrect: false
|
3112
3207
|
|
@@ -3134,7 +3229,7 @@ Style/HashAsLastArrayItem:
|
|
3134
3229
|
Checks for presence or absence of braces around hash literal as a last
|
3135
3230
|
array item depending on configuration.
|
3136
3231
|
StyleGuide: '#hash-literal-as-last-array-item'
|
3137
|
-
Enabled:
|
3232
|
+
Enabled: true
|
3138
3233
|
VersionAdded: '0.88'
|
3139
3234
|
EnforcedStyle: braces
|
3140
3235
|
SupportedStyles:
|
@@ -3144,7 +3239,7 @@ Style/HashAsLastArrayItem:
|
|
3144
3239
|
Style/HashEachMethods:
|
3145
3240
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
3146
3241
|
StyleGuide: '#hash-each'
|
3147
|
-
Enabled:
|
3242
|
+
Enabled: true
|
3148
3243
|
VersionAdded: '0.80'
|
3149
3244
|
Safe: false
|
3150
3245
|
|
@@ -3152,7 +3247,7 @@ Style/HashLikeCase:
|
|
3152
3247
|
Description: >-
|
3153
3248
|
Checks for places where `case-when` represents a simple 1:1
|
3154
3249
|
mapping and can be replaced with a hash lookup.
|
3155
|
-
Enabled:
|
3250
|
+
Enabled: true
|
3156
3251
|
VersionAdded: '0.88'
|
3157
3252
|
# `MinBranchesCount` defines the number of branches `case` needs to have
|
3158
3253
|
# to trigger this cop
|
@@ -3183,14 +3278,14 @@ Style/HashSyntax:
|
|
3183
3278
|
|
3184
3279
|
Style/HashTransformKeys:
|
3185
3280
|
Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
|
3186
|
-
Enabled:
|
3281
|
+
Enabled: true
|
3187
3282
|
VersionAdded: '0.80'
|
3188
3283
|
VersionChanged: '0.90'
|
3189
3284
|
Safe: false
|
3190
3285
|
|
3191
3286
|
Style/HashTransformValues:
|
3192
3287
|
Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
|
3193
|
-
Enabled:
|
3288
|
+
Enabled: true
|
3194
3289
|
VersionAdded: '0.80'
|
3195
3290
|
VersionChanged: '0.90'
|
3196
3291
|
Safe: false
|
@@ -3283,16 +3378,21 @@ Style/IpAddresses:
|
|
3283
3378
|
Description: "Don't include literal IP addresses in code."
|
3284
3379
|
Enabled: false
|
3285
3380
|
VersionAdded: '0.58'
|
3286
|
-
VersionChanged: '0.
|
3381
|
+
VersionChanged: '0.91'
|
3287
3382
|
# Allow addresses to be permitted
|
3288
3383
|
AllowedAddresses:
|
3289
3384
|
- "::"
|
3290
3385
|
# :: is a valid IPv6 address, but could potentially be legitimately in code
|
3386
|
+
Exclude:
|
3387
|
+
- '**/*.gemfile'
|
3388
|
+
- '**/Gemfile'
|
3389
|
+
- '**/gems.rb'
|
3390
|
+
- '**/*.gemspec'
|
3291
3391
|
|
3292
3392
|
Style/KeywordParametersOrder:
|
3293
3393
|
Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
|
3294
3394
|
StyleGuide: '#keyword-parameters-order'
|
3295
|
-
Enabled:
|
3395
|
+
Enabled: true
|
3296
3396
|
VersionAdded: '0.90'
|
3297
3397
|
|
3298
3398
|
Style/Lambda:
|
@@ -3494,6 +3594,7 @@ Style/MultipleComparison:
|
|
3494
3594
|
use Array#include? instead.
|
3495
3595
|
Enabled: true
|
3496
3596
|
VersionAdded: '0.49'
|
3597
|
+
VersionChanged: '1.1'
|
3497
3598
|
|
3498
3599
|
Style/MutableConstant:
|
3499
3600
|
Description: 'Do not assign mutable objects to constants.'
|
@@ -3528,6 +3629,13 @@ Style/NegatedIf:
|
|
3528
3629
|
- prefix
|
3529
3630
|
- postfix
|
3530
3631
|
|
3632
|
+
Style/NegatedIfElseCondition:
|
3633
|
+
Description: >-
|
3634
|
+
This cop checks for uses of `if-else` and ternary operators with a negated condition
|
3635
|
+
which can be simplified by inverting condition and swapping branches.
|
3636
|
+
Enabled: pending
|
3637
|
+
VersionAdded: '1.2'
|
3638
|
+
|
3531
3639
|
Style/NegatedUnless:
|
3532
3640
|
Description: 'Favor if over unless for negative conditions.'
|
3533
3641
|
StyleGuide: '#if-for-negatives'
|
@@ -3717,9 +3825,11 @@ Style/OptionalArguments:
|
|
3717
3825
|
Style/OptionalBooleanParameter:
|
3718
3826
|
Description: 'Use keyword arguments when defining method with boolean argument.'
|
3719
3827
|
StyleGuide: '#boolean-keyword-arguments'
|
3720
|
-
Enabled:
|
3828
|
+
Enabled: true
|
3721
3829
|
Safe: false
|
3722
3830
|
VersionAdded: '0.89'
|
3831
|
+
AllowedMethods:
|
3832
|
+
- respond_to_missing?
|
3723
3833
|
|
3724
3834
|
Style/OrAssignment:
|
3725
3835
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
@@ -3803,11 +3913,12 @@ Style/RaiseArgs:
|
|
3803
3913
|
StyleGuide: '#exception-class-messages'
|
3804
3914
|
Enabled: true
|
3805
3915
|
VersionAdded: '0.14'
|
3806
|
-
VersionChanged: '
|
3916
|
+
VersionChanged: '1.2'
|
3807
3917
|
EnforcedStyle: exploded
|
3808
3918
|
SupportedStyles:
|
3809
3919
|
- compact # raise Exception.new(msg)
|
3810
3920
|
- exploded # raise Exception, msg
|
3921
|
+
AllowedCompactTypes: []
|
3811
3922
|
|
3812
3923
|
Style/RandomWithOffset:
|
3813
3924
|
Description: >-
|
@@ -3819,7 +3930,7 @@ Style/RandomWithOffset:
|
|
3819
3930
|
|
3820
3931
|
Style/RedundantAssignment:
|
3821
3932
|
Description: 'Checks for redundant assignment before returning.'
|
3822
|
-
Enabled:
|
3933
|
+
Enabled: true
|
3823
3934
|
VersionAdded: '0.87'
|
3824
3935
|
|
3825
3936
|
Style/RedundantBegin:
|
@@ -3856,7 +3967,7 @@ Style/RedundantFetchBlock:
|
|
3856
3967
|
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
3857
3968
|
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
3858
3969
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
3859
|
-
Enabled:
|
3970
|
+
Enabled: true
|
3860
3971
|
Safe: false
|
3861
3972
|
# If enabled, this cop will autocorrect usages of
|
3862
3973
|
# `fetch` being called with block returning a constant.
|
@@ -3869,7 +3980,7 @@ Style/RedundantFileExtensionInRequire:
|
|
3869
3980
|
Checks for the presence of superfluous `.rb` extension in
|
3870
3981
|
the filename provided to `require` and `require_relative`.
|
3871
3982
|
StyleGuide: '#no-explicit-rb-to-require'
|
3872
|
-
Enabled:
|
3983
|
+
Enabled: true
|
3873
3984
|
VersionAdded: '0.88'
|
3874
3985
|
|
3875
3986
|
Style/RedundantFreeze:
|
@@ -3896,12 +4007,12 @@ Style/RedundantPercentQ:
|
|
3896
4007
|
|
3897
4008
|
Style/RedundantRegexpCharacterClass:
|
3898
4009
|
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
3899
|
-
Enabled:
|
4010
|
+
Enabled: true
|
3900
4011
|
VersionAdded: '0.85'
|
3901
4012
|
|
3902
4013
|
Style/RedundantRegexpEscape:
|
3903
4014
|
Description: 'Checks for redundant escapes in Regexps.'
|
3904
|
-
Enabled:
|
4015
|
+
Enabled: true
|
3905
4016
|
VersionAdded: '0.85'
|
3906
4017
|
|
3907
4018
|
Style/RedundantReturn:
|
@@ -3922,7 +4033,7 @@ Style/RedundantSelf:
|
|
3922
4033
|
|
3923
4034
|
Style/RedundantSelfAssignment:
|
3924
4035
|
Description: 'Checks for places where redundant assignments are made for in place modification methods.'
|
3925
|
-
Enabled:
|
4036
|
+
Enabled: true
|
3926
4037
|
Safe: false
|
3927
4038
|
VersionAdded: '0.90'
|
3928
4039
|
|
@@ -3988,6 +4099,8 @@ Style/SafeNavigation:
|
|
3988
4099
|
This cop transforms usages of a method call safeguarded by
|
3989
4100
|
a check for the existence of the object to
|
3990
4101
|
safe navigation (`&.`).
|
4102
|
+
Auto-correction is unsafe as it assumes the object will
|
4103
|
+
be `nil` or truthy, but never `false`.
|
3991
4104
|
Enabled: true
|
3992
4105
|
VersionAdded: '0.43'
|
3993
4106
|
VersionChanged: '0.77'
|
@@ -4000,6 +4113,7 @@ Style/SafeNavigation:
|
|
4000
4113
|
- presence
|
4001
4114
|
- try
|
4002
4115
|
- try!
|
4116
|
+
SafeAutoCorrect: false
|
4003
4117
|
|
4004
4118
|
Style/Sample:
|
4005
4119
|
Description: >-
|
@@ -4047,7 +4161,7 @@ Style/SignalException:
|
|
4047
4161
|
|
4048
4162
|
Style/SingleArgumentDig:
|
4049
4163
|
Description: 'Avoid using single argument dig method.'
|
4050
|
-
Enabled:
|
4164
|
+
Enabled: true
|
4051
4165
|
VersionAdded: '0.89'
|
4052
4166
|
Safe: false
|
4053
4167
|
|
@@ -4074,7 +4188,7 @@ Style/SingleLineMethods:
|
|
4074
4188
|
|
4075
4189
|
Style/SlicingWithRange:
|
4076
4190
|
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
4077
|
-
Enabled:
|
4191
|
+
Enabled: true
|
4078
4192
|
VersionAdded: '0.83'
|
4079
4193
|
Safe: false
|
4080
4194
|
|
@@ -4082,7 +4196,7 @@ Style/SoleNestedConditional:
|
|
4082
4196
|
Description: >-
|
4083
4197
|
Finds sole nested conditional nodes
|
4084
4198
|
which can be merged into outer conditional node.
|
4085
|
-
Enabled:
|
4199
|
+
Enabled: true
|
4086
4200
|
VersionAdded: '0.89'
|
4087
4201
|
AllowModifier: false
|
4088
4202
|
|
@@ -4117,7 +4231,7 @@ Style/StderrPuts:
|
|
4117
4231
|
Style/StringConcatenation:
|
4118
4232
|
Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
|
4119
4233
|
StyleGuide: '#string-interpolation'
|
4120
|
-
Enabled:
|
4234
|
+
Enabled: true
|
4121
4235
|
Safe: false
|
4122
4236
|
VersionAdded: '0.89'
|
4123
4237
|
|
@@ -4180,6 +4294,13 @@ Style/StructInheritance:
|
|
4180
4294
|
VersionAdded: '0.29'
|
4181
4295
|
VersionChanged: '0.86'
|
4182
4296
|
|
4297
|
+
Style/SwapValues:
|
4298
|
+
Description: 'This cop enforces the use of shorthand-style swapping of 2 variables.'
|
4299
|
+
StyleGuide: '#values-swapping'
|
4300
|
+
Enabled: pending
|
4301
|
+
VersionAdded: '1.1'
|
4302
|
+
SafeAutoCorrect: false
|
4303
|
+
|
4183
4304
|
Style/SymbolArray:
|
4184
4305
|
Description: 'Use %i or %I for arrays of symbols.'
|
4185
4306
|
StyleGuide: '#percent-i'
|
data/lib/chefstyle.rb
CHANGED
@@ -5,9 +5,6 @@ require_relative "chefstyle/version"
|
|
5
5
|
gem "rubocop", "= #{Chefstyle::RUBOCOP_VERSION}"
|
6
6
|
require "rubocop"
|
7
7
|
|
8
|
-
# @TODO remove this monkeypatch after we upgrade from 0.91.0
|
9
|
-
require_relative "rubocop/monkey_patches/rescue_ensure_alignment"
|
10
|
-
|
11
8
|
module RuboCop
|
12
9
|
class ConfigLoader
|
13
10
|
RUBOCOP_HOME.gsub!(
|
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
|
@@ -19,7 +19,7 @@
|
|
19
19
|
module RuboCop
|
20
20
|
module Cop
|
21
21
|
module Chef
|
22
|
-
module
|
22
|
+
module Ruby
|
23
23
|
# Rubygems is VERY slow to require gems even if they've already been loaded. To work around this
|
24
24
|
# wrap your require statement with an `if defined?()` check.
|
25
25
|
#
|
@@ -34,7 +34,7 @@ module RuboCop
|
|
34
34
|
"base64" => "Base64",
|
35
35
|
"benchmark" => "Benchmark",
|
36
36
|
"cgi" => "CGI",
|
37
|
-
"chef-utils" => "ChefUtils",
|
37
|
+
"chef-utils" => "ChefUtils::CANARY",
|
38
38
|
"chef-utils/dist" => "ChefUtils::Dist",
|
39
39
|
"csv" => "CSV",
|
40
40
|
"digest" => "Digest",
|
@@ -95,10 +95,10 @@ module RuboCop
|
|
95
95
|
"win32/registry" => "Win32::Registry",
|
96
96
|
"win32ole" => "WIN32OLE",
|
97
97
|
"winrm" => "WinRM::Connection",
|
98
|
-
"yaml" => "YAML",
|
99
98
|
"yard" => "YARD",
|
100
99
|
"zip" => "Zip",
|
101
100
|
"zlib" => "Zlib",
|
101
|
+
"pastel" => "Pastel",
|
102
102
|
}.freeze
|
103
103
|
|
104
104
|
def_node_matcher :require?, <<-PATTERN
|
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.0
|
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-05 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.2.0
|
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.2.0
|
27
27
|
description:
|
28
28
|
email:
|
29
29
|
- oss@chef.io
|
@@ -46,7 +46,6 @@ files:
|
|
46
46
|
- lib/rubocop/cop/chef/ruby/require_net_https.rb
|
47
47
|
- lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb
|
48
48
|
- lib/rubocop/cop/chef/ruby/unless_defined_require.rb
|
49
|
-
- lib/rubocop/monkey_patches/rescue_ensure_alignment.rb
|
50
49
|
homepage: https://github.com/chef/chefstyle
|
51
50
|
licenses:
|
52
51
|
- Apache-2.0
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
module RuboCop
|
3
|
-
module Cop
|
4
|
-
module Layout
|
5
|
-
class RescueEnsureAlignment < Base
|
6
|
-
# @TODO remove this monkeypatch after we upgrade from RuboCop 0.91.0
|
7
|
-
def begin_end_alignment_style
|
8
|
-
# FIXME: Workaround for pending status for `Layout/BeginEndAlignment` cop
|
9
|
-
# When RuboCop 1.0 is released, please replace it with the following condition.
|
10
|
-
#
|
11
|
-
# config.for_cop('Layout/BeginEndAlignment')['Enabled'] &&
|
12
|
-
# config.for_cop('Layout/BeginEndAlignment')['EnforcedStyleAlignWith']
|
13
|
-
if config.for_all_cops["NewCops"] == "enable" ||
|
14
|
-
config.for_cop("Layout/BeginEndAlignment")["Enabled"] &&
|
15
|
-
config.for_cop("Layout/BeginEndAlignment")["Enabled"] != "pending"
|
16
|
-
config.for_cop("Layout/BeginEndAlignment")["EnforcedStyleAlignWith"]
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|