chefstyle 1.4.5 → 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 +20 -4
- data/config/disable_all.yml +20 -0
- data/config/upstream.yml +142 -62
- 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: 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
@@ -669,26 +669,42 @@ Style/ExpandPathArguments:
|
|
669
669
|
Lint/RedundantSafeNavigation:
|
670
670
|
Enabled: true
|
671
671
|
|
672
|
-
|
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:
|
673
689
|
Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
|
674
690
|
Enabled: true
|
675
691
|
VersionAdded: '1.3.0'
|
676
692
|
|
677
|
-
|
693
|
+
Chef/Ruby/UnlessDefinedRequire:
|
678
694
|
Description: Workaround RubyGems' slow requires by only running require if the constant isn't already defined
|
679
695
|
Enabled: true
|
680
696
|
VersionAdded: '1.3.0'
|
681
697
|
Include:
|
682
698
|
- 'lib/**/*'
|
683
699
|
|
684
|
-
|
700
|
+
Chef/Ruby/GemspecRequireRubygems:
|
685
701
|
Description: Rubygems does not need to be required in a Gemspec
|
686
702
|
Enabled: true
|
687
703
|
VersionAdded: '1.3.0'
|
688
704
|
Include:
|
689
705
|
- '**/*.gemspec'
|
690
706
|
|
691
|
-
|
707
|
+
Chef/Ruby/RequireNetHttps:
|
692
708
|
Description: net/https is deprecated and just includes net/http and openssl. We should include those directly instead
|
693
709
|
Enabled: true
|
694
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:
|
@@ -303,6 +307,8 @@ Lint/NestedPercentLiteral:
|
|
303
307
|
Enabled: false
|
304
308
|
Lint/NextWithoutAccumulator:
|
305
309
|
Enabled: false
|
310
|
+
Lint/NoReturnInBeginEndBlocks:
|
311
|
+
Enabled: false
|
306
312
|
Lint/NonDeterministicRequireOrder:
|
307
313
|
Enabled: false
|
308
314
|
Lint/NonLocalExitFromIterator:
|
@@ -373,6 +379,8 @@ Lint/SuppressedException:
|
|
373
379
|
Enabled: false
|
374
380
|
Lint/Syntax:
|
375
381
|
Enabled: false
|
382
|
+
Lint/ToEnumArguments:
|
383
|
+
Enabled: false
|
376
384
|
Lint/ToJSON:
|
377
385
|
Enabled: false
|
378
386
|
Lint/TopLevelReturnWithArgument:
|
@@ -383,6 +391,8 @@ Lint/UnderscorePrefixedVariableName:
|
|
383
391
|
Enabled: false
|
384
392
|
Lint/UnifiedInteger:
|
385
393
|
Enabled: false
|
394
|
+
Lint/UnmodifiedReduceAccumulator:
|
395
|
+
Enabled: false
|
386
396
|
Lint/UnreachableCode:
|
387
397
|
Enabled: false
|
388
398
|
Lint/UnreachableLoop:
|
@@ -467,6 +477,8 @@ Style/Alias:
|
|
467
477
|
Enabled: false
|
468
478
|
Style/AndOr:
|
469
479
|
Enabled: false
|
480
|
+
Style/ArgumentsForwarding:
|
481
|
+
Enabled: false
|
470
482
|
Style/ArrayCoercion:
|
471
483
|
Enabled: false
|
472
484
|
Style/ArrayJoin:
|
@@ -505,6 +517,8 @@ Style/ClassMethodsDefinitions:
|
|
505
517
|
Enabled: false
|
506
518
|
Style/ClassVars:
|
507
519
|
Enabled: false
|
520
|
+
Style/CollectionCompact:
|
521
|
+
Enabled: false
|
508
522
|
Style/CollectionMethods:
|
509
523
|
Enabled: false
|
510
524
|
Style/ColonMethodCall:
|
@@ -537,6 +551,8 @@ Style/DocumentationMethod:
|
|
537
551
|
Enabled: false
|
538
552
|
Style/Documentation:
|
539
553
|
Enabled: false
|
554
|
+
Style/DocumentDynamicEvalDefinition:
|
555
|
+
Enabled: false
|
540
556
|
Style/DoubleCopDisableDirective:
|
541
557
|
Enabled: false
|
542
558
|
Style/DoubleNegation:
|
@@ -677,6 +693,8 @@ Style/MutableConstant:
|
|
677
693
|
Enabled: false
|
678
694
|
Style/NegatedIf:
|
679
695
|
Enabled: false
|
696
|
+
Style/NegatedIfElseCondition:
|
697
|
+
Enabled: false
|
680
698
|
Style/NegatedUnless:
|
681
699
|
Enabled: false
|
682
700
|
Style/NegatedWhile:
|
@@ -807,6 +825,8 @@ Style/Strip:
|
|
807
825
|
Enabled: false
|
808
826
|
Style/StructInheritance:
|
809
827
|
Enabled: false
|
828
|
+
Style/SwapValues:
|
829
|
+
Enabled: false
|
810
830
|
Style/SymbolArray:
|
811
831
|
Enabled: false
|
812
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:
|
@@ -1549,7 +1561,7 @@ Lint/FormatParameterMismatch:
|
|
1549
1561
|
Lint/HashCompareByIdentity:
|
1550
1562
|
Description: 'Prefer using `Hash#compare_by_identity` than using `object_id` for keys.'
|
1551
1563
|
StyleGuide: '#identity-comparison'
|
1552
|
-
Enabled:
|
1564
|
+
Enabled: true
|
1553
1565
|
Safe: false
|
1554
1566
|
VersionAdded: '0.93'
|
1555
1567
|
|
@@ -1563,7 +1575,7 @@ Lint/HeredocMethodCallPosition:
|
|
1563
1575
|
|
1564
1576
|
Lint/IdentityComparison:
|
1565
1577
|
Description: 'Prefer `equal?` over `==` when comparing `object_id`.'
|
1566
|
-
Enabled:
|
1578
|
+
Enabled: true
|
1567
1579
|
StyleGuide: '#identity-comparison'
|
1568
1580
|
VersionAdded: '0.91'
|
1569
1581
|
|
@@ -1635,19 +1647,20 @@ Lint/MissingSuper:
|
|
1635
1647
|
Description: >-
|
1636
1648
|
This cop checks for the presence of constructors and lifecycle callbacks
|
1637
1649
|
without calls to `super`'.
|
1638
|
-
Enabled:
|
1650
|
+
Enabled: true
|
1639
1651
|
VersionAdded: '0.89'
|
1640
1652
|
|
1641
1653
|
Lint/MixedRegexpCaptureTypes:
|
1642
1654
|
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1643
|
-
Enabled:
|
1655
|
+
Enabled: true
|
1644
1656
|
VersionAdded: '0.85'
|
1645
1657
|
|
1646
1658
|
Lint/MultipleComparison:
|
1647
1659
|
Description: "Use `&&` operator to compare multiple values."
|
1648
1660
|
Enabled: true
|
1649
1661
|
VersionAdded: '0.47'
|
1650
|
-
VersionChanged: '
|
1662
|
+
VersionChanged: '1.1'
|
1663
|
+
AllowMethodComparison: true
|
1651
1664
|
|
1652
1665
|
Lint/NestedMethodDefinition:
|
1653
1666
|
Description: 'Do not use nested method definitions.'
|
@@ -1667,6 +1680,11 @@ Lint/NextWithoutAccumulator:
|
|
1667
1680
|
Enabled: true
|
1668
1681
|
VersionAdded: '0.36'
|
1669
1682
|
|
1683
|
+
Lint/NoReturnInBeginEndBlocks:
|
1684
|
+
Description: 'Do not `return` inside `begin..end` blocks in assignment contexts.'
|
1685
|
+
Enabled: pending
|
1686
|
+
VersionAdded: '1.2'
|
1687
|
+
|
1670
1688
|
Lint/NonDeterministicRequireOrder:
|
1671
1689
|
Description: 'Always sort arrays returned by Dir.glob when requiring files.'
|
1672
1690
|
Enabled: true
|
@@ -1682,8 +1700,12 @@ Lint/NumberConversion:
|
|
1682
1700
|
Description: 'Checks unsafe usage of number conversion methods.'
|
1683
1701
|
Enabled: false
|
1684
1702
|
VersionAdded: '0.53'
|
1685
|
-
VersionChanged: '
|
1703
|
+
VersionChanged: '1.1'
|
1686
1704
|
SafeAutoCorrect: false
|
1705
|
+
IgnoredMethods: []
|
1706
|
+
IgnoredClasses:
|
1707
|
+
- Time
|
1708
|
+
- DateTime
|
1687
1709
|
|
1688
1710
|
Lint/OrderedMagicComments:
|
1689
1711
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
@@ -1692,7 +1714,7 @@ Lint/OrderedMagicComments:
|
|
1692
1714
|
|
1693
1715
|
Lint/OutOfRangeRegexpRef:
|
1694
1716
|
Description: 'Checks for out of range reference for Regexp because it always returns nil.'
|
1695
|
-
Enabled:
|
1717
|
+
Enabled: true
|
1696
1718
|
Safe: false
|
1697
1719
|
VersionAdded: '0.89'
|
1698
1720
|
|
@@ -1721,7 +1743,7 @@ Lint/PercentSymbolArray:
|
|
1721
1743
|
Lint/RaiseException:
|
1722
1744
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1723
1745
|
StyleGuide: '#raise-exception'
|
1724
|
-
Enabled:
|
1746
|
+
Enabled: true
|
1725
1747
|
Safe: false
|
1726
1748
|
VersionAdded: '0.81'
|
1727
1749
|
VersionChanged: '0.86'
|
@@ -1755,7 +1777,7 @@ Lint/RedundantRequireStatement:
|
|
1755
1777
|
|
1756
1778
|
Lint/RedundantSafeNavigation:
|
1757
1779
|
Description: 'Checks for redundant safe navigation calls.'
|
1758
|
-
Enabled:
|
1780
|
+
Enabled: true
|
1759
1781
|
VersionAdded: '0.93'
|
1760
1782
|
AllowedMethods:
|
1761
1783
|
- instance_of?
|
@@ -1862,7 +1884,7 @@ Lint/ScriptPermission:
|
|
1862
1884
|
|
1863
1885
|
Lint/SelfAssignment:
|
1864
1886
|
Description: 'Checks for self-assignments.'
|
1865
|
-
Enabled:
|
1887
|
+
Enabled: true
|
1866
1888
|
VersionAdded: '0.89'
|
1867
1889
|
|
1868
1890
|
Lint/SendWithMixinArgument:
|
@@ -1893,7 +1915,7 @@ Lint/ShadowingOuterLocalVariable:
|
|
1893
1915
|
|
1894
1916
|
Lint/StructNewOverride:
|
1895
1917
|
Description: 'Disallow overriding the `Struct` built-in methods via `Struct.new`.'
|
1896
|
-
Enabled:
|
1918
|
+
Enabled: true
|
1897
1919
|
VersionAdded: '0.81'
|
1898
1920
|
|
1899
1921
|
Lint/SuppressedException:
|
@@ -1910,6 +1932,11 @@ Lint/Syntax:
|
|
1910
1932
|
VersionAdded: '0.9'
|
1911
1933
|
|
1912
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
|
+
|
1913
1940
|
Lint/ToJSON:
|
1914
1941
|
Description: 'Ensure #to_json includes an optional argument.'
|
1915
1942
|
Enabled: true
|
@@ -1917,12 +1944,12 @@ Lint/ToJSON:
|
|
1917
1944
|
|
1918
1945
|
Lint/TopLevelReturnWithArgument:
|
1919
1946
|
Description: 'This cop detects top level return statements with argument.'
|
1920
|
-
Enabled:
|
1947
|
+
Enabled: true
|
1921
1948
|
VersionAdded: '0.89'
|
1922
1949
|
|
1923
1950
|
Lint/TrailingCommaInAttributeDeclaration:
|
1924
1951
|
Description: 'This cop checks for trailing commas in attribute declarations.'
|
1925
|
-
Enabled:
|
1952
|
+
Enabled: true
|
1926
1953
|
VersionAdded: '0.90'
|
1927
1954
|
|
1928
1955
|
Lint/UnderscorePrefixedVariableName:
|
@@ -1936,6 +1963,11 @@ Lint/UnifiedInteger:
|
|
1936
1963
|
Enabled: true
|
1937
1964
|
VersionAdded: '0.43'
|
1938
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
|
+
|
1939
1971
|
Lint/UnreachableCode:
|
1940
1972
|
Description: 'Unreachable code.'
|
1941
1973
|
Enabled: true
|
@@ -1943,7 +1975,7 @@ Lint/UnreachableCode:
|
|
1943
1975
|
|
1944
1976
|
Lint/UnreachableLoop:
|
1945
1977
|
Description: 'This cop checks for loops that will have at most one iteration.'
|
1946
|
-
Enabled:
|
1978
|
+
Enabled: true
|
1947
1979
|
VersionAdded: '0.89'
|
1948
1980
|
|
1949
1981
|
Lint/UnusedBlockArgument:
|
@@ -2002,7 +2034,7 @@ Lint/UselessElseWithoutRescue:
|
|
2002
2034
|
|
2003
2035
|
Lint/UselessMethodDefinition:
|
2004
2036
|
Description: 'Checks for useless method definitions.'
|
2005
|
-
Enabled:
|
2037
|
+
Enabled: true
|
2006
2038
|
VersionAdded: '0.90'
|
2007
2039
|
Safe: false
|
2008
2040
|
AllowComments: true
|
@@ -2010,13 +2042,14 @@ Lint/UselessMethodDefinition:
|
|
2010
2042
|
Lint/UselessSetterCall:
|
2011
2043
|
Description: 'Checks for useless setter call to a local variable.'
|
2012
2044
|
Enabled: true
|
2045
|
+
SafeAutoCorrect: false
|
2013
2046
|
VersionAdded: '0.13'
|
2014
|
-
VersionChanged: '
|
2047
|
+
VersionChanged: '1.2'
|
2015
2048
|
Safe: false
|
2016
2049
|
|
2017
2050
|
Lint/UselessTimes:
|
2018
2051
|
Description: 'Checks for useless `Integer#times` calls.'
|
2019
|
-
Enabled:
|
2052
|
+
Enabled: true
|
2020
2053
|
VersionAdded: '0.91'
|
2021
2054
|
Safe: false
|
2022
2055
|
|
@@ -2155,6 +2188,7 @@ Naming/BinaryOperatorParameterName:
|
|
2155
2188
|
StyleGuide: '#other-arg'
|
2156
2189
|
Enabled: true
|
2157
2190
|
VersionAdded: '0.50'
|
2191
|
+
VersionChanged: '1.2'
|
2158
2192
|
|
2159
2193
|
Naming/BlockParameterName:
|
2160
2194
|
Description: >-
|
@@ -2261,6 +2295,7 @@ Naming/HeredocDelimiterCase:
|
|
2261
2295
|
StyleGuide: '#heredoc-delimiters'
|
2262
2296
|
Enabled: true
|
2263
2297
|
VersionAdded: '0.50'
|
2298
|
+
VersionChanged: '1.2'
|
2264
2299
|
EnforcedStyle: uppercase
|
2265
2300
|
SupportedStyles:
|
2266
2301
|
- lowercase
|
@@ -2279,7 +2314,7 @@ Naming/MemoizedInstanceVariableName:
|
|
2279
2314
|
Memoized method name should match memo instance variable name.
|
2280
2315
|
Enabled: true
|
2281
2316
|
VersionAdded: '0.53'
|
2282
|
-
VersionChanged: '
|
2317
|
+
VersionChanged: '1.2'
|
2283
2318
|
EnforcedStyleForLeadingUnderscores: disallowed
|
2284
2319
|
SupportedStylesForLeadingUnderscores:
|
2285
2320
|
- disallowed
|
@@ -2377,14 +2412,18 @@ Naming/VariableName:
|
|
2377
2412
|
- camelCase
|
2378
2413
|
|
2379
2414
|
Naming/VariableNumber:
|
2380
|
-
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'
|
2381
2417
|
Enabled: true
|
2382
2418
|
VersionAdded: '0.50'
|
2419
|
+
VersionChanged: '1.2'
|
2383
2420
|
EnforcedStyle: normalcase
|
2384
2421
|
SupportedStyles:
|
2385
2422
|
- snake_case
|
2386
2423
|
- normalcase
|
2387
2424
|
- non_integer
|
2425
|
+
CheckMethodNames: true
|
2426
|
+
CheckSymbols: true
|
2388
2427
|
|
2389
2428
|
#################### Security ##############################
|
2390
2429
|
|
@@ -2415,9 +2454,10 @@ Security/MarshalLoad:
|
|
2415
2454
|
VersionAdded: '0.47'
|
2416
2455
|
|
2417
2456
|
Security/Open:
|
2418
|
-
Description: 'The use of Kernel#open
|
2457
|
+
Description: 'The use of `Kernel#open` and `URI.open` represent a serious security risk.'
|
2419
2458
|
Enabled: true
|
2420
2459
|
VersionAdded: '0.53'
|
2460
|
+
VersionChanged: '1.0'
|
2421
2461
|
Safe: false
|
2422
2462
|
|
2423
2463
|
Security/YAMLLoad:
|
@@ -2444,7 +2484,7 @@ Style/AccessModifierDeclarations:
|
|
2444
2484
|
|
2445
2485
|
Style/AccessorGrouping:
|
2446
2486
|
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
2447
|
-
Enabled:
|
2487
|
+
Enabled: true
|
2448
2488
|
VersionAdded: '0.87'
|
2449
2489
|
EnforcedStyle: grouped
|
2450
2490
|
SupportedStyles:
|
@@ -2477,6 +2517,13 @@ Style/AndOr:
|
|
2477
2517
|
- always
|
2478
2518
|
- conditionals
|
2479
2519
|
|
2520
|
+
Style/ArgumentsForwarding:
|
2521
|
+
Description: 'Use arguments forwarding.'
|
2522
|
+
StyleGuide: '#arguments-forwarding'
|
2523
|
+
Enabled: pending
|
2524
|
+
AllowOnlyRestArgument: true
|
2525
|
+
VersionAdded: '1.1'
|
2526
|
+
|
2480
2527
|
Style/ArrayCoercion:
|
2481
2528
|
Description: >-
|
2482
2529
|
Use Array() instead of explicit Array check or [*var], when dealing
|
@@ -2533,7 +2580,7 @@ Style/BisectedAttrAccessor:
|
|
2533
2580
|
Description: >-
|
2534
2581
|
Checks for places where `attr_reader` and `attr_writer`
|
2535
2582
|
for the same method can be combined into single `attr_accessor`.
|
2536
|
-
Enabled:
|
2583
|
+
Enabled: true
|
2537
2584
|
VersionAdded: '0.87'
|
2538
2585
|
|
2539
2586
|
Style/BlockComments:
|
@@ -2672,7 +2719,7 @@ Style/CaseEquality:
|
|
2672
2719
|
Style/CaseLikeIf:
|
2673
2720
|
Description: 'This cop identifies places where `if-elsif` constructions can be replaced with `case-when`.'
|
2674
2721
|
StyleGuide: '#case-vs-if-else'
|
2675
|
-
Enabled:
|
2722
|
+
Enabled: true
|
2676
2723
|
Safe: false
|
2677
2724
|
VersionAdded: '0.88'
|
2678
2725
|
|
@@ -2725,7 +2772,7 @@ Style/ClassCheck:
|
|
2725
2772
|
Style/ClassEqualityComparison:
|
2726
2773
|
Description: 'Enforces the use of `Object#instance_of?` instead of class comparison for equality.'
|
2727
2774
|
StyleGuide: '#instance-of-vs-class-comparison'
|
2728
|
-
Enabled:
|
2775
|
+
Enabled: true
|
2729
2776
|
VersionAdded: '0.93'
|
2730
2777
|
IgnoredMethods:
|
2731
2778
|
- ==
|
@@ -2755,6 +2802,11 @@ Style/ClassVars:
|
|
2755
2802
|
Enabled: true
|
2756
2803
|
VersionAdded: '0.13'
|
2757
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
|
+
|
2758
2810
|
# Align with the style guide.
|
2759
2811
|
Style/CollectionMethods:
|
2760
2812
|
Description: 'Preferred collection methods.'
|
@@ -2793,7 +2845,7 @@ Style/CombinableLoops:
|
|
2793
2845
|
Description: >-
|
2794
2846
|
Checks for places where multiple consecutive loops over the same data
|
2795
2847
|
can be combined into a single loop.
|
2796
|
-
Enabled:
|
2848
|
+
Enabled: true
|
2797
2849
|
Safe: false
|
2798
2850
|
VersionAdded: '0.90'
|
2799
2851
|
|
@@ -2917,6 +2969,14 @@ Style/DisableCopsWithinSourceCodeDirective:
|
|
2917
2969
|
Enabled: false
|
2918
2970
|
VersionAdded: '0.82'
|
2919
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
|
+
|
2920
2980
|
Style/Documentation:
|
2921
2981
|
Description: 'Document classes and non-namespace modules.'
|
2922
2982
|
Enabled: true
|
@@ -2944,7 +3004,7 @@ Style/DoubleNegation:
|
|
2944
3004
|
StyleGuide: '#no-bang-bang'
|
2945
3005
|
Enabled: true
|
2946
3006
|
VersionAdded: '0.19'
|
2947
|
-
VersionChanged: '
|
3007
|
+
VersionChanged: '1.2'
|
2948
3008
|
EnforcedStyle: allowed_in_returns
|
2949
3009
|
SafeAutoCorrect: false
|
2950
3010
|
SupportedStyles:
|
@@ -3046,7 +3106,7 @@ Style/ExplicitBlockArgument:
|
|
3046
3106
|
Consider using explicit block argument to avoid writing block literal
|
3047
3107
|
that just passes its arguments to another block.
|
3048
3108
|
StyleGuide: '#block-argument'
|
3049
|
-
Enabled:
|
3109
|
+
Enabled: true
|
3050
3110
|
# May change the yielding arity.
|
3051
3111
|
Safe: false
|
3052
3112
|
VersionAdded: '0.89'
|
@@ -3054,7 +3114,7 @@ Style/ExplicitBlockArgument:
|
|
3054
3114
|
Style/ExponentialNotation:
|
3055
3115
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
3056
3116
|
StyleGuide: '#exponential-notation'
|
3057
|
-
Enabled:
|
3117
|
+
Enabled: true
|
3058
3118
|
VersionAdded: '0.82'
|
3059
3119
|
EnforcedStyle: scientific
|
3060
3120
|
SupportedStyles:
|
@@ -3109,8 +3169,12 @@ Style/FormatStringToken:
|
|
3109
3169
|
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
|
3110
3170
|
- template
|
3111
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
|
3112
3176
|
VersionAdded: '0.49'
|
3113
|
-
VersionChanged: '0
|
3177
|
+
VersionChanged: '1.0'
|
3114
3178
|
|
3115
3179
|
Style/FrozenStringLiteralComment:
|
3116
3180
|
Description: >-
|
@@ -3137,7 +3201,7 @@ Style/FrozenStringLiteralComment:
|
|
3137
3201
|
Style/GlobalStdStream:
|
3138
3202
|
Description: 'Enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`.'
|
3139
3203
|
StyleGuide: '#global-stdout'
|
3140
|
-
Enabled:
|
3204
|
+
Enabled: true
|
3141
3205
|
VersionAdded: '0.89'
|
3142
3206
|
SafeAutoCorrect: false
|
3143
3207
|
|
@@ -3165,7 +3229,7 @@ Style/HashAsLastArrayItem:
|
|
3165
3229
|
Checks for presence or absence of braces around hash literal as a last
|
3166
3230
|
array item depending on configuration.
|
3167
3231
|
StyleGuide: '#hash-literal-as-last-array-item'
|
3168
|
-
Enabled:
|
3232
|
+
Enabled: true
|
3169
3233
|
VersionAdded: '0.88'
|
3170
3234
|
EnforcedStyle: braces
|
3171
3235
|
SupportedStyles:
|
@@ -3175,7 +3239,7 @@ Style/HashAsLastArrayItem:
|
|
3175
3239
|
Style/HashEachMethods:
|
3176
3240
|
Description: 'Use Hash#each_key and Hash#each_value.'
|
3177
3241
|
StyleGuide: '#hash-each'
|
3178
|
-
Enabled:
|
3242
|
+
Enabled: true
|
3179
3243
|
VersionAdded: '0.80'
|
3180
3244
|
Safe: false
|
3181
3245
|
|
@@ -3183,7 +3247,7 @@ Style/HashLikeCase:
|
|
3183
3247
|
Description: >-
|
3184
3248
|
Checks for places where `case-when` represents a simple 1:1
|
3185
3249
|
mapping and can be replaced with a hash lookup.
|
3186
|
-
Enabled:
|
3250
|
+
Enabled: true
|
3187
3251
|
VersionAdded: '0.88'
|
3188
3252
|
# `MinBranchesCount` defines the number of branches `case` needs to have
|
3189
3253
|
# to trigger this cop
|
@@ -3214,14 +3278,14 @@ Style/HashSyntax:
|
|
3214
3278
|
|
3215
3279
|
Style/HashTransformKeys:
|
3216
3280
|
Description: 'Prefer `transform_keys` over `each_with_object`, `map`, or `to_h`.'
|
3217
|
-
Enabled:
|
3281
|
+
Enabled: true
|
3218
3282
|
VersionAdded: '0.80'
|
3219
3283
|
VersionChanged: '0.90'
|
3220
3284
|
Safe: false
|
3221
3285
|
|
3222
3286
|
Style/HashTransformValues:
|
3223
3287
|
Description: 'Prefer `transform_values` over `each_with_object`, `map`, or `to_h`.'
|
3224
|
-
Enabled:
|
3288
|
+
Enabled: true
|
3225
3289
|
VersionAdded: '0.80'
|
3226
3290
|
VersionChanged: '0.90'
|
3227
3291
|
Safe: false
|
@@ -3328,7 +3392,7 @@ Style/IpAddresses:
|
|
3328
3392
|
Style/KeywordParametersOrder:
|
3329
3393
|
Description: 'Enforces that optional keyword parameters are placed at the end of the parameters list.'
|
3330
3394
|
StyleGuide: '#keyword-parameters-order'
|
3331
|
-
Enabled:
|
3395
|
+
Enabled: true
|
3332
3396
|
VersionAdded: '0.90'
|
3333
3397
|
|
3334
3398
|
Style/Lambda:
|
@@ -3530,6 +3594,7 @@ Style/MultipleComparison:
|
|
3530
3594
|
use Array#include? instead.
|
3531
3595
|
Enabled: true
|
3532
3596
|
VersionAdded: '0.49'
|
3597
|
+
VersionChanged: '1.1'
|
3533
3598
|
|
3534
3599
|
Style/MutableConstant:
|
3535
3600
|
Description: 'Do not assign mutable objects to constants.'
|
@@ -3564,6 +3629,13 @@ Style/NegatedIf:
|
|
3564
3629
|
- prefix
|
3565
3630
|
- postfix
|
3566
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
|
+
|
3567
3639
|
Style/NegatedUnless:
|
3568
3640
|
Description: 'Favor if over unless for negative conditions.'
|
3569
3641
|
StyleGuide: '#if-for-negatives'
|
@@ -3753,7 +3825,7 @@ Style/OptionalArguments:
|
|
3753
3825
|
Style/OptionalBooleanParameter:
|
3754
3826
|
Description: 'Use keyword arguments when defining method with boolean argument.'
|
3755
3827
|
StyleGuide: '#boolean-keyword-arguments'
|
3756
|
-
Enabled:
|
3828
|
+
Enabled: true
|
3757
3829
|
Safe: false
|
3758
3830
|
VersionAdded: '0.89'
|
3759
3831
|
AllowedMethods:
|
@@ -3841,11 +3913,12 @@ Style/RaiseArgs:
|
|
3841
3913
|
StyleGuide: '#exception-class-messages'
|
3842
3914
|
Enabled: true
|
3843
3915
|
VersionAdded: '0.14'
|
3844
|
-
VersionChanged: '
|
3916
|
+
VersionChanged: '1.2'
|
3845
3917
|
EnforcedStyle: exploded
|
3846
3918
|
SupportedStyles:
|
3847
3919
|
- compact # raise Exception.new(msg)
|
3848
3920
|
- exploded # raise Exception, msg
|
3921
|
+
AllowedCompactTypes: []
|
3849
3922
|
|
3850
3923
|
Style/RandomWithOffset:
|
3851
3924
|
Description: >-
|
@@ -3857,7 +3930,7 @@ Style/RandomWithOffset:
|
|
3857
3930
|
|
3858
3931
|
Style/RedundantAssignment:
|
3859
3932
|
Description: 'Checks for redundant assignment before returning.'
|
3860
|
-
Enabled:
|
3933
|
+
Enabled: true
|
3861
3934
|
VersionAdded: '0.87'
|
3862
3935
|
|
3863
3936
|
Style/RedundantBegin:
|
@@ -3894,7 +3967,7 @@ Style/RedundantFetchBlock:
|
|
3894
3967
|
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
3895
3968
|
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
3896
3969
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
3897
|
-
Enabled:
|
3970
|
+
Enabled: true
|
3898
3971
|
Safe: false
|
3899
3972
|
# If enabled, this cop will autocorrect usages of
|
3900
3973
|
# `fetch` being called with block returning a constant.
|
@@ -3907,7 +3980,7 @@ Style/RedundantFileExtensionInRequire:
|
|
3907
3980
|
Checks for the presence of superfluous `.rb` extension in
|
3908
3981
|
the filename provided to `require` and `require_relative`.
|
3909
3982
|
StyleGuide: '#no-explicit-rb-to-require'
|
3910
|
-
Enabled:
|
3983
|
+
Enabled: true
|
3911
3984
|
VersionAdded: '0.88'
|
3912
3985
|
|
3913
3986
|
Style/RedundantFreeze:
|
@@ -3934,12 +4007,12 @@ Style/RedundantPercentQ:
|
|
3934
4007
|
|
3935
4008
|
Style/RedundantRegexpCharacterClass:
|
3936
4009
|
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
3937
|
-
Enabled:
|
4010
|
+
Enabled: true
|
3938
4011
|
VersionAdded: '0.85'
|
3939
4012
|
|
3940
4013
|
Style/RedundantRegexpEscape:
|
3941
4014
|
Description: 'Checks for redundant escapes in Regexps.'
|
3942
|
-
Enabled:
|
4015
|
+
Enabled: true
|
3943
4016
|
VersionAdded: '0.85'
|
3944
4017
|
|
3945
4018
|
Style/RedundantReturn:
|
@@ -3960,7 +4033,7 @@ Style/RedundantSelf:
|
|
3960
4033
|
|
3961
4034
|
Style/RedundantSelfAssignment:
|
3962
4035
|
Description: 'Checks for places where redundant assignments are made for in place modification methods.'
|
3963
|
-
Enabled:
|
4036
|
+
Enabled: true
|
3964
4037
|
Safe: false
|
3965
4038
|
VersionAdded: '0.90'
|
3966
4039
|
|
@@ -4088,7 +4161,7 @@ Style/SignalException:
|
|
4088
4161
|
|
4089
4162
|
Style/SingleArgumentDig:
|
4090
4163
|
Description: 'Avoid using single argument dig method.'
|
4091
|
-
Enabled:
|
4164
|
+
Enabled: true
|
4092
4165
|
VersionAdded: '0.89'
|
4093
4166
|
Safe: false
|
4094
4167
|
|
@@ -4115,7 +4188,7 @@ Style/SingleLineMethods:
|
|
4115
4188
|
|
4116
4189
|
Style/SlicingWithRange:
|
4117
4190
|
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
4118
|
-
Enabled:
|
4191
|
+
Enabled: true
|
4119
4192
|
VersionAdded: '0.83'
|
4120
4193
|
Safe: false
|
4121
4194
|
|
@@ -4123,7 +4196,7 @@ Style/SoleNestedConditional:
|
|
4123
4196
|
Description: >-
|
4124
4197
|
Finds sole nested conditional nodes
|
4125
4198
|
which can be merged into outer conditional node.
|
4126
|
-
Enabled:
|
4199
|
+
Enabled: true
|
4127
4200
|
VersionAdded: '0.89'
|
4128
4201
|
AllowModifier: false
|
4129
4202
|
|
@@ -4158,7 +4231,7 @@ Style/StderrPuts:
|
|
4158
4231
|
Style/StringConcatenation:
|
4159
4232
|
Description: 'Checks for places where string concatenation can be replaced with string interpolation.'
|
4160
4233
|
StyleGuide: '#string-interpolation'
|
4161
|
-
Enabled:
|
4234
|
+
Enabled: true
|
4162
4235
|
Safe: false
|
4163
4236
|
VersionAdded: '0.89'
|
4164
4237
|
|
@@ -4221,6 +4294,13 @@ Style/StructInheritance:
|
|
4221
4294
|
VersionAdded: '0.29'
|
4222
4295
|
VersionChanged: '0.86'
|
4223
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
|
+
|
4224
4304
|
Style/SymbolArray:
|
4225
4305
|
Description: 'Use %i or %I for arrays of symbols.'
|
4226
4306
|
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.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
|