cookstyle 6.5.3 → 6.6.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84025c0a2c14cea15521215fabb39dd043ad6de8f1bb712ffa66fd0350287b5f
4
- data.tar.gz: 1df6c910b7d68aeb649a4e372964047ee059b5220a3db4d1ee3d2a69013c288f
3
+ metadata.gz: 841d3e5a94709493b68818d2a726c772d442c04d0bda8a5a456ed44f84a52717
4
+ data.tar.gz: 61513fcc4de0b8fc4695545352a68e371098128c7ff330f66d47fe5d194fe6cd
5
5
  SHA512:
6
- metadata.gz: f71145c0012b288b97112ba4bf0e0255b53f2e0d2e6d8e460bd182eaa7d8f41213cd91420e7b759b1c8cd7883ee5727b54dc7aa7cc54d93986691b3f8d729e78
7
- data.tar.gz: 4ec0deaaf4c3aad4de6f88c988c90f502682c6f944d19c199a82c735cbee651c2e3b1088bcef5ebe694674a6d04d44735d6792aba005059336f4bde83631f4c2
6
+ metadata.gz: aaa21cf5132c156ca96306da44fd9e0c2601ff4e43a253f92e3b3a5f55826ef5503694987707f2683d6dd32677987996b129df7f590b95d1af004d05420dd02d
7
+ data.tar.gz: 6b788999206fe69468c8458576afbc4933ce73fcb2c634399194237ad6ee57b4ab3c2c481851429bb0bb9c75c4a2bee38641a4775bcc0087206d4dc4a3495e1a
data/Gemfile CHANGED
@@ -6,7 +6,7 @@ gemspec
6
6
  group :debug do
7
7
  gem 'pry'
8
8
  gem 'pry-byebug'
9
- gem 'pry-stack_explorer'
9
+ gem 'pry-stack_explorer', '~> 0.4.0' # 0.5.0 drops support for Ruby < 2.6
10
10
  end
11
11
 
12
12
  group :docs do
@@ -31,8 +31,12 @@ AllCops:
31
31
  # ChefStyle: Making cookbooks look better
32
32
  ###############################
33
33
 
34
+ ChefStyle:
35
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefstyle.md
36
+
34
37
  ChefStyle/AttributeKeys:
35
38
  Description: Check which style of keys are used to access node attributes.
39
+ StyleGuide: '#chefstyleattributekeys'
36
40
  Enabled: true
37
41
  EnforcedStyle: strings
38
42
  VersionAdded: '5.0.0'
@@ -44,16 +48,19 @@ ChefStyle/AttributeKeys:
44
48
 
45
49
  ChefStyle/CopyrightCommentFormat:
46
50
  Description: Properly format copyright dates in comment blocks and ensure dates are up to date
51
+ StyleGuide: '#chefstylecopyrightcommentformat'
47
52
  Enabled: false
48
53
  VersionAdded: '5.0.0'
49
54
 
50
55
  ChefStyle/CommentSentenceSpacing:
51
56
  Description: Use a single space after sentences in comments
57
+ StyleGuide: '#chefstylecommentsentencespacing'
52
58
  Enabled: false
53
59
  VersionAdded: '5.1.0'
54
60
 
55
61
  ChefStyle/CommentFormat:
56
62
  Description: Use Chef's unique format for comment headers
63
+ StyleGuide: '#chefstylecommentformat'
57
64
  Enabled: true
58
65
  VersionAdded: '5.0.0'
59
66
  Exclude:
@@ -61,6 +68,7 @@ ChefStyle/CommentFormat:
61
68
 
62
69
  ChefStyle/FileMode:
63
70
  Description: Use strings to represent file modes in Chef resources
71
+ StyleGuide: '#chefstylefilemode'
64
72
  Enabled: true
65
73
  VersionAdded: '5.0.0'
66
74
  Exclude:
@@ -70,6 +78,7 @@ ChefStyle/FileMode:
70
78
 
71
79
  ChefStyle/UsePlatformHelpers:
72
80
  Description: Use platform? and platform_family? helpers to check node platform in resources and recipes
81
+ StyleGuide: '#chefstyleuseplatformhelpers'
73
82
  Enabled: true
74
83
  VersionAdded: '5.6.0'
75
84
  Exclude:
@@ -79,6 +88,7 @@ ChefStyle/UsePlatformHelpers:
79
88
 
80
89
  ChefStyle/SimplifyPlatformMajorVersionCheck:
81
90
  Description: Use node['platform_version'].to_i instead of node['platform_version'].split('.').first or node['platform_version'].split('.')[0]
91
+ StyleGuide: '#chefstylesimplifyplatformmajorversioncheck'
82
92
  Enabled: true
83
93
  VersionAdded: '5.8.0'
84
94
  Exclude:
@@ -87,11 +97,13 @@ ChefStyle/SimplifyPlatformMajorVersionCheck:
87
97
 
88
98
  ChefStyle/DefaultCopyrightComments:
89
99
  Description: Cookbook copyright comment headers should be updated for a real person or organization.
100
+ StyleGuide: '#chefstyledefaultcopyrightcomments'
90
101
  Enabled: true
91
102
  VersionAdded: '5.12.0'
92
103
 
93
104
  ChefStyle/UnnecessaryPlatformCaseStatement:
94
105
  Description: Use the platform?() and platform_family?() helpers instead of a case statement that only includes a single when statement.
106
+ StyleGuide: '#chefstyleunnecessaryplatformcasestatement'
95
107
  Enabled: true
96
108
  VersionAdded: '5.16.0'
97
109
  Exclude:
@@ -100,6 +112,7 @@ ChefStyle/UnnecessaryPlatformCaseStatement:
100
112
 
101
113
  ChefStyle/ImmediateNotificationTiming:
102
114
  Description: Use :immediately instead of :immediate for resource notification timing.
115
+ StyleGuide: '#chefstyleimmediatenotificationtiming'
103
116
  Enabled: true
104
117
  VersionAdded: '5.16.0'
105
118
  Exclude:
@@ -109,6 +122,7 @@ ChefStyle/ImmediateNotificationTiming:
109
122
 
110
123
  ChefStyle/TrueClassFalseClassResourceProperties:
111
124
  Description: When setting the allowed types for a resource to accept either true or false values it's much simpler to use true and false instead of TrueClass and FalseClass.
125
+ StyleGuide: '#chefstyletrueclassfalseclassresourceproperties'
112
126
  Enabled: true
113
127
  VersionAdded: '5.16.0'
114
128
  Include:
@@ -117,6 +131,7 @@ ChefStyle/TrueClassFalseClassResourceProperties:
117
131
 
118
132
  ChefStyle/OverlyComplexSupportsDependsMetadata:
119
133
  Description: Don't loop over an array to set cookbook dependencies or supported platforms if you have fewer than three values to set.
134
+ StyleGuide: '#chefstyleovercomplexsupportsdependsmetadata'
120
135
  Enabled: true
121
136
  VersionAdded: '5.19.0'
122
137
  Include:
@@ -124,11 +139,13 @@ ChefStyle/OverlyComplexSupportsDependsMetadata:
124
139
 
125
140
  ChefStyle/ChefWhaaat:
126
141
  Description: Do you mean Chef (the company) or a Chef product (e.g. Chef Infra, Chef InSpec, etc)?
142
+ StyleGuide: '#chefstylechefwhaaat'
127
143
  Enabled: false
128
144
  VersionAdded: '5.20.0'
129
145
 
130
146
  ChefStyle/UnnecessaryOSCheck:
