chefstyle 1.0.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/chefstyle.gemspec +25 -0
- data/config/chefstyle.yml +6 -0
- data/config/disable_all.yml +22 -0
- data/config/upstream.yml +157 -27
- data/lib/chefstyle/version.rb +2 -2
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e40deeb91a3e76c9814149540784f399683722e39ee23882fb47a54746ccb544
|
4
|
+
data.tar.gz: 00d5f5e04092c6e38092977dd7e258053a979fc85325f807f21ad7cc4012d8c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c03f7c0554896e837df0e8a4b90224ff5c9004107af2487d2dca50cc6a9422ce56d742676a6ccd30dfd87e40b28b2da825697cba628c4118ddf30fe8935f135
|
7
|
+
data.tar.gz: 6abc093693bc6cc9695b7e2d9a4843bbfa046a5f25f07958ec797aef4e8084f59dbeb75ea7d8320e5bcfa965b7fb0c42c695f21216263d2c69544117882bb85f
|
data/chefstyle.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "chefstyle/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "chefstyle"
|
8
|
+
spec.version = Chefstyle::VERSION
|
9
|
+
spec.authors = ["Chef Software, Inc."]
|
10
|
+
spec.email = ["oss@chef.io"]
|
11
|
+
|
12
|
+
spec.summary = %q{RuboCop configuration for Chef's ruby projects}
|
13
|
+
spec.homepage = "https://github.com/chef/chefstyle"
|
14
|
+
spec.license = "Apache-2.0"
|
15
|
+
spec.required_ruby_version = ">= 2.4"
|
16
|
+
|
17
|
+
spec.files = %w{LICENSE chefstyle.gemspec} + Dir.glob("{bin,config,lib}/**/*", File::FNM_DOTMATCH).reject { |f| File.directory?(f) }
|
18
|
+
spec.executables = %w{chefstyle}
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler"
|
22
|
+
spec.add_development_dependency "rake", ">= 12.0"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_dependency("rubocop", Chefstyle::RUBOCOP_VERSION)
|
25
|
+
end
|
data/config/chefstyle.yml
CHANGED
@@ -123,6 +123,8 @@ Lint/UselessSetterCall:
|
|
123
123
|
Enabled: true
|
124
124
|
Lint/Void:
|
125
125
|
Enabled: true
|
126
|
+
Layout/CommentIndentation:
|
127
|
+
Enabled: true
|
126
128
|
|
127
129
|
#
|
128
130
|
# Disabled Lint
|
@@ -626,3 +628,7 @@ Style/Alias:
|
|
626
628
|
# anyone else's time either.
|
627
629
|
Style/CommentedKeyword:
|
628
630
|
Enabled: false
|
631
|
+
|
632
|
+
# make sure we catch this Ruby 3.0 breaking change now
|
633
|
+
Lint/DeprecatedOpenSSLConstant:
|
634
|
+
Enabled: true
|
data/config/disable_all.yml
CHANGED
@@ -59,6 +59,8 @@ Layout/EmptyLinesAroundAccessModifier:
|
|
59
59
|
Enabled: false
|
60
60
|
Layout/EmptyLinesAroundArguments:
|
61
61
|
Enabled: false
|
62
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
63
|
+
Enabled: false
|
62
64
|
Layout/EmptyLinesAroundBeginBody:
|
63
65
|
Enabled: false
|
64
66
|
Layout/EmptyLinesAroundBlockBody:
|
@@ -209,10 +211,14 @@ Lint/BooleanSymbol:
|
|
209
211
|
Enabled: false
|
210
212
|
Lint/CircularArgumentReference:
|
211
213
|
Enabled: false
|
214
|
+
Lint/ConstantResolution:
|
215
|
+
Enabled: false
|
212
216
|
Lint/Debugger:
|
213
217
|
Enabled: false
|
214
218
|
Lint/DeprecatedClassMethods:
|
215
219
|
Enabled: false
|
220
|
+
Lint/DeprecatedOpenSSLConstant:
|
221
|
+
Enabled: false
|
216
222
|
Lint/DisjunctiveAssignmentInConstructor:
|
217
223
|
Enabled: false
|
218
224
|
Lint/DuplicateCaseCondition:
|
@@ -261,6 +267,8 @@ Lint/Loop:
|
|
261
267
|
Enabled: false
|
262
268
|
Lint/MissingCopEnableDirective:
|
263
269
|
Enabled: false
|
270
|
+
Lint/MixedRegexpCaptureTypes:
|
271
|
+
Enabled: false
|
264
272
|
Lint/MultipleComparison:
|
265
273
|
Enabled: false
|
266
274
|
Lint/NestedMethodDefinition:
|
@@ -413,6 +421,8 @@ Naming/VariableNumber:
|
|
413
421
|
Enabled: false
|
414
422
|
Style/AccessModifierDeclarations:
|
415
423
|
Enabled: false
|
424
|
+
Style/AccessorGrouping:
|
425
|
+
Enabled: false
|
416
426
|
Style/Alias:
|
417
427
|
Enabled: false
|
418
428
|
Style/AndOr:
|
@@ -429,6 +439,8 @@ Style/BarePercentLiterals:
|
|
429
439
|
Enabled: false
|
430
440
|
Style/BeginBlock:
|
431
441
|
Enabled: false
|
442
|
+
Style/BisectedAttrAccessor:
|
443
|
+
Enabled: false
|
432
444
|
Style/BlockComments:
|
433
445
|
Enabled: false
|
434
446
|
Style/BlockDelimiters:
|
@@ -559,6 +571,10 @@ Style/MethodCallWithoutArgsParentheses:
|
|
559
571
|
Enabled: false
|
560
572
|
Style/MethodCallWithArgsParentheses:
|
561
573
|
Enabled: false
|
574
|
+
Style/RedundantAssignment:
|
575
|
+
Enabled: false
|
576
|
+
Style/RedundantFetchBlock:
|
577
|
+
Enabled: false
|
562
578
|
Style/MethodCalledOnDoEndBlock:
|
563
579
|
Enabled: false
|
564
580
|
Style/MethodDefParentheses:
|
@@ -665,6 +681,10 @@ Style/RedundantParentheses:
|
|
665
681
|
Enabled: false
|
666
682
|
Style/RedundantPercentQ:
|
667
683
|
Enabled: false
|
684
|
+
Style/RedundantRegexpCharacterClass:
|
685
|
+
Enabled: false
|
686
|
+
Style/RedundantRegexpEscape:
|
687
|
+
Enabled: false
|
668
688
|
Style/RedundantReturn:
|
669
689
|
Enabled: false
|
670
690
|
Style/RedundantSelf:
|
@@ -697,6 +717,8 @@ Style/SingleLineBlockParams:
|
|
697
717
|
Enabled: false
|
698
718
|
Style/SingleLineMethods:
|
699
719
|
Enabled: false
|
720
|
+
Style/SlicingWithRange:
|
721
|
+
Enabled: false
|
700
722
|
Style/SpecialGlobalVars:
|
701
723
|
Enabled: false
|
702
724
|
Style/StabbyLambdaParentheses:
|
data/config/upstream.yml
CHANGED
@@ -35,6 +35,7 @@ AllCops:
|
|
35
35
|
- '**/*.watchr'
|
36
36
|
- '**/.irbrc'
|
37
37
|
- '**/.pryrc'
|
38
|
+
- '**/.simplecov'
|
38
39
|
- '**/buildfile'
|
39
40
|
- '**/Appraisals'
|
40
41
|
- '**/Berksfile'
|
@@ -53,6 +54,7 @@ AllCops:
|
|
53
54
|
- '**/Podfile'
|
54
55
|
- '**/Puppetfile'
|
55
56
|
- '**/Rakefile'
|
57
|
+
- '**/rakefile'
|
56
58
|
- '**/Snapfile'
|
57
59
|
- '**/Steepfile'
|
58
60
|
- '**/Thorfile'
|
@@ -151,12 +153,13 @@ Bundler/GemComment:
|
|
151
153
|
Description: 'Add a comment describing each gem.'
|
152
154
|
Enabled: false
|
153
155
|
VersionAdded: '0.59'
|
154
|
-
VersionChanged: '0.
|
156
|
+
VersionChanged: '0.85'
|
155
157
|
Include:
|
156
158
|
- '**/*.gemfile'
|
157
159
|
- '**/Gemfile'
|
158
160
|
- '**/gems.rb'
|
159
161
|
IgnoredGems: []
|
162
|
+
OnlyFor: []
|
160
163
|
|
161
164
|
Bundler/InsecureProtocolSource:
|
162
165
|
Description: >-
|
@@ -177,6 +180,9 @@ Bundler/OrderedGems:
|
|
177
180
|
VersionAdded: '0.46'
|
178
181
|
VersionChanged: '0.47'
|
179
182
|
TreatCommentsAsGroupSeparators: true
|
183
|
+
# By default, "-" and "_" are ignored for order purposes.
|
184
|
+
# This can be overridden by setting this parameter to true.
|
185
|
+
ConsiderPunctuation: false
|
180
186
|
Include:
|
181
187
|
- '**/*.gemfile'
|
182
188
|
- '**/Gemfile'
|
@@ -197,6 +203,9 @@ Gemspec/OrderedDependencies:
|
|
197
203
|
Enabled: true
|
198
204
|
VersionAdded: '0.51'
|
199
205
|
TreatCommentsAsGroupSeparators: true
|
206
|
+
# By default, "-" and "_" are ignored for order purposes.
|
207
|
+
# This can be overridden by setting this parameter to true.
|
208
|
+
ConsiderPunctuation: false
|
200
209
|
Include:
|
201
210
|
- '**/*.gemspec'
|
202
211
|
|
@@ -375,6 +384,7 @@ Layout/ConditionPosition:
|
|
375
384
|
StyleGuide: '#same-line-condition'
|
376
385
|
Enabled: true
|
377
386
|
VersionAdded: '0.53'
|
387
|
+
VersionChanged: '0.83'
|
378
388
|
|
379
389
|
Layout/DefEndAlignment:
|
380
390
|
Description: 'Align ends corresponding to defs correctly.'
|
@@ -460,6 +470,19 @@ Layout/EmptyLinesAroundArguments:
|
|
460
470
|
Enabled: true
|
461
471
|
VersionAdded: '0.52'
|
462
472
|
|
473
|
+
Layout/EmptyLinesAroundAttributeAccessor:
|
474
|
+
Description: "Keep blank lines around attribute accessors."
|
475
|
+
StyleGuide: '#empty-lines-around-attribute-accessor'
|
476
|
+
Enabled: pending
|
477
|
+
VersionAdded: '0.83'
|
478
|
+
VersionChanged: '0.84'
|
479
|
+
AllowAliasSyntax: true
|
480
|
+
AllowedMethods:
|
481
|
+
- alias_method
|
482
|
+
- public
|
483
|
+
- protected
|
484
|
+
- private
|
485
|
+
|
463
486
|
Layout/EmptyLinesAroundBeginBody:
|
464
487
|
Description: "Keeps track of empty lines around begin-end bodies."
|
465
488
|
StyleGuide: '#empty-lines-around-bodies'
|
@@ -774,13 +797,7 @@ Layout/HeredocIndentation:
|
|
774
797
|
StyleGuide: '#squiggly-heredocs'
|
775
798
|
Enabled: true
|
776
799
|
VersionAdded: '0.49'
|
777
|
-
VersionChanged: '0.
|
778
|
-
EnforcedStyle: squiggly
|
779
|
-
SupportedStyles:
|
780
|
-
- squiggly
|
781
|
-
- active_support
|
782
|
-
- powerpack
|
783
|
-
- unindent
|
800
|
+
VersionChanged: '0.85'
|
784
801
|
|
785
802
|
Layout/IndentationConsistency:
|
786
803
|
Description: 'Keep indentation straight.'
|
@@ -848,13 +865,13 @@ Layout/LeadingEmptyLines:
|
|
848
865
|
VersionChanged: '0.77'
|
849
866
|
|
850
867
|
Layout/LineLength:
|
851
|
-
Description: '
|
852
|
-
StyleGuide: '#
|
868
|
+
Description: 'Checks that line length does not exceed the configured limit.'
|
869
|
+
StyleGuide: '#max-line-length'
|
853
870
|
Enabled: true
|
854
871
|
VersionAdded: '0.25'
|
855
|
-
VersionChanged: '0.
|
872
|
+
VersionChanged: '0.84'
|
856
873
|
AutoCorrect: false
|
857
|
-
Max:
|
874
|
+
Max: 120
|
858
875
|
# To make it possible to copy or click on URIs in the code, we allow lines
|
859
876
|
# containing a URI to be longer than Max.
|
860
877
|
AllowHeredoc: true
|
@@ -1295,8 +1312,8 @@ Layout/TrailingWhitespace:
|
|
1295
1312
|
StyleGuide: '#no-trailing-whitespace'
|
1296
1313
|
Enabled: true
|
1297
1314
|
VersionAdded: '0.49'
|
1298
|
-
VersionChanged: '0.
|
1299
|
-
AllowInHeredoc:
|
1315
|
+
VersionChanged: '0.83'
|
1316
|
+
AllowInHeredoc: true
|
1300
1317
|
|
1301
1318
|
#################### Lint ##################################
|
1302
1319
|
### Warnings
|
@@ -1316,6 +1333,7 @@ Lint/AmbiguousOperator:
|
|
1316
1333
|
StyleGuide: '#method-invocation-parens'
|
1317
1334
|
Enabled: true
|
1318
1335
|
VersionAdded: '0.17'
|
1336
|
+
VersionChanged: '0.83'
|
1319
1337
|
|
1320
1338
|
Lint/AmbiguousRegexpLiteral:
|
1321
1339
|
Description: >-
|
@@ -1323,6 +1341,7 @@ Lint/AmbiguousRegexpLiteral:
|
|
1323
1341
|
a method invocation without parentheses.
|
1324
1342
|
Enabled: true
|
1325
1343
|
VersionAdded: '0.17'
|
1344
|
+
VersionChanged: '0.83'
|
1326
1345
|
|
1327
1346
|
Lint/AssignmentInCondition:
|
1328
1347
|
Description: "Don't use assignment in conditions."
|
@@ -1339,14 +1358,24 @@ Lint/BigDecimalNew:
|
|
1339
1358
|
Lint/BooleanSymbol:
|
1340
1359
|
Description: 'Check for `:true` and `:false` symbols.'
|
1341
1360
|
Enabled: true
|
1361
|
+
Safe: false
|
1342
1362
|
VersionAdded: '0.50'
|
1343
|
-
VersionChanged: '0.
|
1363
|
+
VersionChanged: '0.83'
|
1344
1364
|
|
1345
1365
|
Lint/CircularArgumentReference:
|
1346
1366
|
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
|
1347
1367
|
Enabled: true
|
1348
1368
|
VersionAdded: '0.33'
|
1349
1369
|
|
1370
|
+
Lint/ConstantResolution:
|
1371
|
+
Description: 'Check that constants are fully qualified with `::`.'
|
1372
|
+
Enabled: false
|
1373
|
+
VersionAdded: '0.86'
|
1374
|
+
# Restrict this cop to only looking at certain names
|
1375
|
+
Only: []
|
1376
|
+
# Restrict this cop from only looking at certain names
|
1377
|
+
Ignore: []
|
1378
|
+
|
1350
1379
|
Lint/Debugger:
|
1351
1380
|
Description: 'Check for debugger calls.'
|
1352
1381
|
Enabled: true
|
@@ -1358,6 +1387,11 @@ Lint/DeprecatedClassMethods:
|
|
1358
1387
|
Enabled: true
|
1359
1388
|
VersionAdded: '0.19'
|
1360
1389
|
|
1390
|
+
Lint/DeprecatedOpenSSLConstant:
|
1391
|
+
Description: "Don't use algorithm constants for `OpenSSL::Cipher` and `OpenSSL::Digest`."
|
1392
|
+
Enabled: pending
|
1393
|
+
VersionAdded: '0.84'
|
1394
|
+
|
1361
1395
|
Lint/DisjunctiveAssignmentInConstructor:
|
1362
1396
|
Description: 'In constructor, plain assignment is preferred over disjunctive.'
|
1363
1397
|
Enabled: true
|
@@ -1411,13 +1445,16 @@ Lint/EmptyInterpolation:
|
|
1411
1445
|
Lint/EmptyWhen:
|
1412
1446
|
Description: 'Checks for `when` branches with empty bodies.'
|
1413
1447
|
Enabled: true
|
1448
|
+
AllowComments: true
|
1414
1449
|
VersionAdded: '0.45'
|
1450
|
+
VersionChanged: '0.83'
|
1415
1451
|
|
1416
1452
|
Lint/EnsureReturn:
|
1417
1453
|
Description: 'Do not use return in an ensure block.'
|
1418
1454
|
StyleGuide: '#no-return-ensure'
|
1419
1455
|
Enabled: true
|
1420
1456
|
VersionAdded: '0.9'
|
1457
|
+
VersionChanged: '0.83'
|
1421
1458
|
|
1422
1459
|
Lint/ErbNewArguments:
|
1423
1460
|
Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
|
@@ -1477,7 +1514,9 @@ Lint/InheritException:
|
|
1477
1514
|
Lint/InterpolationCheck:
|
1478
1515
|
Description: 'Raise warning for interpolation in single q strs.'
|
1479
1516
|
Enabled: true
|
1517
|
+
SafeAutoCorrect: false
|
1480
1518
|
VersionAdded: '0.50'
|
1519
|
+
VersionChanged: '0.87'
|
1481
1520
|
|
1482
1521
|
Lint/LiteralAsCondition:
|
1483
1522
|
Description: 'Checks of literals used in conditions.'
|
@@ -1511,6 +1550,11 @@ Lint/MissingCopEnableDirective:
|
|
1511
1550
|
# .inf for any size
|
1512
1551
|
MaximumRangeSize: .inf
|
1513
1552
|
|
1553
|
+
Lint/MixedRegexpCaptureTypes:
|
1554
|
+
Description: 'Do not mix named captures and numbered captures in a Regexp literal.'
|
1555
|
+
Enabled: pending
|
1556
|
+
VersionAdded: '0.85'
|
1557
|
+
|
1514
1558
|
Lint/MultipleComparison:
|
1515
1559
|
Description: "Use `&&` operator to compare multiple values."
|
1516
1560
|
Enabled: true
|
@@ -1565,6 +1609,7 @@ Lint/ParenthesesAsGroupedExpression:
|
|
1565
1609
|
StyleGuide: '#parens-no-spaces'
|
1566
1610
|
Enabled: true
|
1567
1611
|
VersionAdded: '0.12'
|
1612
|
+
VersionChanged: '0.83'
|
1568
1613
|
|
1569
1614
|
Lint/PercentStringArray:
|
1570
1615
|
Description: >-
|
@@ -1583,7 +1628,9 @@ Lint/RaiseException:
|
|
1583
1628
|
Description: Checks for `raise` or `fail` statements which are raising `Exception` class.
|
1584
1629
|
StyleGuide: '#raise-exception'
|
1585
1630
|
Enabled: pending
|
1631
|
+
Safe: false
|
1586
1632
|
VersionAdded: '0.81'
|
1633
|
+
VersionChanged: '0.86'
|
1587
1634
|
AllowedImplicitNamespaces:
|
1588
1635
|
- 'Gem'
|
1589
1636
|
|
@@ -1640,6 +1687,7 @@ Lint/RegexpAsCondition:
|
|
1640
1687
|
The regexp literal matches `$_` implicitly.
|
1641
1688
|
Enabled: true
|
1642
1689
|
VersionAdded: '0.51'
|
1690
|
+
VersionChanged: '0.86'
|
1643
1691
|
|
1644
1692
|
Lint/RequireParentheses:
|
1645
1693
|
Description: >-
|
@@ -1696,6 +1744,7 @@ Lint/SafeNavigationWithEmpty:
|
|
1696
1744
|
Description: 'Avoid `foo&.empty?` in conditionals.'
|
1697
1745
|
Enabled: true
|
1698
1746
|
VersionAdded: '0.62'
|
1747
|
+
VersionChanged: '0.87'
|
1699
1748
|
|
1700
1749
|
Lint/ScriptPermission:
|
1701
1750
|
Description: 'Grant script file execute permission.'
|
@@ -1808,7 +1857,7 @@ Lint/UselessAccessModifier:
|
|
1808
1857
|
Description: 'Checks for useless access modifiers.'
|
1809
1858
|
Enabled: true
|
1810
1859
|
VersionAdded: '0.20'
|
1811
|
-
VersionChanged: '0.
|
1860
|
+
VersionChanged: '0.83'
|
1812
1861
|
ContextCreatingMethods: []
|
1813
1862
|
MethodCreatingMethods: []
|
1814
1863
|
|
@@ -1862,9 +1911,10 @@ Metrics/BlockLength:
|
|
1862
1911
|
Description: 'Avoid long blocks with many lines.'
|
1863
1912
|
Enabled: true
|
1864
1913
|
VersionAdded: '0.44'
|
1865
|
-
VersionChanged: '0.
|
1914
|
+
VersionChanged: '0.87'
|
1866
1915
|
CountComments: false # count full line comments?
|
1867
1916
|
Max: 25
|
1917
|
+
CountAsOne: []
|
1868
1918
|
ExcludedMethods:
|
1869
1919
|
# By default, exclude the `#refine` method, as it tends to have larger
|
1870
1920
|
# associated blocks.
|
@@ -1885,8 +1935,10 @@ Metrics/ClassLength:
|
|
1885
1935
|
Description: 'Avoid classes longer than 100 lines of code.'
|
1886
1936
|
Enabled: true
|
1887
1937
|
VersionAdded: '0.25'
|
1938
|
+
VersionChanged: '0.87'
|
1888
1939
|
CountComments: false # count full line comments?
|
1889
1940
|
Max: 100
|
1941
|
+
CountAsOne: []
|
1890
1942
|
|
1891
1943
|
# Avoid complex methods.
|
1892
1944
|
Metrics/CyclomaticComplexity:
|
@@ -1897,24 +1949,27 @@ Metrics/CyclomaticComplexity:
|
|
1897
1949
|
VersionAdded: '0.25'
|
1898
1950
|
VersionChanged: '0.81'
|
1899
1951
|
IgnoredMethods: []
|
1900
|
-
Max:
|
1952
|
+
Max: 7
|
1901
1953
|
|
1902
1954
|
Metrics/MethodLength:
|
1903
1955
|
Description: 'Avoid methods longer than 10 lines of code.'
|
1904
1956
|
StyleGuide: '#short-methods'
|
1905
1957
|
Enabled: true
|
1906
1958
|
VersionAdded: '0.25'
|
1907
|
-
VersionChanged: '0.
|
1959
|
+
VersionChanged: '0.87'
|
1908
1960
|
CountComments: false # count full line comments?
|
1909
1961
|
Max: 10
|
1962
|
+
CountAsOne: []
|
1910
1963
|
ExcludedMethods: []
|
1911
1964
|
|
1912
1965
|
Metrics/ModuleLength:
|
1913
1966
|
Description: 'Avoid modules longer than 100 lines of code.'
|
1914
1967
|
Enabled: true
|
1915
1968
|
VersionAdded: '0.31'
|
1969
|
+
VersionChanged: '0.87'
|
1916
1970
|
CountComments: false # count full line comments?
|
1917
1971
|
Max: 100
|
1972
|
+
CountAsOne: []
|
1918
1973
|
|
1919
1974
|
Metrics/ParameterLists:
|
1920
1975
|
Description: 'Avoid parameter lists longer than three or four parameters.'
|
@@ -1952,10 +2007,12 @@ Naming/AccessorMethodName:
|
|
1952
2007
|
VersionAdded: '0.50'
|
1953
2008
|
|
1954
2009
|
Naming/AsciiIdentifiers:
|
1955
|
-
Description: 'Use only ascii symbols in identifiers.'
|
2010
|
+
Description: 'Use only ascii symbols in identifiers and constants.'
|
1956
2011
|
StyleGuide: '#english-identifiers'
|
1957
2012
|
Enabled: true
|
1958
2013
|
VersionAdded: '0.50'
|
2014
|
+
VersionChanged: '0.87'
|
2015
|
+
AsciiConstants: true
|
1959
2016
|
|
1960
2017
|
Naming/BinaryOperatorParameterName:
|
1961
2018
|
Description: 'When defining binary operators, name the argument other.'
|
@@ -1983,6 +2040,11 @@ Naming/ClassAndModuleCamelCase:
|
|
1983
2040
|
StyleGuide: '#camelcase-classes'
|
1984
2041
|
Enabled: true
|
1985
2042
|
VersionAdded: '0.50'
|
2043
|
+
VersionChanged: '0.85'
|
2044
|
+
# Allowed class/module names can be specified here.
|
2045
|
+
# These can be full or part of the name.
|
2046
|
+
AllowedNames:
|
2047
|
+
- module_parent
|
1986
2048
|
|
1987
2049
|
Naming/ConstantName:
|
1988
2050
|
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
@@ -2003,6 +2065,10 @@ Naming/FileName:
|
|
2003
2065
|
# It further expects it to be nested inside modules which match the names
|
2004
2066
|
# of subdirectories in its path.
|
2005
2067
|
ExpectMatchingDefinition: false
|
2068
|
+
# When `false`, changes the behavior of ExpectMatchingDefinition to match only
|
2069
|
+
# whether each source file's class or module name matches the file name --
|
2070
|
+
# not whether the nested module hierarchy matches the subdirectory path.
|
2071
|
+
CheckDefinitionPathHierarchy: true
|
2006
2072
|
# If non-`nil`, expect all source file names to match the following regex.
|
2007
2073
|
# Only the file name itself is matched, not the entire file path.
|
2008
2074
|
# Use anchors as necessary if you want to match the entire name rather than
|
@@ -2194,7 +2260,7 @@ Security/JSONLoad:
|
|
2194
2260
|
Description: >-
|
2195
2261
|
Prefer usage of `JSON.parse` over `JSON.load` due to potential
|
2196
2262
|
security issues. See reference for more information.
|
2197
|
-
Reference: 'https://ruby-doc.org/stdlib-2.
|
2263
|
+
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/json/rdoc/JSON.html#method-i-load'
|
2198
2264
|
Enabled: true
|
2199
2265
|
VersionAdded: '0.43'
|
2200
2266
|
VersionChanged: '0.44'
|
@@ -2207,7 +2273,7 @@ Security/MarshalLoad:
|
|
2207
2273
|
Description: >-
|
2208
2274
|
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
|
2209
2275
|
security issues. See reference for more information.
|
2210
|
-
Reference: 'https://ruby-doc.org/core-2.
|
2276
|
+
Reference: 'https://ruby-doc.org/core-2.7.0/Marshal.html#module-Marshal-label-Security+considerations'
|
2211
2277
|
Enabled: true
|
2212
2278
|
VersionAdded: '0.47'
|
2213
2279
|
|
@@ -2221,7 +2287,7 @@ Security/YAMLLoad:
|
|
2221
2287
|
Description: >-
|
2222
2288
|
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
|
2223
2289
|
security issues. See reference for more information.
|
2224
|
-
Reference: 'https://ruby-doc.org/stdlib-2.
|
2290
|
+
Reference: 'https://ruby-doc.org/stdlib-2.7.0/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
|
2225
2291
|
Enabled: true
|
2226
2292
|
VersionAdded: '0.47'
|
2227
2293
|
SafeAutoCorrect: false
|
@@ -2239,6 +2305,17 @@ Style/AccessModifierDeclarations:
|
|
2239
2305
|
- group
|
2240
2306
|
AllowModifiersOnSymbols: true
|
2241
2307
|
|
2308
|
+
Style/AccessorGrouping:
|
2309
|
+
Description: 'Checks for grouping of accessors in `class` and `module` bodies.'
|
2310
|
+
Enabled: 'pending'
|
2311
|
+
VersionAdded: '0.87'
|
2312
|
+
EnforcedStyle: grouped
|
2313
|
+
SupportedStyles:
|
2314
|
+
# separated: each accessor goes in a separate statement.
|
2315
|
+
# grouped: accessors are grouped into a single statement.
|
2316
|
+
- separated
|
2317
|
+
- grouped
|
2318
|
+
|
2242
2319
|
Style/Alias:
|
2243
2320
|
Description: 'Use alias instead of alias_method.'
|
2244
2321
|
StyleGuide: '#alias-method-lexically'
|
@@ -2258,7 +2335,7 @@ Style/AndOr:
|
|
2258
2335
|
VersionChanged: '0.25'
|
2259
2336
|
# Whether `and` and `or` are banned only in conditionals (conditionals)
|
2260
2337
|
# or completely (always).
|
2261
|
-
EnforcedStyle:
|
2338
|
+
EnforcedStyle: conditionals
|
2262
2339
|
SupportedStyles:
|
2263
2340
|
- always
|
2264
2341
|
- conditionals
|
@@ -2306,6 +2383,13 @@ Style/BeginBlock:
|
|
2306
2383
|
Enabled: true
|
2307
2384
|
VersionAdded: '0.9'
|
2308
2385
|
|
2386
|
+
Style/BisectedAttrAccessor:
|
2387
|
+
Description: >-
|
2388
|
+
Checks for places where `attr_reader` and `attr_writer`
|
2389
|
+
for the same method can be combined into single `attr_accessor`.
|
2390
|
+
Enabled: 'pending'
|
2391
|
+
VersionAdded: '0.87'
|
2392
|
+
|
2309
2393
|
Style/BlockComments:
|
2310
2394
|
Description: 'Do not use block comments.'
|
2311
2395
|
StyleGuide: '#no-block-comments'
|
@@ -2678,6 +2762,12 @@ Style/DoubleNegation:
|
|
2678
2762
|
StyleGuide: '#no-bang-bang'
|
2679
2763
|
Enabled: true
|
2680
2764
|
VersionAdded: '0.19'
|
2765
|
+
VersionChanged: '0.84'
|
2766
|
+
EnforcedStyle: allowed_in_returns
|
2767
|
+
SafeAutoCorrect: false
|
2768
|
+
SupportedStyles:
|
2769
|
+
- allowed_in_returns
|
2770
|
+
- forbidden
|
2681
2771
|
|
2682
2772
|
Style/EachForSimpleLoop:
|
2683
2773
|
Description: >-
|
@@ -2841,8 +2931,7 @@ Style/FrozenStringLiteralComment:
|
|
2841
2931
|
SupportedStyles:
|
2842
2932
|
# `always` will always add the frozen string literal comment to a file
|
2843
2933
|
# regardless of the Ruby version or if `freeze` or `<<` are called on a
|
2844
|
-
# string literal.
|
2845
|
-
# possible that this will create errors in Ruby 2.3.0+.
|
2934
|
+
# string literal. It is possible that this will create errors.
|
2846
2935
|
- always
|
2847
2936
|
# `always_true` will add the frozen string literal comment to a file,
|
2848
2937
|
# similarly to the `always` style, but will also change any disabled
|
@@ -2942,12 +3031,14 @@ Style/IfUnlessModifierOfIfUnless:
|
|
2942
3031
|
Avoid modifier if/unless usage on conditionals.
|
2943
3032
|
Enabled: true
|
2944
3033
|
VersionAdded: '0.39'
|
3034
|
+
VersionChanged: '0.87'
|
2945
3035
|
|
2946
3036
|
Style/IfWithSemicolon:
|
2947
3037
|
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
2948
3038
|
StyleGuide: '#no-semicolon-ifs'
|
2949
3039
|
Enabled: true
|
2950
3040
|
VersionAdded: '0.9'
|
3041
|
+
VersionChanged: '0.83'
|
2951
3042
|
|
2952
3043
|
Style/ImplicitRuntimeError:
|
2953
3044
|
Description: >-
|
@@ -3197,6 +3288,7 @@ Style/MultilineTernaryOperator:
|
|
3197
3288
|
StyleGuide: '#no-multiline-ternary'
|
3198
3289
|
Enabled: true
|
3199
3290
|
VersionAdded: '0.9'
|
3291
|
+
VersionChanged: '0.86'
|
3200
3292
|
|
3201
3293
|
Style/MultilineWhenThen:
|
3202
3294
|
Description: 'Do not use then for multi-line when statement.'
|
@@ -3301,6 +3393,7 @@ Style/NestedTernaryOperator:
|
|
3301
3393
|
StyleGuide: '#no-nested-ternary'
|
3302
3394
|
Enabled: true
|
3303
3395
|
VersionAdded: '0.9'
|
3396
|
+
VersionChanged: '0.86'
|
3304
3397
|
|
3305
3398
|
Style/Next:
|
3306
3399
|
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
@@ -3425,7 +3518,9 @@ Style/OptionalArguments:
|
|
3425
3518
|
of the argument list.
|
3426
3519
|
StyleGuide: '#optional-arguments'
|
3427
3520
|
Enabled: true
|
3521
|
+
Safe: false
|
3428
3522
|
VersionAdded: '0.33'
|
3523
|
+
VersionChanged: '0.83'
|
3429
3524
|
|
3430
3525
|
Style/OrAssignment:
|
3431
3526
|
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
|
@@ -3523,6 +3618,11 @@ Style/RandomWithOffset:
|
|
3523
3618
|
Enabled: true
|
3524
3619
|
VersionAdded: '0.52'
|
3525
3620
|
|
3621
|
+
Style/RedundantAssignment:
|
3622
|
+
Description: 'Checks for redundant assignment before returning.'
|
3623
|
+
Enabled: 'pending'
|
3624
|
+
VersionAdded: '0.87'
|
3625
|
+
|
3526
3626
|
Style/RedundantBegin:
|
3527
3627
|
Description: "Don't use begin blocks when they are not needed."
|
3528
3628
|
StyleGuide: '#begin-implicit'
|
@@ -3552,6 +3652,19 @@ Style/RedundantException:
|
|
3552
3652
|
VersionAdded: '0.14'
|
3553
3653
|
VersionChanged: '0.29'
|
3554
3654
|
|
3655
|
+
Style/RedundantFetchBlock:
|
3656
|
+
Description: >-
|
3657
|
+
Use `fetch(key, value)` instead of `fetch(key) { value }`
|
3658
|
+
when value has Numeric, Rational, Complex, Symbol or String type, `false`, `true`, `nil` or is a constant.
|
3659
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code'
|
3660
|
+
Enabled: 'pending'
|
3661
|
+
Safe: false
|
3662
|
+
# If enabled, this cop will autocorrect usages of
|
3663
|
+
# `fetch` being called with block returning a constant.
|
3664
|
+
# This can be dangerous since constants will not be defined at that moment.
|
3665
|
+
SafeForConstants: false
|
3666
|
+
VersionAdded: '0.86'
|
3667
|
+
|
3555
3668
|
Style/RedundantFreeze:
|
3556
3669
|
Description: "Checks usages of Object#freeze on immutable objects."
|
3557
3670
|
Enabled: true
|
@@ -3574,6 +3687,16 @@ Style/RedundantPercentQ:
|
|
3574
3687
|
Enabled: true
|
3575
3688
|
VersionAdded: '0.76'
|
3576
3689
|
|
3690
|
+
Style/RedundantRegexpCharacterClass:
|
3691
|
+
Description: 'Checks for unnecessary single-element Regexp character classes.'
|
3692
|
+
Enabled: pending
|
3693
|
+
VersionAdded: '0.85'
|
3694
|
+
|
3695
|
+
Style/RedundantRegexpEscape:
|
3696
|
+
Description: 'Checks for redundant escapes in Regexps.'
|
3697
|
+
Enabled: pending
|
3698
|
+
VersionAdded: '0.85'
|
3699
|
+
|
3577
3700
|
Style/RedundantReturn:
|
3578
3701
|
Description: "Don't use return where it's not required."
|
3579
3702
|
StyleGuide: '#no-explicit-return'
|
@@ -3730,6 +3853,12 @@ Style/SingleLineMethods:
|
|
3730
3853
|
VersionChanged: '0.19'
|
3731
3854
|
AllowIfMethodIsEmpty: true
|
3732
3855
|
|
3856
|
+
Style/SlicingWithRange:
|
3857
|
+
Description: 'Checks array slicing is done with endless ranges when suitable.'
|
3858
|
+
Enabled: pending
|
3859
|
+
VersionAdded: '0.83'
|
3860
|
+
Safe: false
|
3861
|
+
|
3733
3862
|
Style/SpecialGlobalVars:
|
3734
3863
|
Description: 'Avoid Perl-style global variables.'
|
3735
3864
|
StyleGuide: '#no-cryptic-perlisms'
|
@@ -3815,6 +3944,7 @@ Style/StructInheritance:
|
|
3815
3944
|
StyleGuide: '#no-extend-struct-new'
|
3816
3945
|
Enabled: true
|
3817
3946
|
VersionAdded: '0.29'
|
3947
|
+
VersionChanged: '0.86'
|
3818
3948
|
|
3819
3949
|
Style/SymbolArray:
|
3820
3950
|
Description: 'Use %i or %I for arrays of symbols.'
|
@@ -3836,7 +3966,7 @@ Style/SymbolLiteral:
|
|
3836
3966
|
Style/SymbolProc:
|
3837
3967
|
Description: 'Use symbols as procs instead of blocks when possible.'
|
3838
3968
|
Enabled: true
|
3839
|
-
|
3969
|
+
Safe: false
|
3840
3970
|
VersionAdded: '0.26'
|
3841
3971
|
VersionChanged: '0.64'
|
3842
3972
|
# A list of method names to be ignored by the check.
|
data/lib/chefstyle/version.rb
CHANGED
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.1.3
|
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-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
61
|
+
version: 0.87.1
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
68
|
+
version: 0.87.1
|
69
69
|
description:
|
70
70
|
email:
|
71
71
|
- oss@chef.io
|
@@ -76,6 +76,7 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- LICENSE
|
78
78
|
- bin/chefstyle
|
79
|
+
- chefstyle.gemspec
|
79
80
|
- config/chefstyle.yml
|
80
81
|
- config/default.yml
|
81
82
|
- config/disable_all.yml
|