cookstyle 6.2.9 → 6.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/config/cookstyle.yml +306 -15
  4. data/config/disable_all.yml +21 -3
  5. data/config/upstream.yml +141 -35
  6. data/lib/cookstyle.rb +1 -1
  7. data/lib/cookstyle/version.rb +2 -2
  8. data/lib/rubocop/chef/platform_helpers.rb +2 -1
  9. data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +77 -0
  10. data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +77 -0
  11. data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +56 -0
  12. data/lib/rubocop/cop/chef/correctness/node_normal.rb +1 -1
  13. data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +1 -1
  14. data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +45 -0
  15. data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +1 -1
  16. data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +1 -1
  17. data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +10 -4
  18. data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +65 -0
  19. data/lib/rubocop/cop/chef/deprecation/easy_install.rb +2 -2
  20. data/lib/rubocop/cop/chef/deprecation/erl_call.rb +1 -1
  21. data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +2 -2
  22. data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +1 -1
  23. data/lib/rubocop/cop/chef/deprecation/node_set.rb +2 -3
  24. data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +2 -3
  25. data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +3 -3
  26. data/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +77 -0
  27. data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +59 -0
  28. data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +6 -1
  29. data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +3 -3
  30. data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +24 -3
  31. data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +93 -0
  32. data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +15 -5
  33. data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +64 -0
  34. data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +8 -4
  35. data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +1 -1
  36. data/lib/rubocop/cop/target_chef_version.rb +4 -0
  37. data/lib/rubocop/monkey_patches/team.rb +24 -0
  38. metadata +14 -5
  39. data/lib/rubocop/monkey_patches/commissioner.rb +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e4a34f5dc3234aeb3febf3019211d19e70b32538dfe55a13150ba45086767b2
4
- data.tar.gz: 6825981876e3882b87e5699c0e9127cf0c0512201771086bc1ad5948cfb9b71f
3
+ metadata.gz: 80cc2eea05cb8d161ae1849a5c9ccb5c104016d2f855945a38d45ce19e5e514e
4
+ data.tar.gz: a9db56d7cddd31470f7ec92326ad3763775d5536089cc70621ad60966eb806b1
5
5
  SHA512:
6
- metadata.gz: 31bb85b95815744e511f172d62e83c21624c2192d15cd8e766b4b5a960165f5367bcbd289cb0df8db25d842f826889f1e1b9b6f5dfedc1f2fe2bd82dbd428e95
7
- data.tar.gz: 4d5ea06716a8559835225d596594deb81e40a61ab38141b0f9ea3e65bfec8460fd53b45a64eea036de136cf56fcec1ade258160d8d74e7f48fc1f1137e9f19e7
6
+ metadata.gz: a2e16c81ad78a74694473ace336016e135552e427a2e8ee2ab697f28678afc038def94552512c37e519fe60459362f31718c180fc01a7fde6aab4f62e5606109
7
+ data.tar.gz: 05e491839ef5ada7257e780ec9d105cfed7b027451c78af9435723efc968d2380b5ad604763efceeb003a2a221e03057186ab358133e0145f79728c45c8f414b
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
@@ -1,9 +1,9 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.3
2
+ TargetRubyVersion: 2.4
3
3
  TargetChefVersion: ~
4
4
  Exclude:
5
- - '**/files/**/*'
6
- - '**/vendor/**/*'
5
+ - '/**/files/**/*'
6
+ - '/**/vendor/**/*'
7
7
  - Guardfile
8
8
  ChefAttributes:
9
9
  Patterns:
@@ -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,18 +965,51 @@ 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:
825
972
  - '**/metadata.rb'
826
973
  - '**/Berksfile'
827
974
 
975
+ ChefDeprecations/DeprecatedShelloutMethods:
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'
978
+ Enabled: true
979
+ VersionAdded: '6.3.0'
980
+ Exclude:
981
+ - '**/metadata.rb'
982
+ - '**/attributes/*.rb'
983
+ - '**/Berksfile'
984
+
985
+ ChefDeprecations/Ruby27KeywordArgumentWarnings:
986
+ Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
987
+ StyleGuide: '#chefdeprecationsruby27keywordargumentwarnings'
988
+ Enabled: true
989
+ VersionAdded: '6.5.0'
990
+ Exclude:
991
+ - '**/metadata.rb'
992
+ - '**/Berksfile'
993
+
994
+ ChefDeprecations/ResourceUsesOnlyResourceName:
995
+ Description: Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Use `provides` to change the name of the resource instead and omit `resource_name` entirely if it matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME.
996
+ StyleGuide: '#chefdeprecationsresourceusesonlyresourcename'
997
+ Enabled: true
998
+ VersionAdded: '6.7.0'
999
+ Include:
1000
+ - '**/libraries/*.rb'
1001
+ - '**/resources/*.rb'
1002
+
828
1003
  ###############################
829
1004
  # ChefModernize: Cleaning up legacy code and using new built-in resources
830
1005
  ###############################
831
1006
 
1007
+ ChefModernize:
1008
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefmodernize.md
1009
+
832
1010
  ChefModernize/LegacyBerksfileSource:
833
1011
  Description: Do not use legacy Berksfile community sources. Use Chef Supermarket instead.
1012
+ StyleGuide: '#chefmodernizelegacyberksfilesource'
834
1013
  Enabled: true
835
1014
  VersionAdded: '5.1.0'
836
1015
  Include:
@@ -838,6 +1017,7 @@ ChefModernize/LegacyBerksfileSource:
838
1017
 
839
1018
  ChefModernize/WhyRunSupportedTrue:
840
1019
  Description: whyrun_supported? no longer needs to be set to true as it is the default in Chef 13+
1020
+ StyleGuide: '#chefmodernizewhyrunsupportedtrue'
841
1021
  Enabled: true
842
1022
  VersionAdded: '5.1.0'