131
147
  Description: Use the platform_family?() helpers instead of node['os] == 'foo' for platform_families that match 1:1 with OS values. These helpers are easier to read and can accept multiple platform arguments, which greatly simplifies complex platform logic.
148
+ StyleGuide: '#chefstyleunnecessaryoscheck'
132
149
  Enabled: true
133
150
  VersionAdded: '5.21.0'
134
151
  Exclude:
@@ -137,6 +154,7 @@ ChefStyle/UnnecessaryOSCheck:
137
154
 
138
155
  ChefStyle/NegatingOnlyIf:
139
156
  Description: Use not_if instead of only_if that negates the Ruby statement with a !
157
+ StyleGuide: '#chefstylenegatingonlyif'
140
158
  VersionAdded: '6.2.0'
141
159
  Enabled: true
142
160
  Exclude:
@@ -147,8 +165,12 @@ ChefStyle/NegatingOnlyIf:
147
165
  # ChefCorrectness: Avoiding potential problems
148
166
  ###############################
149
167
 
168
+ ChefCorrectness:
169
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefcorrectness.md
170
+
150
171
  ChefCorrectness/ServiceResource:
151
172
  Description: Use a service resource to start and stop services instead of execute resources
173
+ StyleGuide: '#chefcorrectnessserviceresource'
152
174
  Enabled: true
153
175
  VersionAdded: '5.0.0'
154
176
  Exclude:
@@ -158,6 +180,7 @@ ChefCorrectness/ServiceResource:
158
180
 
159
181
  ChefCorrectness/NodeNormal:
160
182
  Description: Do not use the node.normal method
183
+ StyleGuide: '#chefcorrectnessnodenormal'
161
184
  Enabled: true
162
185
  VersionAdded: '5.1.0'
163
186
  Exclude:
@@ -174,6 +197,7 @@ ChefCorrectness/NodeNormalUnless:
174
197
 
175
198
  ChefCorrectness/TmpPath:
176
199
  Description: Use file_cache_path rather than hard-coding tmp paths
200
+ StyleGuide: '#chefcorrectnessnodenormalunless'
177
201
  Enabled: true
178
202
  VersionAdded: '5.0.0'
179
203
  Exclude:
@@ -182,6 +206,7 @@ ChefCorrectness/TmpPath:
182
206
 
183
207
  ChefCorrectness/InvalidPlatformMetadata:
184
208
  Description: metadata.rb "supports" platform is invalid
209
+ StyleGuide: '#chefcorrectnessinvalidplatformmetadata'
185
210
  Enabled: true
186
211
  VersionAdded: '5.2.0'
187
212
  Include:
@@ -189,6 +214,7 @@ ChefCorrectness/InvalidPlatformMetadata:
189
214
 
190
215
  ChefCorrectness/CookbookUsesNodeSave:
191
216
  Description: Don't use node.save to save partial node data to the Chef Infra Server mid-run unless it's absolutely necessary. Node.save can result in failed Chef Infra runs appearing in search and increases load on the Chef Infra Server.
217
+ StyleGuide: '#chefcorrectnesscookbookusesnodesave'
192
218
  Enabled: true
193
219
  VersionAdded: '5.5.0'
194
220
  Exclude:
@@ -197,13 +223,15 @@ ChefCorrectness/CookbookUsesNodeSave:
197
223
 
198
224
  ChefCorrectness/CookbooksDependsOnSelf:
199
225
  Description: A cookbook cannot depend on itself
226
+ StyleGuide: '#chefcorrectnesscookbooksdependonself'
200
227
  Enabled: true
201
228
  VersionAdded: '5.2.0'
202
229
  Include:
203
230
  - '**/metadata.rb'
204
231
 
205
232
  ChefCorrectness/MetadataMissingName:
206
- Description: MetadataMissingName
233
+ Description: The metadata.rb file is missing the name field which is required by Chef Infra Client 12 and later
234
+ StyleGuide: '#chefcorrectnessmetadatamissingname'
207
235
  Enabled: true
208
236
  VersionAdded: '5.2.0'
209
237
  Include:
@@ -211,6 +239,7 @@ ChefCorrectness/MetadataMissingName:
211
239
 
212
240
  ChefCorrectness/BlockGuardWithOnlyString:
213
241
  Description: A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it be executed as Ruby code which will always returns true instead of a shell command that will actually run.
242
+ StyleGuide: '#chefcorrectnessblockguardwithonlystring'
214
243
  Enabled: true
215
244
  VersionAdded: '5.2.0'
216
245
  Exclude:
@@ -220,6 +249,7 @@ ChefCorrectness/BlockGuardWithOnlyString:
220
249
 
221
250
  ChefCorrectness/ResourceSetsInternalProperties:
222
251
  Description: Do not set properties used internally by Chef Infra Client to track the system state.
252
+ StyleGuide: '#chefcorrectnessresourcesetsinternalproperties'
223
253
  Enabled: true
224
254
  VersionAdded: '5.5.0'
225
255
  Exclude:
@@ -229,6 +259,7 @@ ChefCorrectness/ResourceSetsInternalProperties:
229
259
 
230
260
  ChefCorrectness/ResourceSetsNameProperty:
231
261
  Description: Resource sets the name property in the resource instead of using a name_property.
262
+ StyleGuide: '#chefcorrectnessresourcesetsnameproperty'
232
263
  Enabled: true
233
264
  VersionAdded: '5.5.0'
234
265
  Exclude:
@@ -238,6 +269,7 @@ ChefCorrectness/ResourceSetsNameProperty:
238
269
 
239
270
  ChefCorrectness/ResourceWithNoneAction:
240
271
  Description: Resource uses the nonexistent :none action instead of the :nothing action
272
+ StyleGuide: '#chefcorrectnessresourcewithnoneaction'
241
273
  Enabled: true
242
274
  VersionAdded: '5.5.0'
243
275
  Exclude:
@@ -247,6 +279,7 @@ ChefCorrectness/ResourceWithNoneAction:
247
279
 
248
280
  ChefCorrectness/InvalidVersionMetadata:
249
281
  Description: Cookbook metadata.rb version field should follow X.Y.Z version format.
282
+ StyleGuide: '#chefcorrectnessinvalidversionmetadata'
250
283
  Enabled: true
251
284
  VersionAdded: '5.8.0'
252
285
  Include:
@@ -254,6 +287,7 @@ ChefCorrectness/InvalidVersionMetadata:
254
287
 
255
288
  ChefCorrectness/NotifiesActionNotSymbol:
256
289
  Description: When notifying or subscribing an action within a resource the action should always be a symbol. In Chef Infra Client releases before 14.0 this may result in double notification.
290
+ StyleGuide: '#chefcorrectnessnotifiesactionnotsymbol'
257
291
  Enabled: true
258
292
  VersionAdded: '5.10.0'
259
293
  Exclude:
@@ -263,6 +297,7 @@ ChefCorrectness/NotifiesActionNotSymbol:
263
297
 
264
298
  ChefCorrectness/IncorrectLibraryInjection:
265
299
  Description: Libraries should be injected into the Chef::DSL::Recipe or Chef::DSL::Resource classes and not Recipe/Resource/Provider classes directly.
300
+ StyleGuide: '#chefcorrectnessincorrectlibraryinjection'
266
301
  Enabled: true
267
302
  VersionAdded: '5.10.0'
268
303
  Include:
@@ -270,6 +305,7 @@ ChefCorrectness/IncorrectLibraryInjection:
270
305
 
271
306
  ChefCorrectness/InvalidPlatformHelper:
272
307
  Description: Pass valid platforms to the platform? helper.
308
+ StyleGuide: '#chefcorrectnessinvalidplatformhelper'
273
309
  Enabled: true
274
310
  VersionAdded: '5.15.0'
275
311
  Exclude:
@@ -278,6 +314,7 @@ ChefCorrectness/InvalidPlatformHelper:
278
314
 
279
315
  ChefCorrectness/InvalidPlatformFamilyHelper:
280
316
  Description: Pass valid platform families to the platform_family? helper.
317
+ StyleGuide: '#chefcorrectnessinvalidplatformfamilyhelper'
281
318
  Enabled: true
282
319
  VersionAdded: '5.15.0'
283
320
  Exclude:
@@ -286,6 +323,7 @@ ChefCorrectness/InvalidPlatformFamilyHelper:
286
323
 
287
324
  ChefCorrectness/ScopedFileExist:
288
325
  Description: Scope file exist to access the correct File class by using ::File.exist? not File.exist?.
326
+ StyleGuide: '#chefcorrectnessscopedfileexist'
289
327
  Enabled: true
290
328
  VersionAdded: '5.15.0'
291
329
  Exclude:
@@ -295,6 +333,7 @@ ChefCorrectness/ScopedFileExist:
295
333
 
296
334
  ChefCorrectness/InvalidPlatformValueForPlatformFamilyHelper:
297
335
  Description: Pass valid platforms families to the value_for_platform_family helper.
336
+ StyleGuide: '#chefcorrectnessinvalidplatformvalueforplatformfamilyhelper'
298
337
  Enabled: true
299
338
  VersionAdded: '5.15.0'
300
339
  Exclude:
@@ -303,6 +342,7 @@ ChefCorrectness/InvalidPlatformValueForPlatformFamilyHelper:
303
342
 
304
343
  ChefCorrectness/InvalidPlatformValueForPlatformHelper:
305
344
  Description: Pass valid platforms to the value_for_platform helper.
345
+ StyleGuide: '#chefcorrectnessinvalidplatformvalueforplatformhelper'
306
346
  Enabled: true
307
347
  VersionAdded: '5.15.0'
308
348
  Exclude:
@@ -311,6 +351,7 @@ ChefCorrectness/InvalidPlatformValueForPlatformHelper:
311
351
 
312
352
  ChefCorrectness/InvalidNotificationTiming:
313
353
  Description: Valid notification timings are :immediately, :immediate (alias for :immediately), :delayed, and :before.
354
+ StyleGuide: '#chefcorrectnessinvalidnotificationtiming'
314
355
  Enabled: true
315
356
  VersionAdded: '5.16.0'
316
357
  Exclude:
@@ -320,6 +361,7 @@ ChefCorrectness/InvalidNotificationTiming:
320
361
 
321
362
  ChefCorrectness/MalformedPlatformValueForPlatformHelper:
322
363
  Description: When using the value_for_platform helper you must include a hash of possible platforms where each platform contains a hash of versions and potential values. If you don't wish to match on a particular version you can instead use the key 'default'.
364
+ StyleGuide: '#chefcorrectnessmalformedplatformvalueforplatformhelper'
323
365
  Enabled: true
324
366
  VersionAdded: '5.16.0'
325
367
  Exclude:
@@ -328,6 +370,7 @@ ChefCorrectness/MalformedPlatformValueForPlatformHelper:
328
370
 
329
371
  ChefCorrectness/DnfPackageAllowDowngrades:
330
372
  Description: dnf_package does not support the allow_downgrades property
373
+ StyleGuide: '#chefcorrectnessdnfpackageallowdowngrades'
331
374
  Enabled: true
332
375
  VersionAdded: '5.16.0'
333
376
  Exclude:
@@ -337,6 +380,7 @@ ChefCorrectness/DnfPackageAllowDowngrades:
337
380
 
338
381
  ChefCorrectness/ChefApplicationFatal:
339
382
  Description: Use raise to force Chef Infra Client to fail instead of using Chef::Application.fatal
383
+ StyleGuide: '#chefcorrectnesschefapplicationfatal'
340
384
  Enabled: true
341
385
  VersionAdded: '6.0.0'
342
386
  Exclude:
@@ -345,6 +389,7 @@ ChefCorrectness/ChefApplicationFatal:
345
389
 
346
390
  ChefCorrectness/PowershellScriptDeleteFile:
347
391
  Description: Use the `file` or `directory` resources built into Chef Infra Client with the :delete action to remove files/directories instead of using Remove-Item in a powershell_script resource
392
+ StyleGuide: '#chefcorrectnesspowershellscriptdeletefiles'
348
393
  Enabled: true
349
394
  VersionAdded: '6.0.0'
350
395
  Exclude:
@@ -354,6 +399,7 @@ ChefCorrectness/PowershellScriptDeleteFile:
354
399
 
355
400
  ChefCorrectness/ConditionalRubyShellout:
356
401
  Description: Don't use Ruby to shellout in an only_if / not_if conditional when you can shellout directly by wrapping the command in quotes.
402
+ StyleGuide: '#chefcorrectnessconditionalrubyshellout'
357
403
  Enabled: true
358
404
  VersionAdded: '6.1.0'
359
405
  Exclude:
@@ -361,12 +407,52 @@ ChefCorrectness/ConditionalRubyShellout:
361
407
  - '**/metadata.rb'
362
408
  - '**/Berksfile'
363
409
 
410
+ ChefCorrectness/LazyEvalNodeAttributeDefaults:
411
+ Description: When setting a node attribute as a default value for a custom resource property, make sure to wrap the node attribute in `lazy {}` so that the node attribute is available when the resource executes.
412
+ StyleGuide: '#chefcorrectnesslazyevalnodeattributedefaults'
413
+ Enabled: true
414
+ VersionAdded: '6.6.0'
415
+ Include:
416
+ - '**/libraries/*.rb'
417
+ - '**/resources/*.rb'
418
+
419
+ ChefCorrectness/OpenSSLPasswordHelpers:
420
+ Description: The secure_password helper from the openssl cookbooks Opscode::OpenSSL::Password class should not be used to generate passwords.
421
+ StyleGuide: '#chefcorrectnessopensslpasswordhelpers'
422
+ Enabled: true
423
+ VersionAdded: '6.6.0'
424
+ Exclude:
425
+ - '**/metadata.rb'
426
+ - '**/Berksfile'
427
+
428
+ ChefCorrectness/InvalidPlatformFamilyInCase:
429
+ Description: Use valid platform family values in case statements.
430
+ StyleGuide: '#chefcorrectnessinvalidplatformfamilyincase'
431
+ Enabled: true
432
+ VersionAdded: '6.6.0'
433
+ Exclude:
434
+ - '**/metadata.rb'
435
+ - '**/Berksfile'
436
+
437
+ ChefCorrectness/InvalidPlatformInCase:
438
+ Description: Use valid platform values in case statements.
439
+ StyleGuide: '#chefcorrectnessinvalidplatformincase'
440
+ Enabled: true
441
+ VersionAdded: '6.6.0'
442
+ Exclude:
443
+ - '**/metadata.rb'
444
+ - '**/Berksfile'
445
+
364
446
  ###############################
365
447
  # ChefSharing: Issues that prevent sharing code with other teams or with the Chef community in general
366
448
  ###############################
367
449
 
450
+ ChefSharing:
451
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefsharing.md
452
+
368
453
  ChefSharing/InsecureCookbookURL:
369
454
  Description: Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields
455
+ StyleGuide: '#chefsharinginsecurecookbookurl'
370
456
  Enabled: true
371
457
  VersionAdded: '5.1.0'
372
458
  VersionChanged: '5.15.0'
@@ -375,6 +461,7 @@ ChefSharing/InsecureCookbookURL:
375
461
 
376
462
  ChefSharing/InvalidLicenseString:
377
463
  Description: Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved"
464
+ StyleGuide: '#chefsharinginvalidlicensestring'
378
465
  Enabled: true
379
466
  VersionAdded: '5.2.0'
380
467
  VersionChanged: '5.15.0'
@@ -383,6 +470,7 @@ ChefSharing/InvalidLicenseString:
383
470
 
384
471
  ChefSharing/DefaultMetadataMaintainer:
385
472
  Description: Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb.
473
+ StyleGuide: '#chefsharingdefaultmetadatamaintainer'
386
474
  Enabled: true
387
475
  VersionAdded: '5.4.0'
388
476
  VersionChanged: '5.15.0'
@@ -391,6 +479,7 @@ ChefSharing/DefaultMetadataMaintainer:
391
479
 
392
480
  ChefSharing/EmptyMetadataField:
393
481
  Description: metadata.rb should not include fields with an empty string. Either don't include the field or add a value.
482
+ StyleGuide: '#chefsharingemptymetadatafield'
394
483
  Enabled: true
395
484
  VersionAdded: '5.8.0'
396
485
  VersionChanged: '5.15.0'
@@ -399,6 +488,7 @@ ChefSharing/EmptyMetadataField:
399
488
 
400
489
  ChefSharing/IncludePropertyDescriptions:
401
490
  Description: Properties should include description fields to allow automated documention. Requires Chef Infra Client 13.9 or later.
491
+ StyleGuide: '#chefsharingincludepropetydescriptions'
402
492
  Enabled: false
403
493
  VersionAdded: '6.1.0'
404
494
  Include:
@@ -407,6 +497,7 @@ ChefSharing/IncludePropertyDescriptions:
407
497
 
408
498
  ChefSharing/IncludeResourceDescriptions:
409
499
  Description: Resources should include description fields to allow automated documention. Requires Chef Infra Client 13.9 or later.
500
+ StyleGuide: '#chefsharingincluderesourcedescriptions'
410
501
  Enabled: false
411
502
  VersionAdded: '6.1.0'
412
503
  Include:
@@ -416,8 +507,12 @@ ChefSharing/IncludeResourceDescriptions:
416
507
  # ChefDeprecations: Resolving Deprecations that block upgrading Chef Infra Client
417
508
  ###############################
418
509
 
510
+ ChefDeprecations:
511
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefdeprecations.md
512
+
419
513
  ChefDeprecations/NodeDeepFetch:
420
514
  Description: Do not use the deprecated chef-sugar node.deep_fetch methods
515
+ StyleGuide: '#chefdeprecationsnodedeepfetch'
421
516
  Enabled: true
422
517
  VersionAdded: '5.12.0'
423
518
  Exclude:
@@ -426,6 +521,7 @@ ChefDeprecations/NodeDeepFetch:
426
521
 
427
522
  ChefDeprecations/NodeSet:
428
523
  Description: Do not use the deprecated node.set method
524
+ StyleGuide: '#chefdeprecationsnodeset'
429
525
  Enabled: true
430
526
  VersionAdded: '5.0.0'
431
527
  Exclude:
@@ -434,6 +530,7 @@ ChefDeprecations/NodeSet:
434
530
 
435
531
  ChefDeprecations/NodeSetUnless:
436
532
  Description: Do not use the deprecated node.set_unless method
533
+ StyleGuide: '#chefdeprecationsnodesetunless'
437
534
  Enabled: true
438
535
  VersionAdded: '5.1.0'
439
536
  Exclude:
@@ -442,6 +539,7 @@ ChefDeprecations/NodeSetUnless:
442
539
 
443
540
  ChefDeprecations/EpicFail:
444
541
  Description: Use ignore_failure method instead of the deprecated epic_fail method
542
+ StyleGuide: '#chefdeprecationsepicfail'
445
543
  Enabled: true
446
544
  VersionAdded: '5.1.0'
447
545
  Exclude:
@@ -451,27 +549,31 @@ ChefDeprecations/EpicFail:
451
549
 
452
550
  ChefDeprecations/CookbookDependsOnPoise:
453
551
  Description: Cookbooks should not depend on the deprecated Poise framework
552
+ StyleGuide: '#chefdeprecationscookbookdependsonpoise'
454
553
  Enabled: true
455
554
  VersionAdded: '5.1.0'
456
555
  Include:
457
556
  - '**/metadata.rb'
458
557
 
459
558
  ChefDeprecations/CookbookDependsOnCompatResource:
460
- Description: Don't depend on the deprecated compat_resource cookbook made obsolete by Chef 12.19+
559
+ Description: Don't depend on the deprecated compat_resource cookbook made obsolete by Chef Infra Client 12.19+
560
+ StyleGuide: '#chefdeprecationscookbookdependsoncompatresource'
461
561
  Enabled: true
462
562
  VersionAdded: '5.1.0'
463
563
  Include:
464
564
  - '**/metadata.rb'
465
565
 
466
566
  ChefDeprecations/CookbookDependsOnPartialSearch:
467
- Description: Don't depend on the deprecated partial_search cookbook made obsolete by Chef 13+
567
+ Description: Don't depend on the deprecated partial_search cookbook made obsolete by Chef Infra Client 13+
568
+ StyleGuide: '#chefdeprecationscookbookdependsonpartialsearch'
468
569
  Enabled: true
469
570
  VersionAdded: '5.1.0'
470
571
  Include:
471
572
  - '**/metadata.rb'
472
573
 
473
574
  ChefDeprecations/EasyInstallResource:
474
- Description: Don't use the deprecated easy_install resource resource removed in Chef 13
575
+ Description: Don't use the deprecated easy_install resource resource removed in Chef Infra Client 13
576
+ StyleGuide: '#chefdeprecationseasyinstallresource'
475
577
  Enabled: true
476
578
  VersionAdded: '5.1.0'
477
579
  Exclude:
@@ -480,7 +582,8 @@ ChefDeprecations/EasyInstallResource:
480
582
  - '**/Berksfile'
481
583
 
482
584
  ChefDeprecations/ErlCallResource:
483
- Description: Don't use the deprecated erl_call resource removed in Chef 13
585
+ Description: Don't use the deprecated erl_call resource removed in Chef Infra Client 13
586
+ StyleGuide: '#chefdeprecationserlcallresource'
484
587
  Enabled: true
485
588
  VersionAdded: '5.1.0'
486
589
  Exclude:
@@ -490,6 +593,7 @@ ChefDeprecations/ErlCallResource:
490
593
 
491
594
  ChefDeprecations/RequireRecipe:
492
595
  Description: Use include_recipe instead of the require_recipe method
596
+ StyleGuide: '#chefdeprecationsrequirerecipe'
493
597
  Enabled: true
494
598
  VersionAdded: '5.2.0'
495
599
  Exclude:
@@ -499,6 +603,7 @@ ChefDeprecations/RequireRecipe:
499
603
 
500
604
  ChefDeprecations/NodeMethodsInsteadofAttributes:
501
605
  Description: Use node attributes to access Ohai data instead of node methods, which were deprecated in Chef Infra Client 13.
606
+ StyleGuide: '#chefdeprecationsnodemethodsinsteadofattributes'
502
607
  Enabled: true
503
608
  VersionAdded: '5.4.0'
504
609
  Exclude:
@@ -507,6 +612,7 @@ ChefDeprecations/NodeMethodsInsteadofAttributes:
507
612
 
508
613
  ChefDeprecations/UsesDeprecatedMixins:
509
614
  Description: Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later.
615
+ StyleGuide: '#chefdeprecationsusesdeprecatedmixins'
510
616
  Enabled: true
511
617
  VersionAdded: '5.4.0'
512
618
  Include:
@@ -516,6 +622,7 @@ ChefDeprecations/UsesDeprecatedMixins:
516
622
 
517
623
  ChefDeprecations/IncludingXMLRubyRecipe:
518
624
  Description: The xml::ruby recipe installs nokogiri which is included in Chef Infra Client 12 and later.
625
+ StyleGuide: '#chefdeprecationsincludingxmlrubyrecipe'
519
626
  Enabled: true
520
627
  VersionAdded: '5.4.0'
521
628
  Exclude:
@@ -525,6 +632,7 @@ ChefDeprecations/IncludingXMLRubyRecipe:
525
632
 
526
633
  ChefDeprecations/LegacyYumCookbookRecipes:
527
634
  Description: The elrepo, epel, ius, remi, and repoforge recipes were split into their own cookbooks and the yum recipe was renamed to be default with the release of yum cookbook 3.0 (Dec 2013).
635
+ StyleGuide: '#chefdeprecationslegacyyumcookbookrecipes'
528
636
  Enabled: true
529
637
  VersionAdded: '5.4.0'
530
638
  Exclude:
@@ -532,6 +640,7 @@ ChefDeprecations/LegacyYumCookbookRecipes:
532
640
 
533
641
  ChefDeprecations/UsesChefRESTHelpers:
534
642
  Description: Don't use the helpers in Chef::REST which were removed in Chef Infra Client 13
643
+ StyleGuide: '#chefdeprecationsuseschefresthelpers'
535
644
  Enabled: true
536
645
  VersionAdded: '5.5.0'
537
646
  Exclude:
@@ -539,6 +648,7 @@ ChefDeprecations/UsesChefRESTHelpers:
539
648
 
540
649
  ChefDeprecations/ChocolateyPackageUninstallAction:
541
650
  Description: Use the :remove action in the chocolatey_package resource instead of :uninstall which was removed in Chef Infra Client 14+
651
+ StyleGuide: '#chefdeprecationschocolateypackageuninstallaction'
542
652
  Enabled: true
543
653
  VersionAdded: '5.5.0'
544
654
  Exclude:
@@ -546,6 +656,7 @@ ChefDeprecations/ChocolateyPackageUninstallAction:
546
656
 
547
657
  ChefDeprecations/LaunchdDeprecatedHashProperty:
548
658
  Description: The launchd resource's hash property was renamed to plist_hash in Chef Infra Client 13+ to avoid conflicts with Ruby's hash class.
659
+ StyleGuide: '#chefdeprecationslaunchddeprecatedhashproperty'
549
660
  Enabled: true
550
661
  VersionAdded: '5.5.0'
551
662
  Exclude:
@@ -553,6 +664,7 @@ ChefDeprecations/LaunchdDeprecatedHashProperty:
553
664
 
554
665
  ChefDeprecations/LocaleDeprecatedLcAllProperty:
555
666
  Description: The local resource's lc_all property has been deprecated and will be removed in Chef Infra Client 16
667
+ StyleGuide: '#chefdeprecationslocaledeprecatedlcallproperty'
556
668
  Enabled: true
557
669
  VersionAdded: '5.5.0'
558
670
  Exclude:
@@ -560,6 +672,7 @@ ChefDeprecations/LocaleDeprecatedLcAllProperty:
560
672
 
561
673
  ChefDeprecations/UserDeprecatedSupportsProperty:
562
674
  Description: The supports property was removed in Chef Infra Client 13 in favor of individual 'manage_home' and 'non_unique' properties.
675
+ StyleGuide: '#chefdeprecationsuserdeprecatedsupportsproperty'
563
676
  Enabled: true
564
677
  VersionAdded: '5.5.0'
565
678
  Exclude:
@@ -567,6 +680,7 @@ ChefDeprecations/UserDeprecatedSupportsProperty:
567
680
 
568
681
  ChefDeprecations/UseInlineResourcesDefined:
569
682
  Description: use_inline_resources is now the default for resources in Chef Infra Client 13+ and does not need to be specified.
683
+ StyleGuide: '#chefdeprecationsuseinlineresourcesdefined'
570
684
  Enabled: true
571
685
  VersionAdded: '5.4.0'
572
686
  Include:
@@ -576,6 +690,7 @@ ChefDeprecations/UseInlineResourcesDefined:
576
690
 
577
691
  ChefDeprecations/IncludingYumDNFCompatRecipe:
578
692
  Description: Do not include the yum::dnf_yum_compat default recipe to install yum on dnf systems. Chef Infra Client now includes built in support for DNF.
693
+ StyleGuide: '#chefdeprecationsincludingyumdnfcompatrecipe'
579
694
  Enabled: true
580
695
  VersionAdded: '5.3.0'
581
696
  Exclude:
@@ -583,6 +698,7 @@ ChefDeprecations/IncludingYumDNFCompatRecipe:
583
698
 
584
699
  ChefDeprecations/WindowsTaskChangeAction:
585
700
  Description: The :change action in the windows_task resource was removed when windows_task was added to Chef Infra Client 13+. The default action of :create should can now be used to create an update tasks.
701
+ StyleGuide: '#chefdeprecationswindowstaskchangeaction'
586
702
  Enabled: true
587
703
  VersionAdded: '5.6.0'
588
704
  Exclude:
@@ -590,6 +706,7 @@ ChefDeprecations/WindowsTaskChangeAction:
590
706
 
591
707
  ChefDeprecations/ResourceOverridesProvidesMethod:
592
708
  Description: Don't override the provides? method in a resource provider. Use provides :SOME_PROVIDER_NAME instead. This will cause failures in Chef Infra Client 13 and later.
709
+ StyleGuide: '#chefdeprecationsresourceoverridesprovidesmethod'
593
710
  Enabled: true
594
711
  VersionAdded: '5.7.0'
595
712
  Include:
@@ -599,6 +716,7 @@ ChefDeprecations/ResourceOverridesProvidesMethod:
599
716
 
600
717
  ChefDeprecations/ResourceUsesDslNameMethod:
601
718
  Description: Use resource_name instead of the dsl_name method in resources. This will cause failures in Chef Infra Client 13 and later.
719
+ StyleGuide: '#chefdeprecationsresourceusesdslnamemethod'
602
720
  Enabled: true
603
721
  VersionAdded: '5.7.0'
604
722
  Include:
@@ -608,6 +726,7 @@ ChefDeprecations/ResourceUsesDslNameMethod:
608
726
 
609
727
  ChefDeprecations/ResourceUsesUpdatedMethod:
610
728
  Description: Don't use updated = true/false to update resource state. This will cause failures in Chef Infra Client 13 and later.
729
+ StyleGuide: '#chefdeprecationsresourceusesupdatedmethod'
611
730
  Enabled: false # has a high potential for false positives
612
731
  VersionAdded: '5.7.0'
613
732
  Include:
@@ -617,6 +736,7 @@ ChefDeprecations/ResourceUsesUpdatedMethod:
617
736
 
618
737
  ChefDeprecations/NamePropertyWithDefaultValue:
619
738
  Description: A resource property can't be marked as a name_property and also have a default value. This will fail in Chef Infra Client 13 or later.
739
+ StyleGuide: '#chefdeprecationsnamepropertywithdefaultvalue'
620
740
  Enabled: true
621
741
  VersionAdded: '5.7.0'
622
742
  Include:
@@ -625,6 +745,7 @@ ChefDeprecations/NamePropertyWithDefaultValue:
625
745
 
626
746
  ChefDeprecations/ResourceUsesProviderBaseMethod:
627
747
  Description: Don't use the deprecated provider_base method in a resource to specify the provider module to use. Instead, the provider should call provides to register itself, or the resource should call provider to specify the provider to use. This will cause failures in Chef Infra Client 13 and later.
748
+ StyleGuide: '#chefdeprecationsresourceusesproviderbasemethod'
628
749
  Enabled: true
629
750
  VersionAdded: '5.7.0'
630
751
  Include:
@@ -633,6 +754,7 @@ ChefDeprecations/ResourceUsesProviderBaseMethod:
633
754
 
634
755
  ChefDeprecations/ChefSpecCoverageReport:
635
756
  Description: Don't use the deprecated ChefSpec coverage report functionality in your specs.
757
+ StyleGuide: '#chefdeprecationschefspeccoveragereport'
636
758
  Enabled: true
637
759
  VersionAdded: '5.8.0'
638
760
  Include:
@@ -640,6 +762,7 @@ ChefDeprecations/ChefSpecCoverageReport:
640
762
 
641
763
  ChefDeprecations/ChefSpecLegacyRunner:
642
764
  Description: Use ChefSpec::SoloRunner or ChefSpec::ServerRunner instead of the deprecated ChefSpec::Runner.
765
+ StyleGuide: '#chefdeprecationschefspeclegacyrunner'
643
766
  Enabled: true
644
767
  VersionAdded: '5.8.0'
645
768
  Include:
@@ -647,6 +770,7 @@ ChefDeprecations/ChefSpecLegacyRunner:
647
770
 
648
771
  ChefDeprecations/UsesRunCommandHelper:
649
772
  Description: Use 'shell_out!' instead of the legacy 'run_command' helper for shelling out. The run_command helper was removed in Chef Infra Client 13.
773
+ StyleGuide: '#chefdeprecationsusesruncommandhelper'
650
774
  Enabled: true
651
775
  VersionAdded: '5.9.0'
652
776
  Exclude:
@@ -655,6 +779,7 @@ ChefDeprecations/UsesRunCommandHelper:
655
779
 
656
780
  ChefDeprecations/ChefHandlerUsesSupports:
657
781
  Description: Use the type property instead of the deprecated supports property in the chef_handler resource. The supports property was removed in chef_handler cookbook version 3.0 (June 2017) and Chef Infra Client 14.0.
782
+ StyleGuide: '#chefdeprecationschefhandlerusessupports'
658
783
  Enabled: true
659
784
  VersionAdded: '5.9.0'
660
785
  Exclude:
@@ -662,6 +787,7 @@ ChefDeprecations/ChefHandlerUsesSupports:
662
787
 
663
788
  ChefDeprecations/DeprecatedYumRepositoryProperties:
664
789
  Description: With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 several properties in the yum_repository resource were renamed. url -> baseurl, keyurl -> gpgkey, and mirrorexpire -> mirror_expire.
790
+ StyleGuide: '#chefdeprecationsdeprecatedyumrepositoryproperties'
665
791
  Enabled: true
666
792
  VersionAdded: '5.10.0'
667
793
  Exclude:
@@ -669,6 +795,7 @@ ChefDeprecations/DeprecatedYumRepositoryProperties:
669
795
 
670
796
  ChefDeprecations/EOLAuditModeUsage:
671
797
  Description: The beta Audit Mode feature in Chef Infra Client was removed in Chef Infra Client 15.0. Users should instead use InSpec and the audit cookbook. See https://www.inspec.io/ for more informmation.
798
+ StyleGuide: '#chefdeprecationseolauditmodeusage'
672
799
  Enabled: true
673
800
  VersionAdded: '5.10.0'
674
801
  Exclude:
@@ -676,6 +803,7 @@ ChefDeprecations/EOLAuditModeUsage:
676
803
 
677
804
  ChefDeprecations/ResourceInheritsFromCompatResource:
678
805
  Description: HWRP style resource should inherit from the 'Chef::Resource' class and not the 'ChefCompat::Resource' class from the deprecated compat_resource cookbook.
806
+ StyleGuide: '#chefdeprecationsresourceinheritsfromcompatresource'
679
807
  Enabled: true
680
808
  VersionAdded: '5.10.0'
681
809
  Include:
@@ -683,6 +811,7 @@ ChefDeprecations/ResourceInheritsFromCompatResource:
683
811
 
684
812
  ChefDeprecations/VerifyPropertyUsesFileExpansion:
685
813
  Description: Use the 'path' variable in the verify property and not the 'file' variable which was removed in Chef Infra Client 13.
814
+ StyleGuide: '#chefdeprecationsverifypropertyusesfileexpansion'
686
815
  Enabled: true
687
816
  VersionAdded: '5.10.0'
688
817
  Exclude:
@@ -690,11 +819,13 @@ ChefDeprecations/VerifyPropertyUsesFileExpansion:
690
819
 
691
820
  ChefDeprecations/PoiseArchiveUsage:
692
821
  Description: The poise_archive resource in the deprecated poise-archive should be replaced with the archive_file resource found in Chef Infra Client 15+.
822
+ StyleGuide: '#chefdeprecationspoisearchiveusage'
693
823
  Enabled: true
694
824
  VersionAdded: '5.11.0'
695
825
 
696
826
  ChefDeprecations/PartialSearchHelperUsage:
697
827
  Description: Legacy partial_search usage should be updated to use :filter_result in the search helper instead.
828
+ StyleGuide: '#chefdeprecationspartialsearchhelperusage'
698
829
  Enabled: true
699
830
  VersionAdded: '5.11.0'
700
831
  Exclude:
@@ -702,6 +833,7 @@ ChefDeprecations/PartialSearchHelperUsage:
702
833
 
703
834
  ChefDeprecations/SearchUsesPositionalParameters:
704
835
  Description: Don't use deprecated positional parameters in cookbook search queries.
836
+ StyleGuide: '#chefdeprecationssearchusespositionalparameters'
705
837
  Enabled: true
706
838
  VersionAdded: '5.11.0'
707
839
  Exclude:
@@ -709,6 +841,7 @@ ChefDeprecations/SearchUsesPositionalParameters:
709
841
 
710
842
  ChefDeprecations/PartialSearchClassUsage:
711
843
  Description: Legacy Chef::PartialSearch class usage should be updated to use the search helper instead with the filter_result key.
844
+ StyleGuide: '#chefdeprecationspartialsearchclassusage'
712
845
  Enabled: true
713
846
  VersionAdded: '5.11.0'
714
847
  Exclude:
@@ -716,6 +849,7 @@ ChefDeprecations/PartialSearchClassUsage:
716
849
 
717
850
  ChefDeprecations/Cheffile:
718
851
  Description: The Libarian-Chef depsolving project is no longer maintained and should not be used for cookbook depsolving. Consider using Policyfiles instead.
852
+ StyleGuide: '#chefdeprecationscheffile'
719
853
  Enabled: true
720
854
  VersionAdded: '5.12.0'
721
855
  Include:
@@ -723,6 +857,7 @@ ChefDeprecations/Cheffile:
723
857
 
724
858
  ChefDeprecations/LegacyNotifySyntax:
725
859
  Description: Use the new-style notification syntax which allows you to notify resources defined later in a recipe or resource.
860
+ StyleGuide: '#chefdeprecationslegacynotifysyntax'
726
861
  Enabled: true
727
862
  VersionAdded: '5.13.0'
728
863
  Exclude:
@@ -730,6 +865,7 @@ ChefDeprecations/LegacyNotifySyntax:
730
865
 
731
866
  ChefDeprecations/NodeSetWithoutLevel:
732
867
  Description: When setting a node attribute in Chef Infra Client 11 and later you must specify the precedence level.
868
+ StyleGuide: '#chefdeprecationsnodesetwithoutlevel'
733
869
  Enabled: true
734
870
  VersionAdded: '5.13.0'
735
871
  Exclude:
@@ -738,6 +874,7 @@ ChefDeprecations/NodeSetWithoutLevel:
738
874
 
739
875
  ChefDeprecations/ChefRewind:
740
876
  Description: Use delete_resource / edit_resource instead of functionality in the deprecated chef-rewind gem
877
+ StyleGuide: '#chefdeprecationschefrewind'
741
878
  Enabled: true
742
879
  VersionAdded: '5.14.0'
743
880
  Exclude:
@@ -746,6 +883,7 @@ ChefDeprecations/ChefRewind:
746
883
 
747
884
  ChefDeprecations/RubyBlockCreateAction:
748
885
  Description: Use the :run action in the ruby_block resource instead of the deprecated :create action
886
+ StyleGuide: '#chefdeprecationsrubyblockcreateaction'
749
887
  Enabled: true
750
888
  VersionAdded: '5.16.0'
751
889
  Exclude:
@@ -755,6 +893,7 @@ ChefDeprecations/RubyBlockCreateAction:
755
893
 
756
894
  ChefDeprecations/DeprecatedPlatformMethods:
757
895
  Description: Use provider_for_action instead of the deprecated Chef::Platform methods in resources.
896
+ StyleGuide: '#chefdeprecationsdeprecatedplatformmethods'
758
897
  Enabled: true
759
898
  VersionAdded: '5.16.0'
760
899
  Include:
@@ -764,6 +903,7 @@ ChefDeprecations/DeprecatedPlatformMethods:
764
903
 
765
904
  ChefDeprecations/DeprecatedChefSpecPlatform:
766
905
  Description: Use currently supported platforms in ChefSpec listed at https://github.com/chefspec/fauxhai/blob/master/PLATFORMS.md. Fauxhai / ChefSpec will perform fuzzy matching on platform version so it's always best to be less specific ie. 10 instead of 10.3
906
+ StyleGuide: '#chefdeprecationsdeprecatedchefspecplatform'
767
907
  Enabled: true
768
908
  VersionAdded: '5.20.0'
769
909
  Include:
@@ -771,6 +911,7 @@ ChefDeprecations/DeprecatedChefSpecPlatform:
771
911
 
772
912
  ChefDeprecations/WindowsFeatureServermanagercmd:
773
913
  Description: The `windows_feature` resource no longer supports setting the `install_method` to `:servermanagercmd`. `:windows_feature_dism` or `:windows_feature_powershell` should be used instead.
914
+ StyleGuide: '#chefdeprecationswindowsfeatureservermanagercmd'
774
915
  Enabled: true
775
916
  VersionAdded: '5.22.0'
776
917
  Exclude:
@@ -780,6 +921,7 @@ ChefDeprecations/WindowsFeatureServermanagercmd:
780
921
 
781
922
  ChefDeprecations/DeprecatedWindowsVersionCheck:
782
923
  Description: Don't use the deprecated older_than_win_2012_or_8? helper. Windows versions before 2012 and 8 are now end of life and this helper will always return false.
924
+ StyleGuide: '#chefdeprecationsdeprecatedwindowsversioncheck'
783
925
  Enabled: true
784
926
  VersionAdded: '6.0.0'
785
927
  Exclude:
@@ -788,6 +930,7 @@ ChefDeprecations/DeprecatedWindowsVersionCheck:
788
930
 
789
931
  ChefDeprecations/ChefWindowsPlatformHelper:
790
932
  Description: Use `platform?('windows')` instead of the legacy `Chef::Platform.windows?` helper.
933
+ StyleGuide: '#chefdeprecationschefwindowsplatformhelper'
791
934
  Enabled: true
792
935
  VersionAdded: '6.0.0'
793
936
  Exclude:
@@ -796,6 +939,7 @@ ChefDeprecations/ChefWindowsPlatformHelper:
796
939
 
797
940
  ChefDeprecations/LogResourceNotifications:
798
941
  Description: In Chef Infra Client 16 the log resource no longer notifies when logging so notifications should not be triggered from log resources. Use the notify_group resource instead to aggregate notifications.
942
+ StyleGuide: '#chefdeprecationslogresourcenotifications'
799
943
  Enabled: true
800
944
  VersionAdded: '6.0.0'
801
945
  Exclude:
@@ -804,6 +948,7 @@ ChefDeprecations/LogResourceNotifications:
804
948
 
805
949
  ChefDeprecations/ResourceWithoutNameOrProvides:
806
950
  Description: In Chef Infra Client 16 and later legacy HWRP resources must use either `resource_name` or `provides` to define the resource name.
951
+ StyleGuide: '#chefdeprecationsresourcewithoutnameorprovides'
807
952
  Enabled: true
808
953
  VersionAdded: '6.0.0'
809
954
  Include:
@@ -811,6 +956,7 @@ ChefDeprecations/ResourceWithoutNameOrProvides:
811
956
 
812
957
  ChefDeprecations/WindowsVersionHelpers:
813
958
  Description: Use node['platform_version'] data instead of the Windows::VersionHelper helper from the Windows cookbook.
959
+ StyleGuide: '#chefdeprecationswindowsversionhelpers'
814
960
  Enabled: true
815
961
  VersionAdded: '5.4.0'
816
962
  Exclude:
@@ -819,6 +965,7 @@ ChefDeprecations/WindowsVersionHelpers:
819
965
 
820
966
  ChefDeprecations/PowershellCookbookHelpers:
821
967
  Description: Use node['powershell']['version'] or the new powershell_version helper available in Chef Infra Client 16+ instead of the deprecated PowerShell cookbook helpers.
968
+ StyleGuide: '#chefdeprecationspowershellcookbookhelpers'
822
969
  Enabled: true
823
970
  VersionAdded: '6.1.0'
824
971
  Exclude:
@@ -827,6 +974,7 @@ ChefDeprecations/PowershellCookbookHelpers:
827
974
 
828
975
  ChefDeprecations/DeprecatedShelloutMethods:
829
976
  Description: Many legacy specialized shell_out methods were replaced in Chef Infra Client 14.3 and removed in Chef Infra Client 15. Use shell_out and any additional options if necessary.
977
+ StyleGuide: '#chefdeprecationsdeprecatedshelloutmethods'
830
978
  Enabled: true
831
979
  VersionAdded: '6.3.0'
832
980
  Exclude:
@@ -836,6 +984,7 @@ ChefDeprecations/DeprecatedShelloutMethods:
836
984
 
837
985
  ChefDeprecations/Ruby27KeywordArgumentWarnings:
838
986
  Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
987
+ StyleGuide: '#chefdeprecationsruby27keywordargumentwarnings'
839
988
  Enabled: true
840
989
  VersionAdded: '6.5.0'
841
990
  Exclude:
@@ -846,8 +995,12 @@ ChefDeprecations/Ruby27KeywordArgumentWarnings:
846
995
  # ChefModernize: Cleaning up legacy code and using new built-in resources
847
996
  ###############################
848
997
 
998
+ ChefModernize:
999
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefmodernize.md
1000
+
849
1001
  ChefModernize/LegacyBerksfileSource:
850
1002
  Description: Do not use legacy Berksfile community sources. Use Chef Supermarket instead.
1003
+ StyleGuide: '#chefmodernizelegacyberksfilesource'
851
1004
  Enabled: true
852
1005
  VersionAdded: '5.1.0'
853
1006
  Include:
@@ -855,6 +1008,7 @@ ChefModernize/LegacyBerksfileSource:
855
1008
 
856
1009
  ChefModernize/WhyRunSupportedTrue:
857
1010
  Description: whyrun_supported? no longer needs to be set to true as it is the default in Chef 13+
1011
+ StyleGuide: '#chefmodernizewhyrunsupportedtrue'
858
1012
  Enabled: true
859
1013
  VersionAdded: '5.1.0'
860
1014
  Include:
@@ -864,13 +1018,15 @@ ChefModernize/WhyRunSupportedTrue:
864
1018
 
865
1019
  ChefModernize/UnnecessaryDependsChef14:
866
1020
  Description: Don't depend on cookbooks made obsolete by Chef Infra Client 14+. These community cookbooks contain resources that are now included in Chef Infra Client itself.
1021
+ StyleGuide: '#chefmodernizeunnecessarydependschef14'
867
1022
  Enabled: true
868
1023
  VersionAdded: '5.1.0'
869
1024
  Include:
870
1025
  - '**/metadata.rb'
871
1026
 
872
1027
  ChefModernize/RespondToInMetadata:
873
- Description: It is no longer necessary to use respond_to? in metadata.rb in Chef 12.15 and later
1028
+ Description: It is no longer necessary to use respond_to? in metadata.rb in Chef Infra Client 12.15 and later
1029
+ StyleGuide: '#chefmodernizerespondtoinmetadata'
874
1030
  Enabled: true
875
1031
  VersionAdded: '5.2.0'
876
1032
  Include:
@@ -878,6 +1034,7 @@ ChefModernize/RespondToInMetadata:
878
1034
 
879
1035
  ChefModernize/RespondToResourceName:
880
1036
  Description: respond_to?(:resource_name) in resources is no longer necessary in Chef Infra Client 12.5+
1037
+ StyleGuide: '#chefmodernizerespondtoresourcename'
881
1038
  Enabled: true
882
1039
  VersionAdded: '5.2.0'
883
1040
  Include:
@@ -886,6 +1043,7 @@ ChefModernize/RespondToResourceName:
886
1043
 
887
1044
  ChefModernize/RespondToProvides:
888
1045
  Description: respond_to?(:provides) in resources is no longer necessary in Chef Infra Client 12+
1046
+ StyleGuide: '#chefmodernizerespondtoprovides'
889
1047
  Enabled: true
890
1048
  VersionAdded: '5.2.0'
891
1049
  Include:
@@ -894,6 +1052,7 @@ ChefModernize/RespondToProvides:
894
1052
 
895
1053
  ChefModernize/SetOrReturnInResources:
896
1054
  Description: Do not use set_or_return within a method to define a property for a resource. Use the property method instead, which supports validation, reporting, and documentation functionality.
1055
+ StyleGuide: '#chefmodernizesetorreturninresources'
897
1056
  Enabled: true
898
1057
  VersionAdded: '5.2.0'
899
1058
  Include:
@@ -902,6 +1061,7 @@ ChefModernize/SetOrReturnInResources:
902
1061
 
903
1062
  ChefModernize/CustomResourceWithAttributes:
904
1063
  Description: Custom Resources should contain properties not attributes.
1064
+ StyleGuide: '#chefmodernizecustomresourcewithattributes'
905
1065
  Enabled: true
906
1066
  VersionAdded: '5.2.0'
907
1067
  Include:
@@ -909,6 +1069,7 @@ ChefModernize/CustomResourceWithAttributes:
909
1069
 
910
1070
  ChefModernize/IncludingAptDefaultRecipe:
911
1071
  Description: Do not include the Apt default recipe to update package cache. Instead use the apt_update resource, which is built into Chef Infra Client 12.7 and later.
1072
+ StyleGuide: '#chefmodernizeincludingaptdefaultrecipe'
912
1073
  Enabled: true
913
1074
  VersionAdded: '5.3.0'
914
1075
  Exclude:
@@ -916,6 +1077,7 @@ ChefModernize/IncludingAptDefaultRecipe:
916
1077
 
917
1078
  ChefModernize/IncludingWindowsDefaultRecipe:
918
1079
  Description: Do not include the Windows default recipe, which only installs win32 gems already included in Chef Infra Client
1080
+ StyleGuide: '#chefmodernizeincludingwindowsdefaultrecipe'
919
1081
  Enabled: true
920
1082
  VersionAdded: '5.3.0'
921
1083
  Exclude:
@@ -923,6 +1085,7 @@ ChefModernize/IncludingWindowsDefaultRecipe:
923
1085
 
924
1086
  ChefModernize/DefinesChefSpecMatchers:
925
1087
  Description: ChefSpec matchers are now auto generated by ChefSpec 7.1+ and do not need to be defined in a cookbook
1088
+ StyleGuide: '#chefmodernizedefineschefspecmatchers'
926
1089
  Enabled: true
927
1090
  VersionAdded: '5.3.0'
928
1091
  Include:
@@ -930,6 +1093,7 @@ ChefModernize/DefinesChefSpecMatchers:
930
1093
 
931
1094
  ChefModernize/ExecuteAptUpdate:
932
1095
  Description: Use the apt_update resource instead of the execute resource to run an apt-get update package cache update
1096
+ StyleGuide: '#chefmodernizeexecuteaptupdate'
933
1097
  Enabled: true
934
1098
  VersionAdded: '5.3.0'
935
1099
  Exclude:
@@ -937,6 +1101,7 @@ ChefModernize/ExecuteAptUpdate:
937
1101
 
938
1102
  ChefModernize/MinitestHandlerUsage:
939
1103
  Description: Use Chef InSpec for testing instead of the Minitest Handler cookbook pattern.
1104
+ StyleGuide: '#chefmodernizeminitesthandlerusage'
940
1105
  Enabled: true
941
1106
  VersionAdded: '5.4.0'
942
1107
  Include:
@@ -944,6 +1109,7 @@ ChefModernize/MinitestHandlerUsage:
944
1109
 
945
1110
  ChefModernize/IncludingMixinShelloutInResources:
946
1111
  Description: There is no need to include Chef::Mixin::ShellOut or Chef::Mixin::PowershellOut in resources or providers as this is already done by Chef Infra Client 12.4+.
1112
+ StyleGuide: '#chefmodernizeincludingmixinshelloutinresources'
947
1113
  Enabled: true
948
1114
  VersionAdded: '5.4.0'
949
1115
  Include:
@@ -952,6 +1118,7 @@ ChefModernize/IncludingMixinShelloutInResources:
952
1118
 
953
1119
  ChefModernize/UseBuildEssentialResource:
954
1120
  Description: Use the build_essential resource instead of the legacy build-essential recipe. This resource ships in the build-essential cookbook v5.0+ and is built into Chef Infra Client 14+
1121
+ StyleGuide: '#chefmodernizeusebuildessentialresource'
955
1122
  Enabled: true
956
1123
  VersionAdded: '5.1.0'
957
1124
  Exclude:
@@ -959,6 +1126,7 @@ ChefModernize/UseBuildEssentialResource:
959
1126
 
960
1127
  ChefModernize/WindowsZipfileUsage:
961
1128
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook
1129
+ StyleGuide: '#chefmodernizewindowszipfileusage'
962
1130
  Enabled: true
963
1131
  VersionAdded: '5.4.0'
964
1132
  Exclude:
@@ -966,6 +1134,7 @@ ChefModernize/WindowsZipfileUsage:
966
1134
 
967
1135
  ChefModernize/SevenZipArchiveResource:
968
1136
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the seven_zip_archive
1137
+ StyleGuide: '#chefmodernizesevenziparchiveresource'
969
1138
  Enabled: true
970
1139
  VersionAdded: '5.5.0'
971
1140
  Exclude:
@@ -973,6 +1142,7 @@ ChefModernize/SevenZipArchiveResource:
973
1142
 
974
1143
  ChefModernize/LibarchiveFileResource:
975
1144
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the libarchive file resource
1145
+ StyleGuide: '#chefmodernizelibarchivefileresource'
976
1146
  Enabled: true
977
1147
  VersionAdded: '5.5.0'
978
1148
  Exclude:
@@ -980,6 +1150,7 @@ ChefModernize/LibarchiveFileResource:
980
1150
 
981
1151
  ChefModernize/PowershellScriptExpandArchive:
982
1152
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of using Expand-Archive in a powershell_script resource
1153
+ StyleGuide: '#chefmodernizepowershellscriptexpandarchive'
983
1154
  Enabled: true
984
1155
  VersionAdded: '5.5.0'
985
1156
  Exclude:
@@ -987,6 +1158,7 @@ ChefModernize/PowershellScriptExpandArchive:
987
1158
 
988
1159
  ChefModernize/PowershellInstallPackage:
989
1160
  Description: Use the package resource built into Chef Infra Client instead of using Install-Package in a powershell_script resource
1161
+ StyleGuide: '#chefmodernizepowershellinstallpackage'
990
1162
  Enabled: true
991
1163
  VersionAdded: '5.5.0'
992
1164
  Exclude:
@@ -994,6 +1166,7 @@ ChefModernize/PowershellInstallPackage:
994
1166
 
995
1167
  ChefModernize/PowershellInstallWindowsFeature:
996
1168
  Description: Use the windows_feature resource built into Chef Infra Client 13+ instead of using Install-WindowsFeature or Add-WindowsFeature in a powershell_script resource
1169
+ StyleGuide: '#chefmodernizepowershellinstallwindowsfeature'
997
1170
  Enabled: true
998
1171
  VersionAdded: '5.5.0'
999
1172
  Exclude:
@@ -1001,6 +1174,7 @@ ChefModernize/PowershellInstallWindowsFeature:
1001
1174
 
1002
1175
  ChefModernize/ShellOutToChocolatey:
1003
1176
  Description: Use the Chocolatey resources built into Chef Infra Client instead of shelling out to the choco command
1177
+ StyleGuide: '#chefmodernizeshellouttochocolatey'
1004
1178
  Enabled: true
1005
1179
  VersionAdded: '5.5.0'
1006
1180
  Exclude:
@@ -1008,6 +1182,7 @@ ChefModernize/ShellOutToChocolatey:
1008
1182
 
1009
1183
  ChefModernize/CronManageResource:
1010
1184
  Description: The cron_manage resource was renamed to cron_access in the 6.1 release of the cron cookbook and later shipped in Chef Infra Client 14.4. The new resource name should be used.
1185
+ StyleGuide: '#chefmodernizecronmanageresource'
1011
1186
  Enabled: true
1012
1187
  VersionAdded: '5.6.0'
1013
1188
  Exclude:
@@ -1015,6 +1190,7 @@ ChefModernize/CronManageResource:
1015
1190
 
1016
1191
  ChefModernize/UsesZypperRepo:
1017
1192
  Description: The zypper_repo resource was renamed zypper_repository when it was added to Chef Infra Client 13.3.
1193
+ StyleGuide: '#chefmodernizeuseszypperrepo'
1018
1194
  Enabled: true
1019
1195
  VersionAdded: '5.6.0'
1020
1196
  Exclude:
@@ -1022,6 +1198,7 @@ ChefModernize/UsesZypperRepo:
1022
1198
 
1023
1199
  ChefModernize/DependsOnZypperCookbook:
1024
1200
  Description: Don't include the zypper cookbook as the zypper_repository resource is built into Chef Infra Client 13.3+
1201
+ StyleGuide: '#chefmodernizedependsonzyppercookbook'
1025
1202
  Enabled: true
1026
1203
  VersionAdded: '5.6.0'
1027
1204
  Exclude:
@@ -1029,6 +1206,7 @@ ChefModernize/DependsOnZypperCookbook:
1029
1206
 
1030
1207
  ChefModernize/ExecuteTzUtil:
1031
1208
  Description: Use the timezone resource included in Chef Infra Client 14.6+ instead of shelling out to tzutil
1209
+ StyleGuide: '#chefmodernizeexecutetzutil'
1032
1210
  Enabled: true
1033
1211
  VersionAdded: '5.6.0'
1034
1212
  Exclude:
@@ -1036,6 +1214,7 @@ ChefModernize/ExecuteTzUtil:
1036
1214
 
1037
1215
  ChefModernize/OpensslRsaKeyResource:
1038
1216
  Description: The openssl_rsa_key resource was renamed to openssl_rsa_private_key in Chef Infra Client 14.0. The new resource name should be used.
1217
+ StyleGuide: '#chefmodernizeopensslrsakeyresource'
1039
1218
  Enabled: true
1040
1219
  VersionAdded: '5.6.0'
1041
1220
  Exclude:
@@ -1043,6 +1222,7 @@ ChefModernize/OpensslRsaKeyResource:
1043
1222
 
1044
1223
  ChefModernize/OpensslX509Resource:
1045
1224
  Description: The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4. The new resource name should be used.
1225
+ StyleGuide: '#chefmodernizeopensslx509resource'
1046
1226
  Enabled: true
1047
1227
  VersionAdded: '5.6.0'
1048
1228
  Exclude:
@@ -1050,6 +1230,7 @@ ChefModernize/OpensslX509Resource:
1050
1230
 
1051
1231
  ChefModernize/OsxConfigProfileResource:
1052
1232
  Description: The osx_config_profile resource was renamed to osx_profile. The new resource name should be used.
1233
+ StyleGuide: '#chefmodernizeosxconfigprofileresource'
1053
1234
  Enabled: true
1054
1235
  VersionAdded: '5.6.0'
1055
1236
  Exclude:
@@ -1057,6 +1238,7 @@ ChefModernize/OsxConfigProfileResource:
1057
1238
 
1058
1239
  ChefModernize/SysctlParamResource:
1059
1240
  Description: The sysctl_param resource was renamed to sysctl when it was added to Chef Infra Client 14.0. The new resource name should be used.
1241
+ StyleGuide: '#chefmodernizesysctlparamresource'
1060
1242
  Enabled: true
1061
1243
  VersionAdded: '5.6.0'
1062
1244
  Exclude:
@@ -1064,6 +1246,7 @@ ChefModernize/SysctlParamResource:
1064
1246
 
1065
1247
  ChefModernize/MacOsXUserdefaults:
1066
1248
  Description: The mac_os_x_userdefaults resource was renamed to macos_userdefaults when it was added to Chef Infra Client 14.0. The new resource name should be used.
1249
+ StyleGuide: '#chefmodernizemacosxuserdefaults'
1067
1250
  Enabled: true
1068
1251
  VersionAdded: '5.6.0'
1069
1252
  Exclude:
@@ -1071,6 +1254,7 @@ ChefModernize/MacOsXUserdefaults:
1071
1254
 
1072
1255
  ChefModernize/PowerShellGuardInterpreter:
1073
1256
  Description: PowerShell is already set as the default guard interpreter for powershell_script resources in Chef Infra Client 13 and later and does not need to be specified.
1257
+ StyleGuide: '#chefmodernizepowershellguardinterpreter'
1074
1258
  Enabled: true
1075
1259
  VersionAdded: '5.9.0'
1076
1260
  Exclude:
@@ -1078,6 +1262,7 @@ ChefModernize/PowerShellGuardInterpreter:
1078
1262
 
1079
1263
  ChefModernize/DefaultActionFromInitialize:
1080
1264
  Description: The default actions can now be specified using the `default_action` helper instead of using the @action variable in the resource provider initialize method.
1265
+ StyleGuide: '#chefmodernizedefaultactionfrominitialize'
1081
1266
  Enabled: true
1082
1267
  VersionAdded: '5.10.0'
1083
1268
  Include:
@@ -1087,6 +1272,7 @@ ChefModernize/DefaultActionFromInitialize:
1087
1272
 
1088
1273
  ChefModernize/ResourceNameFromInitialize:
1089
1274
  Description: The name of a resource can be set with the "resource_name" helper instead of using the initialize method.
1275
+ StyleGuide: '#chefmodernizeresourcenamefrominitialize'
1090
1276
  Enabled: true
1091
1277
  VersionAdded: '5.10.0'
1092
1278
  Include:
@@ -1096,13 +1282,15 @@ ChefModernize/ResourceNameFromInitialize:
1096
1282
 
1097
1283
  ChefModernize/Definitions:
1098
1284
  Description: Legacy Chef Infra definitions should be rewritten as custom resources to take full advantage of the Chef Infra feature set.
1285
+ StyleGuide: '#chefmodernizedefinitions'
1099
1286
  Enabled: true
1100
1287
  VersionAdded: '5.11.0'
1101
1288
  Include:
1102
1289
  - '**/definitions/*.rb'
1103
1290
 
1104
1291
  ChefModernize/IfProvidesDefaultAction:
1105
- Description: if defined?(default_action) is no longer necessary in Chef Resources as default_action shipped in Chef 10.8.
1292
+ Description: if defined?(default_action) is no longer necessary in Chef Infra resources as default_action shipped in Chef Infra Client 10.8.
1293
+ StyleGuide: '#chefmodernizeifprovidesdefaultaction'
1106
1294
  Enabled: true
1107
1295
  VersionAdded: '5.12.0'
1108
1296
  Include:
@@ -1111,11 +1299,13 @@ ChefModernize/IfProvidesDefaultAction:
1111
1299
 
1112
1300
  ChefModernize/ZipfileResource:
1113
1301
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the zipfile resource from the zipfile cookbook.
1302
+ StyleGuide: '#chefmodernizezipfileresource'
1114
1303
  Enabled: true
1115
1304
  VersionAdded: '5.12.0'
1116
1305
 
1117
1306
  ChefModernize/UnnecessaryMixlibShelloutRequire:
1118
1307
  Description: Chef Infra Client 12.4 and later include mixlib/shellout automatically in resources and providers.
1308
+ StyleGuide: '#chefmodernizeunnecessarymixlibshelloutrequire'
1119
1309
  Enabled: true
1120
1310
  VersionAdded: '5.12.0'
1121
1311
  Include:
@@ -1124,6 +1314,7 @@ ChefModernize/UnnecessaryMixlibShelloutRequire:
1124
1314
 
1125
1315
  ChefModernize/EmptyResourceInitializeMethod:
1126
1316
  Description: There is no need for an empty initialize method in a resource
1317
+ StyleGuide: '#chefmodernizeemptyresourceinitializemethod'
1127
1318
  Enabled: true
1128
1319
  VersionAdded: '5.13.0'
1129
1320
  Include:
@@ -1132,6 +1323,7 @@ ChefModernize/EmptyResourceInitializeMethod:
1132
1323
 
1133
1324
  ChefModernize/ChefGemNokogiri:
1134
1325
  Description: The nokogiri gem ships in Chef Infra Client 12+ and does not need to be installed before being used.
1326
+ StyleGuide: '#chefmodernizechefgemnokogiri'
1135
1327
  Enabled: true
1136
1328
  VersionAdded: '5.14.0'
1137
1329
  Exclude:
@@ -1140,6 +1332,7 @@ ChefModernize/ChefGemNokogiri:
1140
1332
 
1141
1333
  ChefModernize/PropertyWithNameAttribute:
1142
1334
  Description: Resource property sets name_attribute not name_property
1335
+ StyleGuide: '#chefmodernizepropertywithnameattribute'
1143
1336
  Enabled: true
1144
1337
  VersionAdded: '5.1.0'
1145
1338
  VersionChanged: '5.15.0'
@@ -1149,6 +1342,7 @@ ChefModernize/PropertyWithNameAttribute:
1149
1342
 
1150
1343
  ChefModernize/IncludingOhaiDefaultRecipe:
1151
1344
  Description: Use the ohai_plugin resource to ship custom Ohai plugins instead of using the ohai::default recipe. If you're not shipping custom Ohai plugins, then you can remove this recipe entirely.
1345
+ StyleGuide: '#chefmodernizeincludingohaidefaultrecipe'
1152
1346
  Enabled: true
1153
1347
  VersionAdded: '5.4.0'
1154
1348
  VersionChanged: '5.15.0'
@@ -1158,6 +1352,7 @@ ChefModernize/IncludingOhaiDefaultRecipe:
1158
1352
 
1159
1353
  ChefModernize/AllowedActionsFromInitialize:
1160
1354
  Description: The allowed actions of a resource can be set with the "allowed_actions" helper instead of using the initialize method.
1355
+ StyleGuide: '#chefmodernizeallowedactionsfrominitialize'
1161
1356
  Enabled: true
1162
1357
  VersionAdded: '5.15.0'
1163
1358
  Include:
@@ -1166,6 +1361,7 @@ ChefModernize/AllowedActionsFromInitialize:
1166
1361
 
1167
1362
  ChefModernize/FoodcriticComments:
1168
1363
  Description: Remove legacy code comments that disable Foodcritic rules. These comments are no longer necessary if you've migrated from Foodcritic to Cookstyle for cookbook linting.
1364
+ StyleGuide: '#chefmodernizefoodcriticcomments'
1169
1365
  Enabled: true
1170
1366
  VersionAdded: '5.16.0'
1171
1367
  Exclude:
@@ -1173,6 +1369,7 @@ ChefModernize/FoodcriticComments:
1173
1369
 
1174
1370
  ChefModernize/ExecuteScExe:
1175
1371
  Description: Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions with the full idempotency of the windows_service resource. See the windows_service documentation at https://docs.chef.io/resource_windows_service.html for additional details on creating services with the windows_service resource
1372
+ StyleGuide: '#chefmodernizeexecutescexe'
1176
1373
  Enabled: true
1177
1374
  VersionAdded: '5.16.0'
1178
1375
  Exclude:
@@ -1182,6 +1379,7 @@ ChefModernize/ExecuteScExe:
1182
1379
 
1183
1380
  ChefModernize/WindowsScResource:
1184
1381
  Description: Chef Infra Client 14.0 and later includes :create, :delete, and :configure actions without the need for the sc cookbook dependency. See the windows_service documentation at https://docs.chef.io/resource_windows_service.html for additional details.
1382
+ StyleGuide: '#chefmodernizewindowsscresource'
1185
1383
  Enabled: true
1186
1384
  VersionAdded: '5.16.0'
1187
1385
  Exclude:
@@ -1191,6 +1389,7 @@ ChefModernize/WindowsScResource:
1191
1389
 
1192
1390
  ChefModernize/ExecuteSleep:
1193
1391
  Description: Chef Infra Client 15.5 and later include a chef_sleep resource that should be used to sleep between executing resources if necessary instead of using the bash or execute resources to run the sleep command.
1392
+ StyleGuide: '#chefmodernizeexecutesleep'
1194
1393
  Enabled: true
1195
1394
  VersionAdded: '5.16.0'
1196
1395
  Exclude:
@@ -1200,6 +1399,7 @@ ChefModernize/ExecuteSleep:
1200
1399
 
1201
1400
  ChefModernize/DslIncludeInResource:
1202
1401
  Description: 'There is no need to include Chef::DSL::Recipe or Chef::DSL::IncludeRecipe classes in resources or providers as this is done automatically.'
1402
+ StyleGuide: '#chefmodernizedslincludeinresource'
1203
1403
  Enabled: true
1204
1404
  VersionAdded: '5.17.0'
1205
1405
  Include:
@@ -1208,6 +1408,7 @@ ChefModernize/DslIncludeInResource:
1208
1408
 
1209
1409
  ChefModernize/ResourceForcingCompileTime:
1210
1410
  Description: The hostname, build_essential, chef_gem, and ohai_hint resources include 'compile_time' properties, which should be used to force the resources to run at compile time by setting `compile_time true`.
1411
+ StyleGuide: '#chefmodernizeresourceforcingcompiletime'
1211
1412
  Enabled: true
1212
1413
  VersionAdded: '5.18.0'
1213
1414
  Exclude:
@@ -1217,6 +1418,7 @@ ChefModernize/ResourceForcingCompileTime:
1217
1418
 
1218
1419
  ChefModernize/ExecuteSysctl:
1219
1420
  Description: Chef Infra Client 14.0 and later includes a sysctl resource that should be used to idempotently load sysctl values instead of templating files and using execute to load them.
1421
+ StyleGuide: '#chefmodernizeexecutesysctl'
1220
1422
  Enabled: true
1221
1423
  VersionAdded: '5.18.0'
1222
1424
  Exclude:
@@ -1226,6 +1428,7 @@ ChefModernize/ExecuteSysctl:
1226
1428
 
1227
1429
  ChefModernize/SimplifyAptPpaSetup:
1228
1430
  Description: The apt_repository resource allows setting up PPAs without using the full URL to ppa.launchpad.net.
1431
+ StyleGuide: '#chefmodernizesimplifyaptppasetup'
1229
1432
  Enabled: true
1230
1433
  VersionAdded: '5.21.0'
1231
1434
  Exclude:
@@ -1235,6 +1438,7 @@ ChefModernize/SimplifyAptPpaSetup:
1235
1438
 
1236
1439
  ChefModernize/UseRequireRelative:
1237
1440
  Description: Instead of using require with a File.expand_path and __FILE__ use the simpler require_relative method.
1441
+ StyleGuide: '#chefmodernizeuserequirerelative'
1238
1442
  Enabled: true
1239
1443
  VersionAdded: '5.22.0'
1240
1444
  Exclude:
@@ -1244,6 +1448,7 @@ ChefModernize/UseRequireRelative:
1244
1448
 
1245
1449
  ChefModernize/NodeInitPackage:
1246
1450
  Description: Use node['init_package'] to check for systemd instead of reading the contents of '/proc/1/comm'
1451
+ StyleGuide: '#chefmodernizenodeinitpackage'
1247
1452
  Enabled: true
1248
1453
  VersionAdded: '5.22.0'
1249
1454
  Exclude:
@@ -1252,6 +1457,7 @@ ChefModernize/NodeInitPackage:
1252
1457
 
1253
1458
  ChefModernize/WindowsRegistryUAC:
1254
1459
  Description: Chef Infra Client 15.0 and later includes a windows_uac resource that should be used to set Windows UAC values instead of setting registry keys directly.
1460
+ StyleGuide: '#chefmodernizewindowsregistryuac'
1255
1461
  Enabled: true
1256
1462
  VersionAdded: '5.22.0'
1257
1463
  Exclude:
@@ -1261,6 +1467,7 @@ ChefModernize/WindowsRegistryUAC:
1261
1467
 
1262
1468
  ChefModernize/UseMultipackageInstalls:
1263
1469
  Description: Pass an array of packages to package resources instead of interating over an array of packages when using multi-package capable package subystem such as apt, yum, chocolatey, dnf, or zypper. Multipackage installs are faster and simplify logs.
1470
+ StyleGuide: '#chefmodernizeusemultipackageinstalls'
1264
1471
  Enabled: true
1265
1472
  VersionAdded: '6.0.0'
1266
1473
  Exclude:
@@ -1270,6 +1477,7 @@ ChefModernize/UseMultipackageInstalls:
1270
1477
 
1271
1478
  ChefModernize/ProvidesFromInitialize:
1272
1479
  Description: Provides should be set using the `provides` resource DSL method instead of instead of setting @provides in the initialize method.
1480
+ StyleGuide: '#chefmodernizeprovidesfrominitialize'
1273
1481
  Enabled: true
1274
1482
  VersionAdded: '6.0.0'
1275
1483
  Include:
@@ -1279,6 +1487,7 @@ ChefModernize/ProvidesFromInitialize:
1279
1487
 
1280
1488
  ChefModernize/DatabagHelpers:
1281
1489
  Description: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`.
1490
+ StyleGuide: '#chefmodernizedatabaghelpers'
1282
1491
  Enabled: true
1283
1492
  VersionAdded: '6.0.0'
1284
1493
  Exclude:
@@ -1287,6 +1496,7 @@ ChefModernize/DatabagHelpers:
1287
1496
 
1288
1497
  ChefModernize/NodeRolesInclude:
1289
1498
  Description: Use `node.role?('foo')` to check if a node includes a role instead of `node['roles'].include?('foo')`.
1499
+ StyleGuide: '#chefmodernizenoderolesinclude'
1290
1500
  Enabled: true
1291
1501
  VersionAdded: '6.1.0'
1292
1502
  Exclude:
@@ -1295,6 +1505,7 @@ ChefModernize/NodeRolesInclude:
1295
1505
 
1296
1506
  ChefModernize/RespondToCompileTime:
1297
1507
  Description: There is no need to check if the chef_gem resource supports compile_time as Chef Infra Client 12.1 and later support the compile_time property.
1508
+ StyleGuide: '#chefmodernizeresondtocompiletime'
1298
1509
  Enabled: true
1299
1510
  VersionAdded: '6.3.0'
1300
1511
  Exclude:
@@ -1303,6 +1514,7 @@ ChefModernize/RespondToCompileTime:
1303
1514
 
1304
1515
  ChefModernize/ShellOutHelper:
1305
1516
  Description: Use the built-in shell_out helper available in Chef Infra Client 12.11+ instead of calling Mixlib::ShellOut.new('foo').run_command.
1517
+ StyleGuide: '#chefmodernizeshellouthelper'
1306
1518
  Enabled: true
1307
1519
  VersionAdded: '6.5.0'
1308
1520
  Exclude:
@@ -1314,8 +1526,12 @@ ChefModernize/ShellOutHelper:
1314
1526
  # ChefRedundantCode: Cleanup unnecessary code in your cookbooks regardless of Chef Infra Client release
1315
1527
  ###############################
1316
1528
 
1529
+ ChefRedundantCode:
1530
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefredundantcode.md
1531
+
1317
1532
  ChefRedundantCode/ConflictsMetadata:
1318
1533
  Description: Don't use the deprecated 'conflicts' metadata value
1534
+ StyleGuide: '#chefredundantcodeconflictsmetadata'
1319
1535
  Enabled: true
1320
1536
  VersionAdded: '5.1.0'
1321
1537
  VersionChanged: '5.15.0'
@@ -1324,6 +1540,7 @@ ChefRedundantCode/ConflictsMetadata:
1324
1540
 
1325
1541
  ChefRedundantCode/SuggestsMetadata:
1326
1542
  Description: The suggests metadata.rb method is not used and is unnecessary in cookbooks.
1543
+ StyleGuide: '#chefredundantcodesuggestsmetadata'
1327
1544
  Enabled: true
1328
1545
  VersionAdded: '5.1.0'
1329
1546
  VersionChanged: '5.15.0'
@@ -1332,6 +1549,7 @@ ChefRedundantCode/SuggestsMetadata:
1332
1549
 
1333
1550
  ChefRedundantCode/ProvidesMetadata:
1334
1551
  Description: The provides metadata.rb method is not used and is unnecessary in cookbooks.
1552
+ StyleGuide: '#chefredundantcodeprovidesmetadata'
1335
1553
  Enabled: true
1336
1554
  VersionAdded: '5.1.0'
1337
1555
  VersionChanged: '5.15.0'
@@ -1340,6 +1558,7 @@ ChefRedundantCode/ProvidesMetadata:
1340
1558
 
1341
1559
  ChefRedundantCode/ReplacesMetadata:
1342
1560
  Description: The replaces metadata.rb method is not used and is unnecessary in cookbooks.
1561
+ StyleGuide: '#chefredundantcodereplacesmetadata'
1343
1562
  Enabled: true
1344
1563
  VersionAdded: '5.1.0'
1345
1564
  VersionChanged: '5.15.0'
@@ -1348,6 +1567,7 @@ ChefRedundantCode/ReplacesMetadata:
1348
1567
 
1349
1568
  ChefRedundantCode/AttributeMetadata:
1350
1569
  Description: The attribute metadata.rb method is not used and is unnecessary in cookbooks.
1570
+ StyleGuide: '#chefredundantcodeattributemetadata'
1351
1571
  Enabled: true
1352
1572
  VersionAdded: '5.1.0'
1353
1573
  VersionChanged: '5.15.0'
@@ -1356,6 +1576,7 @@ ChefRedundantCode/AttributeMetadata:
1356
1576
 
1357
1577
  ChefRedundantCode/LongDescriptionMetadata:
1358
1578
  Description: The long_description metadata.rb method is not used and is unnecessary in cookbooks
1579
+ StyleGuide: '#chefredundantcodelongdescriptionmetadata'
1359
1580
  Enabled: true
1360
1581
  VersionAdded: '5.2.0'
1361
1582
  VersionChanged: '5.15.0'
@@ -1364,6 +1585,7 @@ ChefRedundantCode/LongDescriptionMetadata:
1364
1585
 
1365
1586
  ChefRedundantCode/RecipeMetadata:
1366
1587
  Description: The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the README.md file instead.
1588
+ StyleGuide: '#chefredundantcoderecipemetadata'
1367
1589
  Enabled: true
1368
1590
  VersionAdded: '5.6.0'
1369
1591
  VersionChanged: '5.15.0'
@@ -1372,6 +1594,7 @@ ChefRedundantCode/RecipeMetadata:
1372
1594
 
1373
1595
  ChefRedundantCode/ResourceWithNothingAction:
1374
1596
  Description: There is no need to define a :nothing action in your resource as Chef Infra Client provides the :nothing action by default for every resource.
1597
+ StyleGuide: '#chefredundantcoderesourcewithnothingaction'
1375
1598
  Enabled: true
1376
1599
  VersionAdded: '5.12.0'
1377
1600
  VersionChanged: '5.15.0'
@@ -1382,6 +1605,7 @@ ChefRedundantCode/ResourceWithNothingAction:
1382
1605
 
1383
1606
  ChefRedundantCode/UnnecessaryNameProperty:
1384
1607
  Description: There is no need to define a property named :name in a resource as Chef Infra defines that property for all resources by default.
1608
+ StyleGuide: '#chefredundantcodeunnecessarynameproperty'
1385
1609
  Enabled: true
1386
1610
  VersionAdded: '5.8.0'
1387
1611
  VersionChanged: '5.15.0'
@@ -1391,6 +1615,7 @@ ChefRedundantCode/UnnecessaryNameProperty:
1391
1615
 
1392
1616
  ChefRedundantCode/PropertyWithRequiredAndDefault:
1393
1617
  Description: Resource property should not be both required and have a default value
1618
+ StyleGuide: '#chefredundantcodepropertywithrequiredanddefault'
1394
1619
  Enabled: true
1395
1620
  VersionAdded: '5.1.0'
1396
1621
  VersionChanged: '5.15.0'
@@ -1400,6 +1625,7 @@ ChefRedundantCode/PropertyWithRequiredAndDefault:
1400
1625
 
1401
1626
  ChefRedundantCode/NamePropertyIsRequired:
1402
1627
  Description: Resource properties marked as name properties should not also be required properties
1628
+ StyleGuide: '#chefredundantcodenamepropertyisrequired'
1403
1629
  Enabled: true
1404
1630
  VersionAdded: '5.1.0'
1405
1631
  VersionChanged: '5.15.0'
@@ -1409,6 +1635,7 @@ ChefRedundantCode/NamePropertyIsRequired:
1409
1635
 
1410
1636
  ChefRedundantCode/CustomResourceWithAllowedActions:
1411
1637
  Description: It is not necessary to set `actions` or `allowed_actions` in custom resources as Chef Infra Client determines these automatically from the set of all actions defined in the resource.
1638
+ StyleGuide: '#chefredundantcodecustomresourcewithallowedactions'
1412
1639
  Enabled: true
1413
1640
  VersionAdded: '5.2.0'
1414
1641
  VersionChanged: '5.15.0'
@@ -1417,6 +1644,7 @@ ChefRedundantCode/CustomResourceWithAllowedActions:
1417
1644
 
1418
1645
  ChefRedundantCode/SensitivePropertyInResource:
1419
1646
  Description: Every Chef Infra resources already include a sensitive property with a default value of false.
1647
+ StyleGuide: '#chefredundantcodesensitivepropertyinresource'
1420
1648
  Enabled: true
1421
1649
  VersionAdded: '5.16.0'
1422
1650
  Include:
@@ -1425,6 +1653,7 @@ ChefRedundantCode/SensitivePropertyInResource:
1425
1653
 
1426
1654
  ChefRedundantCode/UnnecessaryDesiredState:
1427
1655
  Description: 'There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.'
1656
+ StyleGuide: '#chefredundantcodeunnecessarydesiredstate'
1428
1657
  Enabled: true
1429
1658
  VersionAdded: '5.16.0'
1430
1659
  Include:
@@ -1433,6 +1662,7 @@ ChefRedundantCode/UnnecessaryDesiredState:
1433
1662
 
1434
1663
  ChefRedundantCode/AptRepositoryNotifiesAptUpdate:
1435
1664
  Description: There is no need to notify an apt-get update when an apt_repository is created as this is done automatically by the apt_repository resource.
1665
+ StyleGuide: '#chefredundantcodeaptrepositorynotifiesaptupdate'
1436
1666
  Enabled: true
1437
1667
  VersionAdded: '5.17.0'
1438
1668
  Exclude:
@@ -1442,6 +1672,7 @@ ChefRedundantCode/AptRepositoryNotifiesAptUpdate:
1442
1672
 
1443
1673
  ChefRedundantCode/AptRepositoryDistributionDefault:
1444
1674
  Description: There is no need to pass `distribution node['lsb']['codename']` to an apt_repository resource as this is done automatically by the apt_repository resource.
1675
+ StyleGuide: '#chefredundantcodeaptrepositorydistributiondefault'
1445
1676
  Enabled: true
1446
1677
  VersionAdded: '5.17.0'
1447
1678
  Exclude:
@@ -1451,6 +1682,7 @@ ChefRedundantCode/AptRepositoryDistributionDefault:
1451
1682
 
1452
1683
  ChefRedundantCode/GroupingMetadata:
1453
1684
  Description: The grouping metadata.rb method is not used and is unnecessary in cookbooks.
1685
+ StyleGuide: '#chefredundantcodegroupingmetadata'
1454
1686
  Enabled: true
1455
1687
  VersionAdded: '5.19.0'
1456
1688
  Include:
@@ -1458,6 +1690,7 @@ ChefRedundantCode/GroupingMetadata:
1458
1690
 
1459
1691
  ChefRedundantCode/StringPropertyWithNilDefault:
1460
1692
  Description: Properties have a nil value by default so there is no need to set the default value to nil.
1693
+ StyleGuide: '#chefredundantcodestringpropertywithnildefault'
1461
1694
  Enabled: true
1462
1695
  VersionAdded: '5.21.0'
1463
1696
  Include:
@@ -1466,6 +1699,7 @@ ChefRedundantCode/StringPropertyWithNilDefault:
1466
1699
 
1467
1700
  ChefRedundantCode/PropertySplatRegex:
1468
1701
  Description: There is no need to validate the input of properties in resources using a regex value that will always pass.
1702
+ StyleGuide: '#chefredundantcodepropertysplatregex'
1469
1703
  Enabled: true
1470
1704
  VersionAdded: '5.21.0'
1471
1705
  Include:
@@ -1474,6 +1708,7 @@ ChefRedundantCode/PropertySplatRegex:
1474
1708
 
1475
1709
  ChefRedundantCode/UseCreateIfMissing:
1476
1710
  Description: Use the :create_if_missing action instead of not_if with a ::File.exist(FOO) check.
1711
+ StyleGuide: '#chefredundantcodeusecreateifmissing'
1477
1712
  Enabled: true
1478
1713
  VersionAdded: '6.2.0'
1479
1714
  Exclude:
@@ -1482,11 +1717,15 @@ ChefRedundantCode/UseCreateIfMissing:
1482
1717
  - '**/Berksfile'
1483
1718
 
1484
1719
  ###############################
1485
- # Migrating to new patterns
1720
+ # ChefEffortless: Migrating to new patterns
1486
1721
  ###############################
1487
1722
 
1723
+ ChefEffortless:
1724
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefeffortless.md
1725
+
1488
1726
  ChefEffortless/CookbookUsesSearch:
1489
1727
  Description: Cookbook uses search, which cannot be used in the Effortless Infra pattern
1728
+ StyleGuide: '#chefeffortlesscookbookusessearch'
1490
1729
  Enabled: false
1491
1730
  VersionAdded: '5.1.0'
1492
1731
  Exclude:
@@ -1495,6 +1734,7 @@ ChefEffortless/CookbookUsesSearch:
1495
1734
 
1496
1735
  ChefEffortless/CookbookUsesDatabags:
1497
1736
  Description: Cookbook uses data bags, which cannot be used in the Effortless Infra pattern
1737
+ StyleGuide: '#chefeffortlesscookbookusesdatabags'
1498
1738
  Enabled: false
1499
1739
  VersionAdded: '5.1.0'
1500
1740
  Exclude:
@@ -1503,6 +1743,7 @@ ChefEffortless/CookbookUsesDatabags:
1503
1743
 
1504
1744
  ChefEffortless/CookbookUsesEnvironmments:
1505
1745
  Description: Cookbook uses environments, which cannot be used in the Effortless Infra pattern
1746
+ StyleGuide: '#chefeffortlesscookbookusesenvironments'
1506
1747
  Enabled: false
1507
1748
  VersionAdded: '5.10.0'
1508
1749
  Exclude:
@@ -1511,6 +1752,7 @@ ChefEffortless/CookbookUsesEnvironmments:
1511
1752
 
1512
1753
  ChefEffortless/CookbookUsesPolicygroups:
1513
1754
  Description: Cookbook uses Policy Groups, which cannot be used in the Effortless Infra pattern
1755
+ StyleGuide: '#chefeffortlesscookbookusespolicygroups'
1514
1756
  Enabled: false
1515
1757
  VersionAdded: '5.10.0'
1516
1758
  Exclude:
@@ -1519,6 +1761,7 @@ ChefEffortless/CookbookUsesPolicygroups:
1519
1761
 
1520
1762
  ChefEffortless/CookbookUsesRoles:
1521
1763
  Description: Cookbook uses Roles, which cannot be used in the Effortless Infra pattern
1764
+ StyleGuide: '#chefeffortlesscookbookusesroles'
1522
1765
  Enabled: false
1523
1766
  VersionAdded: '5.10.0'
1524
1767
  Exclude:
@@ -1527,6 +1770,7 @@ ChefEffortless/CookbookUsesRoles:
1527
1770
 
1528
1771
  ChefEffortless/SearchForEnvironmentsOrRoles:
1529
1772
  Description: Cookbook uses search with a node query that looks for a role or environment
1773
+ StyleGuide: '#chefeffortlesssearchforenvironmentsorroles'
1530
1774
  Enabled: false
1531
1775
  VersionAdded: '5.11.0'
1532
1776
  Exclude:
@@ -1535,6 +1779,7 @@ ChefEffortless/SearchForEnvironmentsOrRoles:
1535
1779
 
1536
1780
  ChefEffortless/Berksfile:
1537
1781
  Description: Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.
1782
+ StyleGuide: '#chefeffortlessberksfile'
1538
1783
  Enabled: false
1539
1784
  VersionAdded: '5.12.0'
1540
1785
  Include: