chefstyle 1.5.6 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/config/chefstyle.yml +10 -1
- data/config/disable_all.yml +24 -0
- data/config/upstream.yml +148 -19
- data/lib/chefstyle/version.rb +3 -3
- data/lib/rubocop/cop/chef/ruby/legacy_powershell_out_methods.rb +36 -0
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6d8cb295371355b2366f70ad030e7d6aa1d5f300f39c16f21198cc93b878898c
|
|
4
|
+
data.tar.gz: 31b65eb4a0f60baf333369f8e6374029e57d03750db142afcc34e74b8c45b276
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 736367eff801ef343b7f6bcd67b5896c9343913ac2de3620748a99814f1714d5b5db78ea4e8e743abe6447d5ca30dceb7dd813b79c7c8b45788ecf0bdbbe76c0
|
|
7
|
+
data.tar.gz: 313c8f7ad2918ed7c839cb7dbe5e87e8810b3ac266c8ae2b7c4ffacb9efb6fdd820c04e1b55d552fbde0fb309053c3c82664b57fa8ecf3a42dc6bb67d1bf45cf
|
data/config/chefstyle.yml
CHANGED
|
@@ -687,6 +687,10 @@ Lint/RedundantWithIndex:
|
|
|
687
687
|
Lint/DuplicateRequire:
|
|
688
688
|
Enabled: true
|
|
689
689
|
|
|
690
|
+
# detect assignment typos
|
|
691
|
+
Lint/AmbiguousAssignment:
|
|
692
|
+
Enabled: true
|
|
693
|
+
|
|
690
694
|
Chef/Ruby/Ruby27KeywordArgumentWarnings:
|
|
691
695
|
Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
|
|
692
696
|
Enabled: true
|
|
@@ -709,4 +713,9 @@ Chef/Ruby/GemspecRequireRubygems:
|
|
|
709
713
|
Chef/Ruby/RequireNetHttps:
|
|
710
714
|
Description: net/https is deprecated and just includes net/http and openssl. We should include those directly instead
|
|
711
715
|
Enabled: true
|
|
712
|
-
VersionAdded: '1.3.0'
|
|
716
|
+
VersionAdded: '1.3.0'
|
|
717
|
+
|
|
718
|
+
Chef/Ruby/LegacyPowershellOutMethods:
|
|
719
|
+
Description: Use powershell_exec!/powershell_exec instead of the slower legacy powershell_out!/powershell_out methods.
|
|
720
|
+
Enabled: true
|
|
721
|
+
VersionAdded: '1.6.0'
|
data/config/disable_all.yml
CHANGED
|
@@ -169,6 +169,8 @@ Layout/SpaceAroundOperators:
|
|
|
169
169
|
Enabled: false
|
|
170
170
|
Layout/SpaceBeforeBlockBraces:
|
|
171
171
|
Enabled: false
|
|
172
|
+
Layout/SpaceBeforeBrackets:
|
|
173
|
+
Enabled: false
|
|
172
174
|
Layout/SpaceBeforeComma:
|
|
173
175
|
Enabled: false
|
|
174
176
|
Layout/SpaceBeforeComment:
|
|
@@ -201,6 +203,8 @@ Layout/TrailingEmptyLines:
|
|
|
201
203
|
Enabled: false
|
|
202
204
|
Layout/TrailingWhitespace:
|
|
203
205
|
Enabled: false
|
|
206
|
+
Lint/AmbiguousAssignment:
|
|
207
|
+
Enabled: false
|
|
204
208
|
Lint/AmbiguousBlockAssociation:
|
|
205
209
|
Enabled: false
|
|
206
210
|
Lint/AmbiguousOperator:
|
|
@@ -225,6 +229,8 @@ Lint/Debugger:
|
|
|
225
229
|
Enabled: false
|
|
226
230
|
Lint/DeprecatedClassMethods:
|
|
227
231
|
Enabled: false
|
|
232
|
+
Lint/DeprecatedConstants:
|
|
233
|
+
Enabled: false
|
|
228
234
|
Lint/DeprecatedOpenSSLConstant:
|
|
229
235
|
Enabled: false
|
|
230
236
|
Lint/DisjunctiveAssignmentInConstructor:
|
|
@@ -291,6 +297,8 @@ Lint/IneffectiveAccessModifier:
|
|
|
291
297
|
Enabled: false
|
|
292
298
|
Lint/InterpolationCheck:
|
|
293
299
|
Enabled: false
|
|
300
|
+
Lint/LambdaWithoutLiteralBlock:
|
|
301
|
+
Enabled: false
|
|
294
302
|
Lint/LiteralAsCondition:
|
|
295
303
|
Enabled: false
|
|
296
304
|
Lint/LiteralInInterpolation:
|
|
@@ -319,6 +327,10 @@ Lint/NonLocalExitFromIterator:
|
|
|
319
327
|
Enabled: false
|
|
320
328
|
Lint/NumberConversion:
|
|
321
329
|
Enabled: false
|
|
330
|
+
Lint/NumberedParameterAssignment:
|
|
331
|
+
Enabled: false
|
|
332
|
+
Lint/OrAssignmentToConstant:
|
|
333
|
+
Enabled: false
|
|
322
334
|
Lint/OrderedMagicComments:
|
|
323
335
|
Enabled: false
|
|
324
336
|
Lint/OutOfRangeRegexpRef:
|
|
@@ -337,6 +349,8 @@ Lint/RedundantCopDisableDirective:
|
|
|
337
349
|
Enabled: false
|
|
338
350
|
Lint/RedundantCopEnableDirective:
|
|
339
351
|
Enabled: false
|
|
352
|
+
Lint/RedundantDirGlobSort:
|
|
353
|
+
Enabled: false
|
|
340
354
|
Lint/RedundantRequireStatement:
|
|
341
355
|
Enabled: false
|
|
342
356
|
Lint/RedundantSafeNavigation:
|
|
@@ -381,6 +395,8 @@ Lint/StructNewOverride:
|
|
|
381
395
|
Enabled: false
|
|
382
396
|
Lint/SuppressedException:
|
|
383
397
|
Enabled: false
|
|
398
|
+
Lint/SymbolConversion:
|
|
399
|
+
Enabled: false
|
|
384
400
|
Lint/Syntax:
|
|
385
401
|
Enabled: false
|
|
386
402
|
Lint/ToEnumArguments:
|
|
@@ -391,6 +407,8 @@ Lint/TopLevelReturnWithArgument:
|
|
|
391
407
|
Enabled: false
|
|
392
408
|
Lint/TrailingCommaInAttributeDeclaration:
|
|
393
409
|
Enabled: false
|
|
410
|
+
Lint/TripleQuotes:
|
|
411
|
+
Enabled: false
|
|
394
412
|
Lint/UnderscorePrefixedVariableName:
|
|
395
413
|
Enabled: false
|
|
396
414
|
Lint/UnexpectedBlockArity:
|
|
@@ -579,6 +597,8 @@ Style/EmptyLiteral:
|
|
|
579
597
|
Enabled: false
|
|
580
598
|
Style/EmptyMethod:
|
|
581
599
|
Enabled: false
|
|
600
|
+
Style/EndlessMethod:
|
|
601
|
+
Enabled: false
|
|
582
602
|
Style/Encoding:
|
|
583
603
|
Enabled: false
|
|
584
604
|
Style/EndBlock:
|
|
@@ -613,6 +633,8 @@ Style/HashAsLastArrayItem:
|
|
|
613
633
|
Enabled: false
|
|
614
634
|
Style/HashEachMethods:
|
|
615
635
|
Enabled: false
|
|
636
|
+
Style/HashExcept:
|
|
637
|
+
Enabled: false
|
|
616
638
|
Style/HashLikeCase:
|
|
617
639
|
Enabled: false
|
|
618
640
|
Style/HashSyntax:
|
|
@@ -629,6 +651,8 @@ Style/IfUnlessModifier:
|
|
|
629
651
|
Enabled: false
|
|
630
652
|
Style/IfUnlessModifierOfIfUnless:
|
|
631
653
|
Enabled: false
|
|
654
|
+
Style/IfWithBooleanLiteralBranches:
|
|
655
|
+
Enabled: false
|
|
632
656
|
Style/IfWithSemicolon:
|
|
633
657
|
Enabled: false
|
|
634
658
|
Style/ImplicitRuntimeError:
|
data/config/upstream.yml
CHANGED
|
@@ -132,12 +132,13 @@ AllCops:
|
|
|
132
132
|
# If a value is specified for TargetRubyVersion then it is used. Acceptable
|
|
133
133
|
# values are specificed as a float (i.e. 2.5); the teeny version of Ruby
|
|
134
134
|
# should not be included. If the project specifies a Ruby version in the
|
|
135
|
-
# .ruby-version
|
|
136
|
-
# the desired version of Ruby by inspecting the
|
|
137
|
-
#
|
|
138
|
-
#
|
|
139
|
-
# from the lock file.) If the
|
|
140
|
-
#
|
|
135
|
+
# .tool-versions or .ruby-version files, Gemfile or gems.rb file, RuboCop will
|
|
136
|
+
# try to determine the desired version of Ruby by inspecting the
|
|
137
|
+
# .tool-versions file first, then .ruby-version, followed by the Gemfile.lock
|
|
138
|
+
# or gems.locked file. (Although the Ruby version is specified in the Gemfile
|
|
139
|
+
# or gems.rb file, RuboCop reads the final value from the lock file.) If the
|
|
140
|
+
# Ruby version is still unresolved, RuboCop will use the oldest officially
|
|
141
|
+
# supported Ruby version (currently Ruby 2.4).
|
|
141
142
|
TargetRubyVersion: ~
|
|
142
143
|
# Determines if a notification for extension libraries should be shown when
|
|
143
144
|
# rubocop is run. Keys are the name of the extension, and values are an array
|
|
@@ -473,7 +474,7 @@ Layout/EmptyLineBetweenDefs:
|
|
|
473
474
|
StyleGuide: '#empty-lines-between-methods'
|
|
474
475
|
Enabled: true
|
|
475
476
|
VersionAdded: '0.49'
|
|
476
|
-
VersionChanged: '1.
|
|
477
|
+
VersionChanged: '1.7'
|
|
477
478
|
EmptyLineBetweenMethodDefs: true
|
|
478
479
|
EmptyLineBetweenClassDefs: true
|
|
479
480
|
EmptyLineBetweenModuleDefs: true
|
|
@@ -1192,6 +1193,12 @@ Layout/SpaceBeforeBlockBraces:
|
|
|
1192
1193
|
- no_space
|
|
1193
1194
|
VersionChanged: '0.52'
|
|
1194
1195
|
|
|
1196
|
+
Layout/SpaceBeforeBrackets:
|
|
1197
|
+
Description: 'Checks for receiver with a space before the opening brackets.'
|
|
1198
|
+
StyleGuide: '#space-in-brackets-access'
|
|
1199
|
+
Enabled: pending
|
|
1200
|
+
VersionAdded: '1.7'
|
|
1201
|
+
|
|
1195
1202
|
Layout/SpaceBeforeComma:
|
|
1196
1203
|
Description: 'No spaces before commas.'
|
|
1197
1204
|
Enabled: true
|
|
@@ -1354,6 +1361,11 @@ Layout/TrailingWhitespace:
|
|
|
1354
1361
|
#################### Lint ##################################
|
|
1355
1362
|
### Warnings
|
|
1356
1363
|
|
|
1364
|
+
Lint/AmbiguousAssignment:
|
|
1365
|
+
Description: 'Checks for mistyped shorthand assignments.'
|
|
1366
|
+
Enabled: pending
|
|
1367
|
+
VersionAdded: '1.7'
|
|
1368
|
+
|
|
1357
1369
|
Lint/AmbiguousBlockAssociation:
|
|
1358
1370
|
Description: >-
|
|
1359
1371
|
Checks for ambiguous block association with method when param passed without
|
|
@@ -1396,6 +1408,7 @@ Lint/BinaryOperatorWithIdenticalOperands:
|
|
|
1396
1408
|
Enabled: true
|
|
1397
1409
|
Safe: false
|
|
1398
1410
|
VersionAdded: '0.89'
|
|
1411
|
+
VersionChanged: '1.7'
|
|
1399
1412
|
|
|
1400
1413
|
Lint/BooleanSymbol:
|
|
1401
1414
|
Description: 'Check for `:true` and `:false` symbols.'
|
|
@@ -1456,6 +1469,34 @@ Lint/DeprecatedClassMethods:
|
|
|
1456
1469
|
Enabled: true
|
|
1457
1470
|
VersionAdded: '0.19'
|
|
1458
1471
|
|
|
1472
|
+
Lint/DeprecatedConstants:
|
|
1473
|
+
Description: 'Checks for deprecated constants.'
|
|
1474
|
+
Enabled: pending
|
|
1475
|
+
VersionAdded: '1.8'
|
|
1476
|
+
# You can configure deprecated constants.
|
|
1477
|
+
# If there is an alternative method, you can set alternative value as `Alternative`.
|
|
1478
|
+
# And you can set the deprecated version as `DeprecatedVersion`.
|
|
1479
|
+
# These options can be omitted if they are not needed.
|
|
1480
|
+
#
|
|
1481
|
+
# DeprecatedConstants:
|
|
1482
|
+
# 'DEPRECATED_CONSTANT':
|
|
1483
|
+
# Alternative: 'alternative_value'
|
|
1484
|
+
# DeprecatedVersion: 'deprecated_version'
|
|
1485
|
+
#
|
|
1486
|
+
DeprecatedConstants:
|
|
1487
|
+
'NIL':
|
|
1488
|
+
Alternative: 'nil'
|
|
1489
|
+
DeprecatedVersion: '2.4'
|
|
1490
|
+
'TRUE':
|
|
1491
|
+
Alternative: 'true'
|
|
1492
|
+
DeprecatedVersion: '2.4'
|
|
1493
|
+
'FALSE':
|
|
1494
|
+
Alternative: 'false'
|
|
1495
|
+
DeprecatedVersion: '2.4'
|
|
1496
|
+
'Random::DEFAULT':
|
|
1497
|
+
Alternative: 'Random.new'
|
|
1498
|
+
DeprecatedVersion: '3.0'
|
|
1499
|
+
|
|
1459
1500
|
Lint/DeprecatedOpenSSLConstant:
|
|
1460
1501
|
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
|
1461
1502
|
Enabled: true
|
|
@@ -1472,6 +1513,9 @@ Lint/DuplicateBranch:
|
|
|
1472
1513
|
Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs.
|
|
1473
1514
|
Enabled: pending
|
|
1474
1515
|
VersionAdded: '1.3'
|
|
1516
|
+
VersionChanged: '1.7'
|
|
1517
|
+
IgnoreLiteralBranches: false
|
|
1518
|
+
IgnoreConstantBranches: false
|
|
1475
1519
|
|
|
1476
1520
|
Lint/DuplicateCaseCondition:
|
|
1477
1521
|
Description: 'Do not repeat values in case conditionals.'
|
|
@@ -1658,6 +1702,11 @@ Lint/InterpolationCheck:
|
|
|
1658
1702
|
VersionAdded: '0.50'
|
|
1659
1703
|
VersionChanged: '0.87'
|
|
1660
1704
|
|
|
1705
|
+
Lint/LambdaWithoutLiteralBlock:
|
|
1706
|
+
Description: 'Checks uses of lambda without a literal block.'
|
|
1707
|
+
Enabled: pending
|
|
1708
|
+
VersionAdded: '1.8'
|
|
1709
|
+
|
|
1661
1710
|
Lint/LiteralAsCondition:
|
|
1662
1711
|
Description: 'Checks of literals used in conditions.'
|
|
1663
1712
|
Enabled: true
|
|
@@ -1757,6 +1806,17 @@ Lint/NumberConversion:
|
|
|
1757
1806
|
- Time
|
|
1758
1807
|
- DateTime
|
|
1759
1808
|
|
|
1809
|
+
Lint/NumberedParameterAssignment:
|
|
1810
|
+
Description: 'Checks for uses of numbered parameter assignment.'
|
|
1811
|
+
Enabled: pending
|
|
1812
|
+
VersionAdded: '1.9'
|
|
1813
|
+
|
|
1814
|
+
Lint/OrAssignmentToConstant:
|
|
1815
|
+
Description: 'Checks unintended or-assignment to constant.'
|
|
1816
|
+
Enabled: pending
|
|
1817
|
+
Safe: false
|
|
1818
|
+
VersionAdded: '1.9'
|
|
1819
|
+
|
|
1760
1820
|
Lint/OrderedMagicComments:
|
|
1761
1821
|
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
|
|
1762
1822
|
Enabled: true
|
|
@@ -1820,6 +1880,11 @@ Lint/RedundantCopEnableDirective:
|
|
|
1820
1880
|
Enabled: true
|
|
1821
1881
|
VersionAdded: '0.76'
|
|
1822
1882
|
|
|
1883
|
+
Lint/RedundantDirGlobSort:
|
|
1884
|
+
Description: 'Checks for redundant `sort` method to `Dir.glob` and `Dir[]`.'
|
|
1885
|
+
Enabled: pending
|
|
1886
|
+
VersionAdded: '1.8'
|
|
1887
|
+
|
|
1823
1888
|
Lint/RedundantRequireStatement:
|
|
1824
1889
|
Description: 'Checks for unnecessary `require` statement.'
|
|
1825
1890
|
Enabled: true
|
|
@@ -1842,6 +1907,8 @@ Lint/RedundantSplatExpansion:
|
|
|
1842
1907
|
Description: 'Checks for splat unnecessarily being called on literals.'
|
|
1843
1908
|
Enabled: true
|
|
1844
1909
|
VersionAdded: '0.76'
|
|
1910
|
+
VersionChanged: '1.7'
|
|
1911
|
+
AllowPercentLiteralArrayArgument: true
|
|
1845
1912
|
|
|
1846
1913
|
Lint/RedundantStringCoercion:
|
|
1847
1914
|
Description: 'Checks for Object#to_s usage in string interpolation.'
|
|
@@ -1976,12 +2043,16 @@ Lint/SuppressedException:
|
|
|
1976
2043
|
VersionAdded: '0.9'
|
|
1977
2044
|
VersionChanged: '0.81'
|
|
1978
2045
|
|
|
2046
|
+
Lint/SymbolConversion:
|
|
2047
|
+
Description: 'Checks for unnecessary symbol conversions.'
|
|
2048
|
+
Enabled: pending
|
|
2049
|
+
VersionAdded: '1.9'
|
|
2050
|
+
|
|
1979
2051
|
Lint/Syntax:
|
|
1980
|
-
Description: 'Checks syntax
|
|
2052
|
+
Description: 'Checks for syntax errors.'
|
|
1981
2053
|
Enabled: true
|
|
1982
2054
|
VersionAdded: '0.9'
|
|
1983
2055
|
|
|
1984
|
-
|
|
1985
2056
|
Lint/ToEnumArguments:
|
|
1986
2057
|
Description: 'This cop ensures that `to_enum`/`enum_for`, called for the current method, has correct arguments.'
|
|
1987
2058
|
Enabled: pending
|
|
@@ -2002,6 +2073,11 @@ Lint/TrailingCommaInAttributeDeclaration:
|
|
|
2002
2073
|
Enabled: true
|
|
2003
2074
|
VersionAdded: '0.90'
|
|
2004
2075
|
|
|
2076
|
+
Lint/TripleQuotes:
|
|
2077
|
+
Description: 'Checks for useless triple quote constructs.'
|
|
2078
|
+
Enabled: pending
|
|
2079
|
+
VersionAdded: '1.9'
|
|
2080
|
+
|
|
2005
2081
|
Lint/UnderscorePrefixedVariableName:
|
|
2006
2082
|
Description: 'Do not use prefix `_` for a variable that is used.'
|
|
2007
2083
|
Enabled: true
|
|
@@ -2045,6 +2121,11 @@ Lint/UnreachableLoop:
|
|
|
2045
2121
|
Description: 'This cop checks for loops that will have at most one iteration.'
|
|
2046
2122
|
Enabled: true
|
|
2047
2123
|
VersionAdded: '0.89'
|
|
2124
|
+
VersionChanged: '1.7'
|
|
2125
|
+
IgnoredPatterns:
|
|
2126
|
+
# RSpec uses `times` in its message expectations
|
|
2127
|
+
# eg. `exactly(2).times`
|
|
2128
|
+
- !ruby/regexp /(exactly|at_least|at_most)\(\d+\)\.times/
|
|
2048
2129
|
|
|
2049
2130
|
Lint/UnusedBlockArgument:
|
|
2050
2131
|
Description: 'Checks for unused block arguments.'
|
|
@@ -2479,10 +2560,12 @@ Naming/VariableName:
|
|
|
2479
2560
|
StyleGuide: '#snake-case-symbols-methods-vars'
|
|
2480
2561
|
Enabled: true
|
|
2481
2562
|
VersionAdded: '0.50'
|
|
2563
|
+
VersionChanged: '1.8'
|
|
2482
2564
|
EnforcedStyle: snake_case
|
|
2483
2565
|
SupportedStyles:
|
|
2484
2566
|
- snake_case
|
|
2485
2567
|
- camelCase
|
|
2568
|
+
AllowedIdentifiers: []
|
|
2486
2569
|
|
|
2487
2570
|
Naming/VariableNumber:
|
|
2488
2571
|
Description: 'Use the configured style when numbering symbols, methods and variables.'
|
|
@@ -2626,7 +2709,8 @@ Style/AsciiComments:
|
|
|
2626
2709
|
Enabled: true
|
|
2627
2710
|
VersionAdded: '0.9'
|
|
2628
2711
|
VersionChanged: '0.52'
|
|
2629
|
-
AllowedChars:
|
|
2712
|
+
AllowedChars:
|
|
2713
|
+
- ©
|
|
2630
2714
|
|
|
2631
2715
|
Style/Attr:
|
|
2632
2716
|
Description: 'Checks for uses of Module#attr.'
|
|
@@ -2895,7 +2979,7 @@ Style/CollectionMethods:
|
|
|
2895
2979
|
StyleGuide: '#map-find-select-reduce-include-size'
|
|
2896
2980
|
Enabled: false
|
|
2897
2981
|
VersionAdded: '0.9'
|
|
2898
|
-
VersionChanged: '
|
|
2982
|
+
VersionChanged: '1.7'
|
|
2899
2983
|
Safe: false
|
|
2900
2984
|
# Mapping from undesired method to desired method
|
|
2901
2985
|
# e.g. to use `detect` over `find`:
|
|
@@ -2910,6 +2994,11 @@ Style/CollectionMethods:
|
|
|
2910
2994
|
detect: 'find'
|
|
2911
2995
|
find_all: 'select'
|
|
2912
2996
|
member?: 'include?'
|
|
2997
|
+
# Methods in this array accept a final symbol as an implicit block
|
|
2998
|
+
# eg. `inject(:+)`
|
|
2999
|
+
MethodsAcceptingSymbol:
|
|
3000
|
+
- inject
|
|
3001
|
+
- reduce
|
|
2913
3002
|
|
|
2914
3003
|
Style/ColonMethodCall:
|
|
2915
3004
|
Description: 'Do not use :: for method call.'
|
|
@@ -2969,6 +3058,7 @@ Style/CommentedKeyword:
|
|
|
2969
3058
|
Description: 'Do not place comments on the same line as certain keywords.'
|
|
2970
3059
|
Enabled: true
|
|
2971
3060
|
VersionAdded: '0.51'
|
|
3061
|
+
VersionChanged: '1.7'
|
|
2972
3062
|
|
|
2973
3063
|
Style/ConditionalAssignment:
|
|
2974
3064
|
Description: >-
|
|
@@ -3051,6 +3141,8 @@ Style/DisableCopsWithinSourceCodeDirective:
|
|
|
3051
3141
|
Forbids disabling/enabling cops within source code.
|
|
3052
3142
|
Enabled: false
|
|
3053
3143
|
VersionAdded: '0.82'
|
|
3144
|
+
VersionChanged: '1.9'
|
|
3145
|
+
AllowedCops: []
|
|
3054
3146
|
|
|
3055
3147
|
Style/DocumentDynamicEvalDefinition:
|
|
3056
3148
|
Description: >-
|
|
@@ -3168,6 +3260,17 @@ Style/EndBlock:
|
|
|
3168
3260
|
VersionAdded: '0.9'
|
|
3169
3261
|
VersionChanged: '0.81'
|
|
3170
3262
|
|
|
3263
|
+
Style/EndlessMethod:
|
|
3264
|
+
Description: 'Avoid the use of multi-lined endless method definitions.'
|
|
3265
|
+
StyleGuide: '#endless-methods'
|
|
3266
|
+
Enabled: pending
|
|
3267
|
+
VersionAdded: '1.8'
|
|
3268
|
+
EnforcedStyle: allow_single_line
|
|
3269
|
+
SupportedStyles:
|
|
3270
|
+
- allow_single_line
|
|
3271
|
+
- allow_always
|
|
3272
|
+
- disallow
|
|
3273
|
+
|
|
3171
3274
|
Style/EvalWithLocation:
|
|
3172
3275
|
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
|
|
3173
3276
|
Enabled: true
|
|
@@ -3191,9 +3294,8 @@ Style/ExplicitBlockArgument:
|
|
|
3191
3294
|
that just passes its arguments to another block.
|
|
3192
3295
|
StyleGuide: '#block-argument'
|
|
3193
3296
|
Enabled: true
|
|
3194
|
-
# May change the yielding arity.
|
|
3195
|
-
Safe: false
|
|
3196
3297
|
VersionAdded: '0.89'
|
|
3298
|
+
VersionChanged: '1.8'
|
|
3197
3299
|
|
|
3198
3300
|
Style/ExponentialNotation:
|
|
3199
3301
|
Description: 'When using exponential notation, favor a mantissa between 1 (inclusive) and 10 (exclusive).'
|
|
@@ -3209,9 +3311,11 @@ Style/ExponentialNotation:
|
|
|
3209
3311
|
Style/FloatDivision:
|
|
3210
3312
|
Description: 'For performing float division, coerce one side only.'
|
|
3211
3313
|
StyleGuide: '#float-division'
|
|
3212
|
-
Reference: 'https://
|
|
3314
|
+
Reference: 'https://blog.rubystyle.guide/ruby/2019/06/21/float-division.html'
|
|
3213
3315
|
Enabled: true
|
|
3214
3316
|
VersionAdded: '0.72'
|
|
3317
|
+
VersionChanged: '1.9'
|
|
3318
|
+
Safe: false
|
|
3215
3319
|
EnforcedStyle: single_coerce
|
|
3216
3320
|
SupportedStyles:
|
|
3217
3321
|
- left_coerce
|
|
@@ -3259,6 +3363,7 @@ Style/FormatStringToken:
|
|
|
3259
3363
|
MaxUnannotatedPlaceholdersAllowed: 1
|
|
3260
3364
|
VersionAdded: '0.49'
|
|
3261
3365
|
VersionChanged: '1.0'
|
|
3366
|
+
IgnoredMethods: []
|
|
3262
3367
|
|
|
3263
3368
|
Style/FrozenStringLiteralComment:
|
|
3264
3369
|
Description: >-
|
|
@@ -3327,6 +3432,13 @@ Style/HashEachMethods:
|
|
|
3327
3432
|
VersionAdded: '0.80'
|
|
3328
3433
|
Safe: false
|
|
3329
3434
|
|
|
3435
|
+
Style/HashExcept:
|
|
3436
|
+
Description: >-
|
|
3437
|
+
Checks for usages of `Hash#reject`, `Hash#select`, and `Hash#filter` methods
|
|
3438
|
+
that can be replaced with `Hash#except` method.
|
|
3439
|
+
Enabled: pending
|
|
3440
|
+
VersionAdded: '1.7'
|
|
3441
|
+
|
|
3330
3442
|
Style/HashLikeCase:
|
|
3331
3443
|
Description: >-
|
|
3332
3444
|
Checks for places where `case-when` represents a simple 1:1
|
|
@@ -3405,6 +3517,14 @@ Style/IfUnlessModifierOfIfUnless:
|
|
|
3405
3517
|
VersionAdded: '0.39'
|
|
3406
3518
|
VersionChanged: '0.87'
|
|
3407
3519
|
|
|
3520
|
+
Style/IfWithBooleanLiteralBranches:
|
|
3521
|
+
Description: 'Checks for redundant `if` with boolean literal branches.'
|
|
3522
|
+
Enabled: pending
|
|
3523
|
+
VersionAdded: '1.9'
|
|
3524
|
+
SafeAutoCorrect: false
|
|
3525
|
+
AllowedMethods:
|
|
3526
|
+
- nonzero?
|
|
3527
|
+
|
|
3408
3528
|
Style/IfWithSemicolon:
|
|
3409
3529
|
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
|
3410
3530
|
StyleGuide: '#no-semicolon-ifs'
|
|
@@ -3481,6 +3601,7 @@ Style/KeywordParametersOrder:
|
|
|
3481
3601
|
StyleGuide: '#keyword-parameters-order'
|
|
3482
3602
|
Enabled: true
|
|
3483
3603
|
VersionAdded: '0.90'
|
|
3604
|
+
VersionChanged: '1.7'
|
|
3484
3605
|
|
|
3485
3606
|
Style/Lambda:
|
|
3486
3607
|
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
|
@@ -3519,7 +3640,7 @@ Style/MethodCallWithArgsParentheses:
|
|
|
3519
3640
|
StyleGuide: '#method-invocation-parens'
|
|
3520
3641
|
Enabled: false
|
|
3521
3642
|
VersionAdded: '0.47'
|
|
3522
|
-
VersionChanged: '
|
|
3643
|
+
VersionChanged: '1.7'
|
|
3523
3644
|
IgnoreMacros: true
|
|
3524
3645
|
IgnoredMethods: []
|
|
3525
3646
|
IgnoredPatterns: []
|
|
@@ -3553,7 +3674,7 @@ Style/MethodDefParentheses:
|
|
|
3553
3674
|
StyleGuide: '#method-parens'
|
|
3554
3675
|
Enabled: true
|
|
3555
3676
|
VersionAdded: '0.16'
|
|
3556
|
-
VersionChanged: '
|
|
3677
|
+
VersionChanged: '1.7'
|
|
3557
3678
|
EnforcedStyle: require_parentheses
|
|
3558
3679
|
SupportedStyles:
|
|
3559
3680
|
- require_parentheses
|
|
@@ -3659,6 +3780,7 @@ Style/MultilineMethodSignature:
|
|
|
3659
3780
|
Description: 'Avoid multi-line method signatures.'
|
|
3660
3781
|
Enabled: false
|
|
3661
3782
|
VersionAdded: '0.59'
|
|
3783
|
+
VersionChanged: '1.7'
|
|
3662
3784
|
|
|
3663
3785
|
Style/MultilineTernaryOperator:
|
|
3664
3786
|
Description: >-
|
|
@@ -3687,7 +3809,8 @@ Style/MutableConstant:
|
|
|
3687
3809
|
Description: 'Do not assign mutable objects to constants.'
|
|
3688
3810
|
Enabled: true
|
|
3689
3811
|
VersionAdded: '0.34'
|
|
3690
|
-
VersionChanged: '
|
|
3812
|
+
VersionChanged: '1.8'
|
|
3813
|
+
SafeAutoCorrect: false
|
|
3691
3814
|
EnforcedStyle: literals
|
|
3692
3815
|
SupportedStyles:
|
|
3693
3816
|
# literals: freeze literals assigned to constants
|
|
@@ -4025,11 +4148,16 @@ Style/RedundantArgument:
|
|
|
4025
4148
|
Enabled: pending
|
|
4026
4149
|
Safe: false
|
|
4027
4150
|
VersionAdded: '1.4'
|
|
4151
|
+
VersionChanged: '1.7'
|
|
4028
4152
|
Methods:
|
|
4029
4153
|
# Array#join
|
|
4030
4154
|
join: ''
|
|
4031
4155
|
# String#split
|
|
4032
4156
|
split: ' '
|
|
4157
|
+
# String#chomp
|
|
4158
|
+
chomp: "\n"
|
|
4159
|
+
# String#chomp!
|
|
4160
|
+
chomp!: "\n"
|
|
4033
4161
|
|
|
4034
4162
|
Style/RedundantAssignment:
|
|
4035
4163
|
Description: 'Checks for redundant assignment before returning.'
|
|
@@ -4272,7 +4400,7 @@ Style/SingleLineBlockParams:
|
|
|
4272
4400
|
Description: 'Enforces the names of some block params.'
|
|
4273
4401
|
Enabled: false
|
|
4274
4402
|
VersionAdded: '0.16'
|
|
4275
|
-
VersionChanged: '
|
|
4403
|
+
VersionChanged: '1.6'
|
|
4276
4404
|
Methods:
|
|
4277
4405
|
- reduce:
|
|
4278
4406
|
- acc
|
|
@@ -4286,7 +4414,7 @@ Style/SingleLineMethods:
|
|
|
4286
4414
|
StyleGuide: '#no-single-line-methods'
|
|
4287
4415
|
Enabled: true
|
|
4288
4416
|
VersionAdded: '0.9'
|
|
4289
|
-
VersionChanged: '
|
|
4417
|
+
VersionChanged: '1.8'
|
|
4290
4418
|
AllowIfMethodIsEmpty: true
|
|
4291
4419
|
|
|
4292
4420
|
Style/SlicingWithRange:
|
|
@@ -4345,6 +4473,7 @@ Style/StringConcatenation:
|
|
|
4345
4473
|
Enabled: true
|
|
4346
4474
|
Safe: false
|
|
4347
4475
|
VersionAdded: '0.89'
|
|
4476
|
+
VersionChanged: '1.6'
|
|
4348
4477
|
|
|
4349
4478
|
Style/StringHashKeys:
|
|
4350
4479
|
Description: 'Prefer symbols instead of strings as hash keys.'
|
data/lib/chefstyle/version.rb
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
#
|
|
3
|
+
# Copyright:: Chef Software, Inc.
|
|
4
|
+
# Author:: Tim Smith (<tsmith@chef.io>)
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
|
|
19
|
+
module RuboCop
|
|
20
|
+
module Cop
|
|
21
|
+
module Chef
|
|
22
|
+
module Ruby
|
|
23
|
+
# Use powershell_exec!/powershell_exec instead of powershell_out!/powershell_out. The new
|
|
24
|
+
# methods don't spawn 2 shells per shellout and instead use .NET bindings to call PS directly.
|
|
25
|
+
class LegacyPowershellOutMethods < Base
|
|
26
|
+
MSG = "Use powershell_exec!/powershell_exec instead of the slower legacy powershell_out!/powershell_out methods."
|
|
27
|
+
RESTRICT_ON_SEND = %i{powershell_out! powershell_out}.freeze
|
|
28
|
+
|
|
29
|
+
def on_send(node)
|
|
30
|
+
add_offense(node, message: MSG, severity: :refactor)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
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.6.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:
|
|
11
|
+
date: 2021-02-01 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: 1.
|
|
19
|
+
version: 1.9.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: 1.
|
|
26
|
+
version: 1.9.1
|
|
27
27
|
description:
|
|
28
28
|
email:
|
|
29
29
|
- oss@chef.io
|
|
@@ -43,6 +43,7 @@ files:
|
|
|
43
43
|
- lib/chefstyle/version.rb
|
|
44
44
|
- lib/rubocop/chef.rb
|
|
45
45
|
- lib/rubocop/cop/chef/ruby/gemspec_require_rubygems.rb
|
|
46
|
+
- lib/rubocop/cop/chef/ruby/legacy_powershell_out_methods.rb
|
|
46
47
|
- lib/rubocop/cop/chef/ruby/require_net_https.rb
|
|
47
48
|
- lib/rubocop/cop/chef/ruby/ruby_27_keyword_argument_warnings.rb
|
|
48
49
|
- lib/rubocop/cop/chef/ruby/unless_defined_require.rb
|
|
@@ -65,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
65
66
|
- !ruby/object:Gem::Version
|
|
66
67
|
version: '0'
|
|
67
68
|
requirements: []
|
|
68
|
-
rubygems_version: 3.
|
|
69
|
+
rubygems_version: 3.1.4
|
|
69
70
|
signing_key:
|
|
70
71
|
specification_version: 4
|
|
71
72
|
summary: RuboCop configuration for Chef's ruby projects
|