843
1023
  Include:
@@ -847,13 +1027,15 @@ ChefModernize/WhyRunSupportedTrue:
847
1027
 
848
1028
  ChefModernize/UnnecessaryDependsChef14:
849
1029
  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.
1030
+ StyleGuide: '#chefmodernizeunnecessarydependschef14'
850
1031
  Enabled: true
851
1032
  VersionAdded: '5.1.0'
852
1033
  Include:
853
1034
  - '**/metadata.rb'
854
1035
 
855
1036
  ChefModernize/RespondToInMetadata:
856
- Description: It is no longer necessary to use respond_to? in metadata.rb in Chef 12.15 and later
1037
+ Description: It is no longer necessary to use respond_to? in metadata.rb in Chef Infra Client 12.15 and later
1038
+ StyleGuide: '#chefmodernizerespondtoinmetadata'
857
1039
  Enabled: true
858
1040
  VersionAdded: '5.2.0'
859
1041
  Include:
@@ -861,6 +1043,7 @@ ChefModernize/RespondToInMetadata:
861
1043
 
862
1044
  ChefModernize/RespondToResourceName:
863
1045
  Description: respond_to?(:resource_name) in resources is no longer necessary in Chef Infra Client 12.5+
1046
+ StyleGuide: '#chefmodernizerespondtoresourcename'
864
1047
  Enabled: true
865
1048
  VersionAdded: '5.2.0'
866
1049
  Include:
@@ -869,6 +1052,7 @@ ChefModernize/RespondToResourceName:
869
1052
 
870
1053
  ChefModernize/RespondToProvides:
871
1054
  Description: respond_to?(:provides) in resources is no longer necessary in Chef Infra Client 12+
1055
+ StyleGuide: '#chefmodernizerespondtoprovides'
872
1056
  Enabled: true
873
1057
  VersionAdded: '5.2.0'
874
1058
  Include:
@@ -877,6 +1061,7 @@ ChefModernize/RespondToProvides:
877
1061
 
878
1062
  ChefModernize/SetOrReturnInResources:
879
1063
  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.
1064
+ StyleGuide: '#chefmodernizesetorreturninresources'
880
1065
  Enabled: true
881
1066
  VersionAdded: '5.2.0'
882
1067
  Include:
@@ -885,6 +1070,7 @@ ChefModernize/SetOrReturnInResources:
885
1070
 
886
1071
  ChefModernize/CustomResourceWithAttributes:
887
1072
  Description: Custom Resources should contain properties not attributes.
1073
+ StyleGuide: '#chefmodernizecustomresourcewithattributes'
888
1074
  Enabled: true
889
1075
  VersionAdded: '5.2.0'
890
1076
  Include:
@@ -892,6 +1078,7 @@ ChefModernize/CustomResourceWithAttributes:
892
1078
 
893
1079
  ChefModernize/IncludingAptDefaultRecipe:
894
1080
  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.
1081
+ StyleGuide: '#chefmodernizeincludingaptdefaultrecipe'
895
1082
  Enabled: true
896
1083
  VersionAdded: '5.3.0'
897
1084
  Exclude:
@@ -899,6 +1086,7 @@ ChefModernize/IncludingAptDefaultRecipe:
899
1086
 
900
1087
  ChefModernize/IncludingWindowsDefaultRecipe:
901
1088
  Description: Do not include the Windows default recipe, which only installs win32 gems already included in Chef Infra Client
1089
+ StyleGuide: '#chefmodernizeincludingwindowsdefaultrecipe'
902
1090
  Enabled: true
903
1091
  VersionAdded: '5.3.0'
904
1092
  Exclude:
@@ -906,6 +1094,7 @@ ChefModernize/IncludingWindowsDefaultRecipe:
906
1094
 
907
1095
  ChefModernize/DefinesChefSpecMatchers:
908
1096
  Description: ChefSpec matchers are now auto generated by ChefSpec 7.1+ and do not need to be defined in a cookbook
1097
+ StyleGuide: '#chefmodernizedefineschefspecmatchers'
909
1098
  Enabled: true
910
1099
  VersionAdded: '5.3.0'
911
1100
  Include:
@@ -913,6 +1102,7 @@ ChefModernize/DefinesChefSpecMatchers:
913
1102
 
914
1103
  ChefModernize/ExecuteAptUpdate:
915
1104
  Description: Use the apt_update resource instead of the execute resource to run an apt-get update package cache update
1105
+ StyleGuide: '#chefmodernizeexecuteaptupdate'
916
1106
  Enabled: true
917
1107
  VersionAdded: '5.3.0'
918
1108
  Exclude:
@@ -920,6 +1110,7 @@ ChefModernize/ExecuteAptUpdate:
920
1110
 
921
1111
  ChefModernize/MinitestHandlerUsage:
922
1112
  Description: Use Chef InSpec for testing instead of the Minitest Handler cookbook pattern.
1113
+ StyleGuide: '#chefmodernizeminitesthandlerusage'
923
1114
  Enabled: true
924
1115
  VersionAdded: '5.4.0'
925
1116
  Include:
@@ -927,14 +1118,17 @@ ChefModernize/MinitestHandlerUsage:
927
1118
 
928
1119
  ChefModernize/IncludingMixinShelloutInResources:
929
1120
  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+.
1121
+ StyleGuide: '#chefmodernizeincludingmixinshelloutinresources'
930
1122
  Enabled: true
931
1123
  VersionAdded: '5.4.0'
932
1124
  Include:
933
1125
  - '**/resources/*.rb'
934
1126
  - '**/providers/*.rb'
1127
+ - '**/libraries/*.rb'
935
1128
 
936
1129
  ChefModernize/UseBuildEssentialResource:
937
1130
  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+
1131
+ StyleGuide: '#chefmodernizeusebuildessentialresource'
938
1132
  Enabled: true
939
1133
  VersionAdded: '5.1.0'
940
1134
  Exclude:
@@ -942,6 +1136,7 @@ ChefModernize/UseBuildEssentialResource:
942
1136
 
943
1137
  ChefModernize/WindowsZipfileUsage:
944
1138
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook
1139
+ StyleGuide: '#chefmodernizewindowszipfileusage'
945
1140
  Enabled: true
946
1141
  VersionAdded: '5.4.0'
947
1142
  Exclude:
@@ -949,6 +1144,7 @@ ChefModernize/WindowsZipfileUsage:
949
1144
 
950
1145
  ChefModernize/SevenZipArchiveResource:
951
1146
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the seven_zip_archive
1147
+ StyleGuide: '#chefmodernizesevenziparchiveresource'
952
1148
  Enabled: true
953
1149
  VersionAdded: '5.5.0'
954
1150
  Exclude:
@@ -956,6 +1152,7 @@ ChefModernize/SevenZipArchiveResource:
956
1152
 
957
1153
  ChefModernize/LibarchiveFileResource:
958
1154
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the libarchive file resource
1155
+ StyleGuide: '#chefmodernizelibarchivefileresource'
959
1156
  Enabled: true
960
1157
  VersionAdded: '5.5.0'
961
1158
  Exclude:
@@ -963,6 +1160,7 @@ ChefModernize/LibarchiveFileResource:
963
1160
 
964
1161
  ChefModernize/PowershellScriptExpandArchive:
965
1162
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of using Expand-Archive in a powershell_script resource
1163
+ StyleGuide: '#chefmodernizepowershellscriptexpandarchive'
966
1164
  Enabled: true
967
1165
  VersionAdded: '5.5.0'
968
1166
  Exclude:
@@ -970,6 +1168,7 @@ ChefModernize/PowershellScriptExpandArchive:
970
1168
 
971
1169
  ChefModernize/PowershellInstallPackage:
972
1170
  Description: Use the package resource built into Chef Infra Client instead of using Install-Package in a powershell_script resource
1171
+ StyleGuide: '#chefmodernizepowershellinstallpackage'
973
1172
  Enabled: true
974
1173
  VersionAdded: '5.5.0'
975
1174
  Exclude:
@@ -977,6 +1176,7 @@ ChefModernize/PowershellInstallPackage:
977
1176
 
978
1177
  ChefModernize/PowershellInstallWindowsFeature:
979
1178
  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
1179
+ StyleGuide: '#chefmodernizepowershellinstallwindowsfeature'
980
1180
  Enabled: true
981
1181
  VersionAdded: '5.5.0'
982
1182
  Exclude:
@@ -984,6 +1184,7 @@ ChefModernize/PowershellInstallWindowsFeature:
984
1184
 
985
1185
  ChefModernize/ShellOutToChocolatey:
986
1186
  Description: Use the Chocolatey resources built into Chef Infra Client instead of shelling out to the choco command
1187
+ StyleGuide: '#chefmodernizeshellouttochocolatey'
987
1188
  Enabled: true
988
1189
  VersionAdded: '5.5.0'
989
1190
  Exclude:
@@ -991,6 +1192,7 @@ ChefModernize/ShellOutToChocolatey:
991
1192
 
992
1193
  ChefModernize/CronManageResource:
993
1194
  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.
1195
+ StyleGuide: '#chefmodernizecronmanageresource'
994
1196
  Enabled: true
995
1197
  VersionAdded: '5.6.0'
996
1198
  Exclude:
@@ -998,6 +1200,7 @@ ChefModernize/CronManageResource:
998
1200
 
999
1201
  ChefModernize/UsesZypperRepo:
1000
1202
  Description: The zypper_repo resource was renamed zypper_repository when it was added to Chef Infra Client 13.3.
1203
+ StyleGuide: '#chefmodernizeuseszypperrepo'
1001
1204
  Enabled: true
1002
1205
  VersionAdded: '5.6.0'
1003
1206
  Exclude:
@@ -1005,6 +1208,7 @@ ChefModernize/UsesZypperRepo:
1005
1208
 
1006
1209
  ChefModernize/DependsOnZypperCookbook:
1007
1210
  Description: Don't include the zypper cookbook as the zypper_repository resource is built into Chef Infra Client 13.3+
1211
+ StyleGuide: '#chefmodernizedependsonzyppercookbook'
1008
1212
  Enabled: true
1009
1213
  VersionAdded: '5.6.0'
1010
1214
  Exclude:
@@ -1012,6 +1216,7 @@ ChefModernize/DependsOnZypperCookbook:
1012
1216
 
1013
1217
  ChefModernize/ExecuteTzUtil:
1014
1218
  Description: Use the timezone resource included in Chef Infra Client 14.6+ instead of shelling out to tzutil
1219
+ StyleGuide: '#chefmodernizeexecutetzutil'
1015
1220
  Enabled: true
1016
1221
  VersionAdded: '5.6.0'
1017
1222
  Exclude:
@@ -1019,6 +1224,7 @@ ChefModernize/ExecuteTzUtil:
1019
1224
 
1020
1225
  ChefModernize/OpensslRsaKeyResource:
1021
1226
  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.
1227
+ StyleGuide: '#chefmodernizeopensslrsakeyresource'
1022
1228
  Enabled: true
1023
1229
  VersionAdded: '5.6.0'
1024
1230
  Exclude:
@@ -1026,6 +1232,7 @@ ChefModernize/OpensslRsaKeyResource:
1026
1232
 
1027
1233
  ChefModernize/OpensslX509Resource:
1028
1234
  Description: The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4. The new resource name should be used.
1235
+ StyleGuide: '#chefmodernizeopensslx509resource'
1029
1236
  Enabled: true
1030
1237
  VersionAdded: '5.6.0'
1031
1238
  Exclude:
@@ -1033,6 +1240,7 @@ ChefModernize/OpensslX509Resource:
1033
1240
 
1034
1241
  ChefModernize/OsxConfigProfileResource:
1035
1242
  Description: The osx_config_profile resource was renamed to osx_profile. The new resource name should be used.
1243
+ StyleGuide: '#chefmodernizeosxconfigprofileresource'
1036
1244
  Enabled: true
1037
1245
  VersionAdded: '5.6.0'
1038
1246
  Exclude:
@@ -1040,6 +1248,7 @@ ChefModernize/OsxConfigProfileResource:
1040
1248
 
1041
1249
  ChefModernize/SysctlParamResource:
1042
1250
  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.
1251
+ StyleGuide: '#chefmodernizesysctlparamresource'
1043
1252
  Enabled: true
1044
1253
  VersionAdded: '5.6.0'
1045
1254
  Exclude:
@@ -1047,6 +1256,7 @@ ChefModernize/SysctlParamResource:
1047
1256
 
1048
1257
  ChefModernize/MacOsXUserdefaults:
1049
1258
  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.
1259
+ StyleGuide: '#chefmodernizemacosxuserdefaults'
1050
1260
  Enabled: true
1051
1261
  VersionAdded: '5.6.0'
1052
1262
  Exclude:
@@ -1054,6 +1264,7 @@ ChefModernize/MacOsXUserdefaults:
1054
1264
 
1055
1265
  ChefModernize/PowerShellGuardInterpreter:
1056
1266
  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.
1267
+ StyleGuide: '#chefmodernizepowershellguardinterpreter'
1057
1268
  Enabled: true
1058
1269
  VersionAdded: '5.9.0'
1059
1270
  Exclude:
@@ -1061,6 +1272,7 @@ ChefModernize/PowerShellGuardInterpreter:
1061
1272
 
1062
1273
  ChefModernize/DefaultActionFromInitialize:
1063
1274
  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.
1275
+ StyleGuide: '#chefmodernizedefaultactionfrominitialize'
1064
1276
  Enabled: true
1065
1277
  VersionAdded: '5.10.0'
1066
1278
  Include:
@@ -1070,6 +1282,7 @@ ChefModernize/DefaultActionFromInitialize:
1070
1282
 
1071
1283
  ChefModernize/ResourceNameFromInitialize:
1072
1284
  Description: The name of a resource can be set with the "resource_name" helper instead of using the initialize method.
1285
+ StyleGuide: '#chefmodernizeresourcenamefrominitialize'
1073
1286
  Enabled: true
1074
1287
  VersionAdded: '5.10.0'
1075
1288
  Include:
@@ -1079,13 +1292,15 @@ ChefModernize/ResourceNameFromInitialize:
1079
1292
 
1080
1293
  ChefModernize/Definitions:
1081
1294
  Description: Legacy Chef Infra definitions should be rewritten as custom resources to take full advantage of the Chef Infra feature set.
1295
+ StyleGuide: '#chefmodernizedefinitions'
1082
1296
  Enabled: true
1083
1297
  VersionAdded: '5.11.0'
1084
1298
  Include:
1085
1299
  - '**/definitions/*.rb'
1086
1300
 
1087
1301
  ChefModernize/IfProvidesDefaultAction:
1088
- Description: if defined?(default_action) is no longer necessary in Chef Resources as default_action shipped in Chef 10.8.
1302
+ Description: if defined?(default_action) is no longer necessary in Chef Infra resources as default_action shipped in Chef Infra Client 10.8.
1303
+ StyleGuide: '#chefmodernizeifprovidesdefaultaction'
1089
1304
  Enabled: true
1090
1305
  VersionAdded: '5.12.0'
1091
1306
  Include:
@@ -1094,11 +1309,13 @@ ChefModernize/IfProvidesDefaultAction:
1094
1309
 
1095
1310
  ChefModernize/ZipfileResource:
1096
1311
  Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the zipfile resource from the zipfile cookbook.
1312
+ StyleGuide: '#chefmodernizezipfileresource'
1097
1313
  Enabled: true
1098
1314
  VersionAdded: '5.12.0'
1099
1315
 
1100
1316
  ChefModernize/UnnecessaryMixlibShelloutRequire:
1101
1317
  Description: Chef Infra Client 12.4 and later include mixlib/shellout automatically in resources and providers.
1318
+ StyleGuide: '#chefmodernizeunnecessarymixlibshelloutrequire'
1102
1319
  Enabled: true
1103
1320
  VersionAdded: '5.12.0'
1104
1321
  Include:
@@ -1107,6 +1324,7 @@ ChefModernize/UnnecessaryMixlibShelloutRequire:
1107
1324
 
1108
1325
  ChefModernize/EmptyResourceInitializeMethod:
1109
1326
  Description: There is no need for an empty initialize method in a resource
1327
+ StyleGuide: '#chefmodernizeemptyresourceinitializemethod'
1110
1328
  Enabled: true
1111
1329
  VersionAdded: '5.13.0'
1112
1330
  Include:
@@ -1115,6 +1333,7 @@ ChefModernize/EmptyResourceInitializeMethod:
1115
1333
 
1116
1334
  ChefModernize/ChefGemNokogiri:
1117
1335
  Description: The nokogiri gem ships in Chef Infra Client 12+ and does not need to be installed before being used.
1336
+ StyleGuide: '#chefmodernizechefgemnokogiri'
1118
1337
  Enabled: true
1119
1338
  VersionAdded: '5.14.0'
1120
1339
  Exclude:
@@ -1123,6 +1342,7 @@ ChefModernize/ChefGemNokogiri:
1123
1342
 
1124
1343
  ChefModernize/PropertyWithNameAttribute:
1125
1344
  Description: Resource property sets name_attribute not name_property
1345
+ StyleGuide: '#chefmodernizepropertywithnameattribute'
1126
1346
  Enabled: true
1127
1347
  VersionAdded: '5.1.0'
1128
1348
  VersionChanged: '5.15.0'
@@ -1132,6 +1352,7 @@ ChefModernize/PropertyWithNameAttribute:
1132
1352
 
1133
1353
  ChefModernize/IncludingOhaiDefaultRecipe:
1134
1354
  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.
1355
+ StyleGuide: '#chefmodernizeincludingohaidefaultrecipe'
1135
1356
  Enabled: true
1136
1357
  VersionAdded: '5.4.0'
1137
1358
  VersionChanged: '5.15.0'
@@ -1141,6 +1362,7 @@ ChefModernize/IncludingOhaiDefaultRecipe:
1141
1362
 
1142
1363
  ChefModernize/AllowedActionsFromInitialize:
1143
1364
  Description: The allowed actions of a resource can be set with the "allowed_actions" helper instead of using the initialize method.
1365
+ StyleGuide: '#chefmodernizeallowedactionsfrominitialize'
1144
1366
  Enabled: true
1145
1367
  VersionAdded: '5.15.0'
1146
1368
  Include:
@@ -1149,13 +1371,15 @@ ChefModernize/AllowedActionsFromInitialize:
1149
1371
 
1150
1372
  ChefModernize/FoodcriticComments:
1151
1373
  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.
1152
- Enabled: false
1374
+ StyleGuide: '#chefmodernizefoodcriticcomments'
1375
+ Enabled: true
1153
1376
  VersionAdded: '5.16.0'
1154
1377
  Exclude:
1155
1378
  - '**/Berksfile'
1156
1379
 
1157
1380
  ChefModernize/ExecuteScExe:
1158
1381
  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
1382
+ StyleGuide: '#chefmodernizeexecutescexe'
1159
1383
  Enabled: true
1160
1384
  VersionAdded: '5.16.0'
1161
1385
  Exclude:
@@ -1165,6 +1389,7 @@ ChefModernize/ExecuteScExe:
1165
1389
 
1166
1390
  ChefModernize/WindowsScResource:
1167
1391
  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.
1392
+ StyleGuide: '#chefmodernizewindowsscresource'
1168
1393
  Enabled: true
1169
1394
  VersionAdded: '5.16.0'
1170
1395
  Exclude:
@@ -1174,6 +1399,7 @@ ChefModernize/WindowsScResource:
1174
1399
 
1175
1400
  ChefModernize/ExecuteSleep:
1176
1401
  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.
1402
+ StyleGuide: '#chefmodernizeexecutesleep'
1177
1403
  Enabled: true
1178
1404
  VersionAdded: '5.16.0'
1179
1405
  Exclude:
@@ -1183,6 +1409,7 @@ ChefModernize/ExecuteSleep:
1183
1409
 
1184
1410
  ChefModernize/DslIncludeInResource:
1185
1411
  Description: 'There is no need to include Chef::DSL::Recipe or Chef::DSL::IncludeRecipe classes in resources or providers as this is done automatically.'
1412
+ StyleGuide: '#chefmodernizedslincludeinresource'
1186
1413
  Enabled: true
1187
1414
  VersionAdded: '5.17.0'
1188
1415
  Include:
@@ -1191,6 +1418,7 @@ ChefModernize/DslIncludeInResource:
1191
1418
 
1192
1419
  ChefModernize/ResourceForcingCompileTime:
1193
1420
  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`.
1421
+ StyleGuide: '#chefmodernizeresourceforcingcompiletime'
1194
1422
  Enabled: true
1195
1423
  VersionAdded: '5.18.0'
1196
1424
  Exclude:
@@ -1200,6 +1428,7 @@ ChefModernize/ResourceForcingCompileTime:
1200
1428
 
1201
1429
  ChefModernize/ExecuteSysctl:
1202
1430
  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.
1431
+ StyleGuide: '#chefmodernizeexecutesysctl'
1203
1432
  Enabled: true
1204
1433
  VersionAdded: '5.18.0'
1205
1434
  Exclude:
@@ -1209,6 +1438,7 @@ ChefModernize/ExecuteSysctl:
1209
1438
 
1210
1439
  ChefModernize/SimplifyAptPpaSetup:
1211
1440
  Description: The apt_repository resource allows setting up PPAs without using the full URL to ppa.launchpad.net.
1441
+ StyleGuide: '#chefmodernizesimplifyaptppasetup'
1212
1442
  Enabled: true
1213
1443
  VersionAdded: '5.21.0'
1214
1444
  Exclude:
@@ -1218,6 +1448,7 @@ ChefModernize/SimplifyAptPpaSetup:
1218
1448
 
1219
1449
  ChefModernize/UseRequireRelative:
1220
1450
  Description: Instead of using require with a File.expand_path and __FILE__ use the simpler require_relative method.
1451
+ StyleGuide: '#chefmodernizeuserequirerelative'
1221
1452
  Enabled: true
1222
1453
  VersionAdded: '5.22.0'
1223
1454
  Exclude:
@@ -1227,6 +1458,7 @@ ChefModernize/UseRequireRelative:
1227
1458
 
1228
1459
  ChefModernize/NodeInitPackage:
1229
1460
  Description: Use node['init_package'] to check for systemd instead of reading the contents of '/proc/1/comm'
1461
+ StyleGuide: '#chefmodernizenodeinitpackage'
1230
1462
  Enabled: true
1231
1463
  VersionAdded: '5.22.0'
1232
1464
  Exclude:
@@ -1235,6 +1467,7 @@ ChefModernize/NodeInitPackage:
1235
1467
 
1236
1468
  ChefModernize/WindowsRegistryUAC:
1237
1469
  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.
1470
+ StyleGuide: '#chefmodernizewindowsregistryuac'
1238
1471
  Enabled: true
1239
1472
  VersionAdded: '5.22.0'
1240
1473
  Exclude:
@@ -1244,6 +1477,7 @@ ChefModernize/WindowsRegistryUAC:
1244
1477
 
1245
1478
  ChefModernize/UseMultipackageInstalls:
1246
1479
  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.
1480
+ StyleGuide: '#chefmodernizeusemultipackageinstalls'
1247
1481
  Enabled: true
1248
1482
  VersionAdded: '6.0.0'
1249
1483
  Exclude:
@@ -1253,6 +1487,7 @@ ChefModernize/UseMultipackageInstalls:
1253
1487
 
1254
1488
  ChefModernize/ProvidesFromInitialize:
1255
1489
  Description: Provides should be set using the `provides` resource DSL method instead of instead of setting @provides in the initialize method.
1490
+ StyleGuide: '#chefmodernizeprovidesfrominitialize'
1256
1491
  Enabled: true
1257
1492
  VersionAdded: '6.0.0'
1258
1493
  Include:
@@ -1262,6 +1497,7 @@ ChefModernize/ProvidesFromInitialize:
1262
1497
 
1263
1498
  ChefModernize/DatabagHelpers:
1264
1499
  Description: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`.
1500
+ StyleGuide: '#chefmodernizedatabaghelpers'
1265
1501
  Enabled: true
1266
1502
  VersionAdded: '6.0.0'
1267
1503
  Exclude:
@@ -1270,18 +1506,42 @@ ChefModernize/DatabagHelpers:
1270
1506
 
1271
1507
  ChefModernize/NodeRolesInclude:
1272
1508
  Description: Use `node.role?('foo')` to check if a node includes a role instead of `node['roles'].include?('foo')`.
1509
+ StyleGuide: '#chefmodernizenoderolesinclude'
1273
1510
  Enabled: true
1274
1511
  VersionAdded: '6.1.0'
1275
1512
  Exclude:
1276
1513
  - '**/metadata.rb'
1277
1514
  - '**/Berksfile'
1278
1515
 
1516
+ ChefModernize/RespondToCompileTime:
1517
+ 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.
1518
+ StyleGuide: '#chefmodernizeresondtocompiletime'
1519
+ Enabled: true
1520
+ VersionAdded: '6.3.0'
1521
+ Exclude:
1522
+ - '**/metadata.rb'
1523
+ - '**/Berksfile'
1524
+
1525
+ ChefModernize/ShellOutHelper:
1526
+ Description: Use the built-in shell_out helper available in Chef Infra Client 12.11+ instead of calling Mixlib::ShellOut.new('foo').run_command.
1527
+ StyleGuide: '#chefmodernizeshellouthelper'
1528
+ Enabled: true
1529
+ VersionAdded: '6.5.0'
1530
+ Exclude:
1531
+ - '**/metadata.rb'
1532
+ - '**/Berksfile'
1533
+ - '**/libraries/*.rb'
1534
+
1279
1535
  ###############################
1280
1536
  # ChefRedundantCode: Cleanup unnecessary code in your cookbooks regardless of Chef Infra Client release
1281
1537
  ###############################
1282
1538
 
1539
+ ChefRedundantCode:
1540
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefredundantcode.md
1541
+
1283
1542
  ChefRedundantCode/ConflictsMetadata:
1284
1543
  Description: Don't use the deprecated 'conflicts' metadata value
1544
+ StyleGuide: '#chefredundantcodeconflictsmetadata'
1285
1545
  Enabled: true
1286
1546
  VersionAdded: '5.1.0'
1287
1547
  VersionChanged: '5.15.0'
@@ -1290,6 +1550,7 @@ ChefRedundantCode/ConflictsMetadata:
1290
1550
 
1291
1551
  ChefRedundantCode/SuggestsMetadata:
1292
1552
  Description: The suggests metadata.rb method is not used and is unnecessary in cookbooks.
1553
+ StyleGuide: '#chefredundantcodesuggestsmetadata'
1293
1554
  Enabled: true
1294
1555
  VersionAdded: '5.1.0'
1295
1556
  VersionChanged: '5.15.0'
@@ -1298,6 +1559,7 @@ ChefRedundantCode/SuggestsMetadata:
1298
1559
 
1299
1560
  ChefRedundantCode/ProvidesMetadata:
1300
1561
  Description: The provides metadata.rb method is not used and is unnecessary in cookbooks.
1562
+ StyleGuide: '#chefredundantcodeprovidesmetadata'
1301
1563
  Enabled: true
1302
1564
  VersionAdded: '5.1.0'
1303
1565
  VersionChanged: '5.15.0'
@@ -1306,6 +1568,7 @@ ChefRedundantCode/ProvidesMetadata:
1306
1568
 
1307
1569
  ChefRedundantCode/ReplacesMetadata:
1308
1570
  Description: The replaces metadata.rb method is not used and is unnecessary in cookbooks.
1571
+ StyleGuide: '#chefredundantcodereplacesmetadata'
1309
1572
  Enabled: true
1310
1573
  VersionAdded: '5.1.0'
1311
1574
  VersionChanged: '5.15.0'
@@ -1314,6 +1577,7 @@ ChefRedundantCode/ReplacesMetadata:
1314
1577
 
1315
1578
  ChefRedundantCode/AttributeMetadata:
1316
1579
  Description: The attribute metadata.rb method is not used and is unnecessary in cookbooks.
1580
+ StyleGuide: '#chefredundantcodeattributemetadata'
1317
1581
  Enabled: true
1318
1582
  VersionAdded: '5.1.0'
1319
1583
  VersionChanged: '5.15.0'
@@ -1322,6 +1586,7 @@ ChefRedundantCode/AttributeMetadata:
1322
1586
 
1323
1587
  ChefRedundantCode/LongDescriptionMetadata:
1324
1588
  Description: The long_description metadata.rb method is not used and is unnecessary in cookbooks
1589
+ StyleGuide: '#chefredundantcodelongdescriptionmetadata'
1325
1590
  Enabled: true
1326
1591
  VersionAdded: '5.2.0'
1327
1592
  VersionChanged: '5.15.0'
@@ -1330,6 +1595,7 @@ ChefRedundantCode/LongDescriptionMetadata:
1330
1595
 
1331
1596
  ChefRedundantCode/RecipeMetadata:
1332
1597
  Description: The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the README.md file instead.
1598
+ StyleGuide: '#chefredundantcoderecipemetadata'
1333
1599
  Enabled: true
1334
1600
  VersionAdded: '5.6.0'
1335
1601
  VersionChanged: '5.15.0'
@@ -1338,6 +1604,7 @@ ChefRedundantCode/RecipeMetadata:
1338
1604
 
1339
1605
  ChefRedundantCode/ResourceWithNothingAction:
1340
1606
  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.
1607
+ StyleGuide: '#chefredundantcoderesourcewithnothingaction'
1341
1608
  Enabled: true
1342
1609
  VersionAdded: '5.12.0'
1343
1610
  VersionChanged: '5.15.0'
@@ -1348,6 +1615,7 @@ ChefRedundantCode/ResourceWithNothingAction:
1348
1615
 
1349
1616
  ChefRedundantCode/UnnecessaryNameProperty:
1350
1617
  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.
1618
+ StyleGuide: '#chefredundantcodeunnecessarynameproperty'
1351
1619
  Enabled: true
1352
1620
  VersionAdded: '5.8.0'
1353
1621
  VersionChanged: '5.15.0'
@@ -1357,6 +1625,7 @@ ChefRedundantCode/UnnecessaryNameProperty:
1357
1625
 
1358
1626
  ChefRedundantCode/PropertyWithRequiredAndDefault:
1359
1627
  Description: Resource property should not be both required and have a default value
1628
+ StyleGuide: '#chefredundantcodepropertywithrequiredanddefault'
1360
1629
  Enabled: true
1361
1630
  VersionAdded: '5.1.0'
1362
1631
  VersionChanged: '5.15.0'
@@ -1366,6 +1635,7 @@ ChefRedundantCode/PropertyWithRequiredAndDefault:
1366
1635
 
1367
1636
  ChefRedundantCode/NamePropertyIsRequired:
1368
1637
  Description: Resource properties marked as name properties should not also be required properties
1638
+ StyleGuide: '#chefredundantcodenamepropertyisrequired'
1369
1639
  Enabled: true
1370
1640
  VersionAdded: '5.1.0'
1371
1641
  VersionChanged: '5.15.0'
@@ -1375,6 +1645,7 @@ ChefRedundantCode/NamePropertyIsRequired:
1375
1645
 
1376
1646
  ChefRedundantCode/CustomResourceWithAllowedActions:
1377
1647
  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.
1648
+ StyleGuide: '#chefredundantcodecustomresourcewithallowedactions'
1378
1649
  Enabled: true
1379
1650
  VersionAdded: '5.2.0'
1380
1651
  VersionChanged: '5.15.0'
@@ -1383,6 +1654,7 @@ ChefRedundantCode/CustomResourceWithAllowedActions:
1383
1654
 
1384
1655
  ChefRedundantCode/SensitivePropertyInResource:
1385
1656
  Description: Every Chef Infra resources already include a sensitive property with a default value of false.
1657
+ StyleGuide: '#chefredundantcodesensitivepropertyinresource'
1386
1658
  Enabled: true
1387
1659
  VersionAdded: '5.16.0'
1388
1660
  Include:
@@ -1391,6 +1663,7 @@ ChefRedundantCode/SensitivePropertyInResource:
1391
1663
 
1392
1664
  ChefRedundantCode/UnnecessaryDesiredState:
1393
1665
  Description: 'There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.'
1666
+ StyleGuide: '#chefredundantcodeunnecessarydesiredstate'
1394
1667
  Enabled: true
1395
1668
  VersionAdded: '5.16.0'
1396
1669
  Include:
@@ -1399,6 +1672,7 @@ ChefRedundantCode/UnnecessaryDesiredState:
1399
1672
 
1400
1673
  ChefRedundantCode/AptRepositoryNotifiesAptUpdate:
1401
1674
  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.
1675
+ StyleGuide: '#chefredundantcodeaptrepositorynotifiesaptupdate'
1402
1676
  Enabled: true
1403
1677
  VersionAdded: '5.17.0'
1404
1678
  Exclude:
@@ -1408,6 +1682,7 @@ ChefRedundantCode/AptRepositoryNotifiesAptUpdate:
1408
1682
 
1409
1683
  ChefRedundantCode/AptRepositoryDistributionDefault:
1410
1684
  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.
1685
+ StyleGuide: '#chefredundantcodeaptrepositorydistributiondefault'
1411
1686
  Enabled: true
1412
1687
  VersionAdded: '5.17.0'
1413
1688
  Exclude:
@@ -1417,6 +1692,7 @@ ChefRedundantCode/AptRepositoryDistributionDefault:
1417
1692
 
1418
1693
  ChefRedundantCode/GroupingMetadata:
1419
1694
  Description: The grouping metadata.rb method is not used and is unnecessary in cookbooks.
1695
+ StyleGuide: '#chefredundantcodegroupingmetadata'
1420
1696
  Enabled: true
1421
1697
  VersionAdded: '5.19.0'
1422
1698
  Include:
@@ -1424,6 +1700,7 @@ ChefRedundantCode/GroupingMetadata:
1424
1700
 
1425
1701
  ChefRedundantCode/StringPropertyWithNilDefault:
1426
1702
  Description: Properties have a nil value by default so there is no need to set the default value to nil.
1703
+ StyleGuide: '#chefredundantcodestringpropertywithnildefault'
1427
1704
  Enabled: true
1428
1705
  VersionAdded: '5.21.0'
1429
1706
  Include:
@@ -1432,6 +1709,7 @@ ChefRedundantCode/StringPropertyWithNilDefault:
1432
1709
 
1433
1710
  ChefRedundantCode/PropertySplatRegex:
1434
1711
  Description: There is no need to validate the input of properties in resources using a regex value that will always pass.
1712
+ StyleGuide: '#chefredundantcodepropertysplatregex'
1435
1713
  Enabled: true
1436
1714
  VersionAdded: '5.21.0'
1437
1715
  Include:
@@ -1440,6 +1718,7 @@ ChefRedundantCode/PropertySplatRegex:
1440
1718
 
1441
1719
  ChefRedundantCode/UseCreateIfMissing:
1442
1720
  Description: Use the :create_if_missing action instead of not_if with a ::File.exist(FOO) check.
1721
+ StyleGuide: '#chefredundantcodeusecreateifmissing'
1443
1722
  Enabled: true
1444
1723
  VersionAdded: '6.2.0'
1445
1724
  Exclude:
@@ -1448,11 +1727,15 @@ ChefRedundantCode/UseCreateIfMissing:
1448
1727
  - '**/Berksfile'
1449
1728
 
1450
1729
  ###############################
1451
- # Migrating to new patterns
1730
+ # ChefEffortless: Migrating to new patterns
1452
1731
  ###############################
1453
1732
 
1733
+ ChefEffortless:
1734
+ StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chefeffortless.md
1735
+
1454
1736
  ChefEffortless/CookbookUsesSearch:
1455
1737
  Description: Cookbook uses search, which cannot be used in the Effortless Infra pattern
1738
+ StyleGuide: '#chefeffortlesscookbookusessearch'
1456
1739
  Enabled: false
1457
1740
  VersionAdded: '5.1.0'
1458
1741
  Exclude:
@@ -1461,6 +1744,7 @@ ChefEffortless/CookbookUsesSearch:
1461
1744
 
1462
1745
  ChefEffortless/CookbookUsesDatabags:
1463
1746
  Description: Cookbook uses data bags, which cannot be used in the Effortless Infra pattern
1747
+ StyleGuide: '#chefeffortlesscookbookusesdatabags'
1464
1748
  Enabled: false
1465
1749
  VersionAdded: '5.1.0'
1466
1750
  Exclude:
@@ -1469,6 +1753,7 @@ ChefEffortless/CookbookUsesDatabags:
1469
1753
 
1470
1754
  ChefEffortless/CookbookUsesEnvironmments:
1471
1755
  Description: Cookbook uses environments, which cannot be used in the Effortless Infra pattern
1756
+ StyleGuide: '#chefeffortlesscookbookusesenvironments'
1472
1757
  Enabled: false
1473
1758
  VersionAdded: '5.10.0'
1474
1759
  Exclude:
@@ -1477,6 +1762,7 @@ ChefEffortless/CookbookUsesEnvironmments:
1477
1762
 
1478
1763
  ChefEffortless/CookbookUsesPolicygroups:
1479
1764
  Description: Cookbook uses Policy Groups, which cannot be used in the Effortless Infra pattern
1765
+ StyleGuide: '#chefeffortlesscookbookusespolicygroups'
1480
1766
  Enabled: false
1481
1767
  VersionAdded: '5.10.0'
1482
1768
  Exclude:
@@ -1485,6 +1771,7 @@ ChefEffortless/CookbookUsesPolicygroups:
1485
1771
 
1486
1772
  ChefEffortless/CookbookUsesRoles:
1487
1773
  Description: Cookbook uses Roles, which cannot be used in the Effortless Infra pattern
1774
+ StyleGuide: '#chefeffortlesscookbookusesroles'
1488
1775
  Enabled: false
1489
1776
  VersionAdded: '5.10.0'
1490
1777
  Exclude:
@@ -1493,6 +1780,7 @@ ChefEffortless/CookbookUsesRoles:
1493
1780
 
1494
1781
  ChefEffortless/SearchForEnvironmentsOrRoles:
1495
1782
  Description: Cookbook uses search with a node query that looks for a role or environment
1783
+ StyleGuide: '#chefeffortlesssearchforenvironmentsorroles'
1496
1784
  Enabled: false
1497
1785
  VersionAdded: '5.11.0'
1498
1786
  Exclude:
@@ -1501,6 +1789,7 @@ ChefEffortless/SearchForEnvironmentsOrRoles:
1501
1789
 
1502
1790
  ChefEffortless/Berksfile:
1503
1791
  Description: Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.
1792
+ StyleGuide: '#chefeffortlessberksfile'
1504
1793
  Enabled: false
1505
1794
  VersionAdded: '5.12.0'
1506
1795
  Include:
@@ -1510,8 +1799,6 @@ ChefEffortless/Berksfile:
1510
1799
 
1511
1800
  Layout/AccessModifierIndentation:
1512
1801
  Enabled: true
1513
- Naming/AccessorMethodName:
1514
- Enabled: true
1515
1802
  Layout/AlignArray:
1516
1803
  Enabled: true
1517
1804
  Layout/AlignHash:
@@ -1768,7 +2055,7 @@ Style/StructInheritance:
1768
2055
  Enabled: true
1769
2056
  Style/SymbolLiteral:
1770
2057
  Enabled: true
1771
- Layout/Tab:
2058
+ Layout/IndentationStyle:
1772
2059
  Enabled: true
1773
2060
  Layout/TrailingBlankLines:
1774
2061
  Enabled: true
@@ -2165,3 +2452,7 @@ Style/MultilineWhenThen:
2165
2452
  # .each_key is a lot more clear that .keys.each
2166
2453
  Style/HashEachMethods:
2167
2454
  Enabled: true
2455
+
2456
+ # We want to catch this deprecation in cookbooks
2457
+ Lint/DeprecatedOpenSSLConstant:
2458
+ Enabled: true