cookstyle 5.15.7 → 5.16.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/config/cookstyle.yml +172 -4
  3. data/lib/cookstyle.rb +6 -0
  4. data/lib/cookstyle/version.rb +1 -1
  5. data/lib/rubocop/chef/cookbook_helpers.rb +12 -4
  6. data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +50 -0
  7. data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +53 -0
  8. data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +67 -0
  9. data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +11 -3
  10. data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +6 -3
  11. data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +4 -0
  12. data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +56 -0
  13. data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +11 -3
  14. data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +18 -22
  15. data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +64 -0
  16. data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +5 -2
  17. data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +4 -0
  18. data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +4 -0
  19. data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +4 -0
  20. data/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +66 -0
  21. data/lib/rubocop/cop/chef/modernize/execute_sleep.rb +77 -0
  22. data/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +3 -0
  23. data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +51 -0
  24. data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +4 -0
  25. data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +4 -0
  26. data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +4 -0
  27. data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +4 -0
  28. data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +3 -0
  29. data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +3 -0
  30. data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +3 -0
  31. data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +3 -0
  32. data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +13 -15
  33. data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +4 -0
  34. data/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +49 -0
  35. data/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +4 -0
  36. data/lib/rubocop/cop/chef/modernize/systctl_param_resource.rb +4 -2
  37. data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +4 -0
  38. data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +1 -2
  39. data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +4 -0
  40. data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +3 -0
  41. data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +4 -0
  42. data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +1 -1
  43. data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +0 -1
  44. data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +48 -0
  45. data/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +57 -0
  46. data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +10 -7
  47. data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +59 -0
  48. data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +55 -0
  49. data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +90 -0
  50. data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +21 -5
  51. data/lib/rubocop/cop/target_chef_version.rb +18 -0
  52. data/lib/rubocop/monkey_patches/commissioner.rb +26 -0
  53. data/lib/rubocop/monkey_patches/config.rb +15 -0
  54. data/lib/rubocop/monkey_patches/cop.rb +10 -0
  55. metadata +20 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 394f526dcec8c22ebd9db30e8c32686fe508cf388d3903769157428c49690c6d
4
- data.tar.gz: abba87a8fea82ef987ca27c3631fa25bc925c55ac7f59b6d07735123092d279a
3
+ metadata.gz: 66d82d484b05b0d3488692059365bd5528ab3520c1115b5141d67193ce20f348
4
+ data.tar.gz: 2134a1885a0d40337f1a7e5a130afd3b983ffc1896bbf71a2033a0a746e6314e
5
5
  SHA512:
6
- metadata.gz: '08e6f1c8d8563494ab21c7d69021c4955d4b2ed2af6cb6e59394510fc07eff5eabf23b6a1575afcb8994d1dfbe11446a26a456395a8d7ce1392cf1c10074d548'
7
- data.tar.gz: '09eecb0aebc0837b48e72741f805ac13fd4bb2b64e53d0d762053dfb6d6763f3c53ef81c6fc647c2909bf76351fad15d28264484ea0c8d81494c4482a1476976'
6
+ metadata.gz: 2b02f462850e5089721ee7492c43e95c97812332ec3c38e255e5aab9a1be8adc7639518a6330096ffc98fc51215273e71aef3a8d6990832ab74b65c33056afcd
7
+ data.tar.gz: 954bc031f06e5a5d0283e7fb6191306cf61be83b504652c7ad9240ab508a1485ad6cfeb70ec579167d86de750b3bced18bd01c1f133956756ac95c9a64771c7c
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 2.4
3
+ TargetChefVersion: ~
3
4
  Exclude:
4
5
  - files/**/*
5
6
  - vendor/**/*
@@ -55,21 +56,26 @@ ChefStyle/CommentFormat:
55
56
  Description: Use Chef's unique format for comment headers
56
57
  Enabled: true
57
58
  VersionAdded: '5.0.0'
59
+ Exclude:
60
+ - '**/Berksfile'
58
61
 
59
62
  ChefStyle/FileMode:
60
63
  Description: Use strings to represent file modes in Chef resources
61
64
  Enabled: true
62
65
  VersionAdded: '5.0.0'
63
66
  Exclude:
67
+ - '**/attributes/*'
64
68
  - '**/metadata.rb'
69
+ - '**/Berksfile'
65
70
 
66
71
  ChefStyle/UsePlatformHelpers:
67
- Description: Use platform? and platform_family? helpers for checking node platform in resources and recipes
72
+ Description: Use platform? and platform_family? helpers to check node platform in resources and recipes
68
73
  Enabled: true
69
74
  VersionAdded: '5.6.0'
70
75
  Exclude:
71
76
  - '**/metadata.rb'
72
77
  - '**/libraries/*'
78
+ - '**/Berksfile'
73
79
 
74
80
  ChefStyle/SimplifyPlatformMajorVersionCheck:
75
81
  Description: Use node['platform_version'].to_i instead of node['platform_version'].split('.').first or node['platform_version'].split('.')[0]
@@ -77,12 +83,38 @@ ChefStyle/SimplifyPlatformMajorVersionCheck:
77
83
  VersionAdded: '5.8.0'
78
84
  Exclude:
79
85
  - '**/metadata.rb'
86
+ - '**/Berksfile'
80
87
 
81
88
  ChefStyle/DefaultCopyrightComments:
82
89
  Description: Cookbook copyright comment headers should be updated for a real person or organization.
83
90
  Enabled: true
84
91
  VersionAdded: '5.12.0'
85
92
 
93
+ ChefStyle/UnnecessaryPlatformCaseStatement:
94
+ Description: Use the platform?() and platform_family?() helpers instead of a case statement that only includes a single when statement.
95
+ Enabled: true
96
+ VersionAdded: '5.16.0'
97
+ Exclude:
98
+ - '**/metadata.rb'
99
+ - '**/Berksfile'
100
+
101
+ ChefStyle/ImmediateNotificationTiming:
102
+ Description: Use :immediately instead of :immediate for resource notification timing.
103
+ Enabled: true
104
+ VersionAdded: '5.16.0'
105
+ Exclude:
106
+ - '**/attributes/*.rb'
107
+ - '**/metadata.rb'
108
+ - '**/Berksfile'
109
+
110
+ ChefStyle/TrueClassFalseClassResourceProperties:
111
+ 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.
112
+ Enabled: true
113
+ VersionAdded: '5.16.0'
114
+ Include:
115
+ - '**/libraries/*.rb'
116
+ - '**/resources/*.rb'
117
+
86
118
  ###############################
87
119
  # ChefCorrectness: Avoiding potential problems
88
120
  ###############################
@@ -92,7 +124,9 @@ ChefCorrectness/ServiceResource:
92
124
  Enabled: true
93
125
  VersionAdded: '5.0.0'
94
126
  Exclude:
127
+ - '**/attributes/*.rb'
95
128
  - '**/metadata.rb'
129
+ - '**/Berksfile'
96
130
 
97
131
  ChefCorrectness/NodeNormal:
98
132
  Description: Do not use the node.normal method
@@ -100,6 +134,7 @@ ChefCorrectness/NodeNormal:
100
134
  VersionAdded: '5.1.0'
101
135
  Exclude:
102
136
  - '**/metadata.rb'
137
+ - '**/Berksfile'
103
138
 
104
139
  ChefCorrectness/NodeNormalUnless:
105
140
  Description: Do not use the node.normal_unless method
@@ -107,6 +142,7 @@ ChefCorrectness/NodeNormalUnless:
107
142
  VersionAdded: '5.1.0'
108
143
  Exclude:
109
144
  - '**/metadata.rb'
145
+ - '**/Berksfile'
110
146
 
111
147
  ChefCorrectness/TmpPath:
112
148
  Description: Use file_cache_path rather than hard-coding tmp paths
@@ -114,6 +150,7 @@ ChefCorrectness/TmpPath:
114
150
  VersionAdded: '5.0.0'
115
151
  Exclude:
116
152
  - '**/metadata.rb'
153
+ - '**/Berksfile'
117
154
 
118
155
  ChefCorrectness/InvalidPlatformMetadata:
119
156
  Description: metadata.rb "supports" platform is invalid
@@ -128,6 +165,7 @@ ChefCorrectness/CookbookUsesNodeSave:
128
165
  VersionAdded: '5.5.0'
129
166
  Exclude:
130
167
  - '**/metadata.rb'
168
+ - '**/Berksfile'
131
169
 
132
170
  ChefCorrectness/CookbooksDependsOnSelf:
133
171
  Description: A cookbook cannot depend on itself
@@ -148,28 +186,36 @@ ChefCorrectness/BlockGuardWithOnlyString:
148
186
  Enabled: true
149
187
  VersionAdded: '5.2.0'
150
188
  Exclude:
189
+ - '**/attributes/*.rb'
151
190
  - '**/metadata.rb'
191
+ - '**/Berksfile'
152
192
 
153
193
  ChefCorrectness/ResourceSetsInternalProperties:
154
194
  Description: Do not set properties used internally by Chef Infra Client to track the system state.
155
195
  Enabled: true
156
196
  VersionAdded: '5.5.0'
157
197
  Exclude:
198
+ - '**/attributes/*.rb'
158
199
  - '**/metadata.rb'
200
+ - '**/Berksfile'
159
201
 
160
202
  ChefCorrectness/ResourceSetsNameProperty:
161
203
  Description: Resource sets the name property in the resource instead of using a name_property.
162
204
  Enabled: true
163
205
  VersionAdded: '5.5.0'
164
206
  Exclude:
207
+ - '**/attributes/*.rb'
165
208
  - '**/metadata.rb'
209
+ - '**/Berksfile'
166
210
 
167
211
  ChefCorrectness/ResourceWithNoneAction:
168
212
  Description: Resource uses the nonexistent :none action instead of the :nothing action
169
213
  Enabled: true
170
214
  VersionAdded: '5.5.0'
171
215
  Exclude:
216
+ - '**/attributes/*.rb'
172
217
  - '**/metadata.rb'
218
+ - '**/Berksfile'
173
219
 
174
220
  ChefCorrectness/InvalidVersionMetadata:
175
221
  Description: Cookbook metadata.rb version field should follow X.Y.Z version format.
@@ -179,11 +225,13 @@ ChefCorrectness/InvalidVersionMetadata:
179
225
  - '**/metadata.rb'
180
226
 
181
227
  ChefCorrectness/NotifiesActionNotSymbol:
182
- Description: When notifying 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.
228
+ 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.
183
229
  Enabled: true
184
230
  VersionAdded: '5.10.0'
185
231
  Exclude:
232
+ - '**/attributes/*.rb'
186
233
  - '**/metadata.rb'
234
+ - '**/Berksfile'
187
235
 
188
236
  ChefCorrectness/IncorrectLibraryInjection:
189
237
  Description: Libraries should be injected into the Chef::DSL::Recipe or Chef::DSL::Resource classes and not Recipe/Resource/Provider classes directly.
@@ -198,6 +246,7 @@ ChefCorrectness/InvalidPlatformHelper:
198
246
  VersionAdded: '5.15.0'
199
247
  Exclude:
200
248
  - '**/metadata.rb'
249
+ - '**/Berksfile'
201
250
 
202
251
  ChefCorrectness/InvalidPlatformFamilyHelper:
203
252
  Description: Pass valid platform families to the platform_family? helper.
@@ -205,13 +254,16 @@ ChefCorrectness/InvalidPlatformFamilyHelper:
205
254
  VersionAdded: '5.15.0'
206
255
  Exclude:
207
256
  - '**/metadata.rb'
257
+ - '**/Berksfile'
208
258
 
209
259
  ChefCorrectness/ScopedFileExist:
210
260
  Description: Scope file exist to access the correct File class by using ::File.exist? not File.exist?.
211
261
  Enabled: true
212
262
  VersionAdded: '5.15.0'
213
263
  Exclude:
264
+ - '**/attributes/*.rb'
214
265
  - '**/metadata.rb'
266
+ - '**/Berksfile'
215
267
 
216
268
  ChefCorrectness/InvalidPlatformValueForPlatformFamilyHelper:
217
269
  Description: Pass valid platforms families to the value_for_platform_family helper.
@@ -219,6 +271,7 @@ ChefCorrectness/InvalidPlatformValueForPlatformFamilyHelper:
219
271
  VersionAdded: '5.15.0'
220
272
  Exclude:
221
273
  - '**/metadata.rb'
274
+ - '**/Berksfile'
222
275
 
223
276
  ChefCorrectness/InvalidPlatformValueForPlatformHelper:
224
277
  Description: Pass valid platforms to the value_for_platform helper.
@@ -226,6 +279,33 @@ ChefCorrectness/InvalidPlatformValueForPlatformHelper:
226
279
  VersionAdded: '5.15.0'
227
280
  Exclude:
228
281
  - '**/metadata.rb'
282
+ - '**/Berksfile'
283
+
284
+ ChefCorrectness/InvalidNotificationTiming:
285
+ Description: Valid notification timings are :immediately, :immediate (alias for :immediately), :delayed, and :before.
286
+ Enabled: true
287
+ VersionAdded: '5.16.0'
288
+ Exclude:
289
+ - '**/attributes/*.rb'
290
+ - '**/metadata.rb'
291
+ - '**/Berksfile'
292
+
293
+ ChefCorrectness/MalformedPlatformValueForPlatformHelper:
294
+ 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'.
295
+ Enabled: true
296
+ VersionAdded: '5.16.0'
297
+ Exclude:
298
+ - '**/metadata.rb'
299
+ - '**/Berksfile'
300
+
301
+ ChefCorrectness/DnfPackageAllowDowngrades:
302
+ Description: dnf_package does not support the allow_downgrades property
303
+ Enabled: true
304
+ VersionAdded: '5.16.0'
305
+ Exclude:
306
+ - '**/attributes/*.rb'
307
+ - '**/metadata.rb'
308
+ - '**/Berksfile'
229
309
 
230
310
  ###############################
231
311
  # ChefSharing: Issues that prevent sharing code with other teams or with the Chef community in general
@@ -273,6 +353,7 @@ ChefDeprecations/NodeDeepFetch:
273
353
  VersionAdded: '5.12.0'
274
354
  Exclude:
275
355
  - '**/metadata.rb'
356
+ - '**/Berksfile'
276
357
 
277
358
  ChefDeprecations/NodeSet:
278
359
  Description: Do not use the deprecated node.set method
@@ -280,6 +361,7 @@ ChefDeprecations/NodeSet:
280
361
  VersionAdded: '5.0.0'
281
362
  Exclude:
282
363
  - '**/metadata.rb'
364
+ - '**/Berksfile'
283
365
 
284
366
  ChefDeprecations/NodeSetUnless:
285
367
  Description: Do not use the deprecated node.set_unless method
@@ -287,13 +369,16 @@ ChefDeprecations/NodeSetUnless:
287
369
  VersionAdded: '5.1.0'
288
370
  Exclude:
289
371
  - '**/metadata.rb'
372
+ - '**/Berksfile'
290
373
 
291
374
  ChefDeprecations/EpicFail:
292
375
  Description: Use ignore_failure method instead of the deprecated epic_fail method
293
376
  Enabled: true
294
377
  VersionAdded: '5.1.0'
295
378
  Exclude:
379
+ - '**/attributes/*.rb'
296
380
  - '**/metadata.rb'
381
+ - '**/Berksfile'
297
382
 
298
383
  ChefDeprecations/CookbookDependsOnPoise:
299
384
  Description: Cookbooks should not depend on the deprecated Poise framework
@@ -321,21 +406,27 @@ ChefDeprecations/EasyInstallResource:
321
406
  Enabled: true
322
407
  VersionAdded: '5.1.0'
323
408
  Exclude:
409
+ - '**/attributes/*.rb'
324
410
  - '**/metadata.rb'
411
+ - '**/Berksfile'
325
412
 
326
413
  ChefDeprecations/ErlCallResource:
327
414
  Description: Don't use the deprecated erl_call resource removed in Chef 13
328
415
  Enabled: true
329
416
  VersionAdded: '5.1.0'
330
417
  Exclude:
418
+ - '**/attributes/*.rb'
331
419
  - '**/metadata.rb'
420
+ - '**/Berksfile'
332
421
 
333
422
  ChefDeprecations/RequireRecipe:
334
423
  Description: Use include_recipe instead of the require_recipe method
335
424
  Enabled: true
336
425
  VersionAdded: '5.2.0'
337
426
  Exclude:
427
+ - '**/attributes/*.rb'
338
428
  - '**/metadata.rb'
429
+ - '**/Berksfile'
339
430
 
340
431
  ChefDeprecations/NodeMethodsInsteadofAttributes:
341
432
  Description: Use node attributes to access Ohai data instead of node methods, which were deprecated in Chef Infra Client 13.
@@ -343,6 +434,7 @@ ChefDeprecations/NodeMethodsInsteadofAttributes:
343
434
  VersionAdded: '5.4.0'
344
435
  Exclude:
345
436
  - '**/metadata.rb'
437
+ - '**/Berksfile'
346
438
 
347
439
  ChefDeprecations/UsesDeprecatedMixins:
348
440
  Description: Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later.
@@ -358,7 +450,9 @@ ChefDeprecations/IncludingXMLRubyRecipe:
358
450
  Enabled: true
359
451
  VersionAdded: '5.4.0'
360
452
  Exclude:
453
+ - '**/attributes/*.rb'
361
454
  - '**/metadata.rb'
455
+ - '**/Berksfile'
362
456
 
363
457
  ChefDeprecations/LegacyYumCookbookRecipes:
364
458
  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).
@@ -458,7 +552,6 @@ ChefDeprecations/NamePropertyWithDefaultValue:
458
552
  VersionAdded: '5.7.0'
459
553
  Include:
460
554
  - '**/libraries/*.rb'
461
- - '**/providers/*.rb'
462
555
  - '**/resources/*.rb'
463
556
 
464
557
  ChefDeprecations/ResourceUsesProviderBaseMethod:
@@ -582,6 +675,24 @@ ChefDeprecations/ChefRewind:
582
675
  - '**/metadata.rb'
583
676
  - '**/attributes/*.rb'
584
677
 
678
+ ChefDeprecations/RubyBlockCreateAction:
679
+ Description: Use the :run action in the ruby_block resource instead of the deprecated :create action
680
+ Enabled: true
681
+ VersionAdded: '5.16.0'
682
+ Exclude:
683
+ - '**/metadata.rb'
684
+ - '**/attributes/*.rb'
685
+ - '**/Berksfile'
686
+
687
+ ChefDeprecations/DeprecatedPlatformMethods:
688
+ Description: Use provider_for_action instead of the deprecated Chef::Platform methods in resources.
689
+ Enabled: true
690
+ VersionAdded: '5.16.0'
691
+ Include:
692
+ - '**/libraries/*.rb'
693
+ - '**/resources/*.rb'
694
+ - '**/providers/*.rb'
695
+
585
696
  ###############################
586
697
  # ChefModernize: Cleaning up legacy code and using new built-in resources
587
698
  ###############################
@@ -901,6 +1012,7 @@ ChefModernize/IncludingOhaiDefaultRecipe:
901
1012
  VersionChanged: '5.15.0'
902
1013
  Exclude:
903
1014
  - '**/metadata.rb'
1015
+ - '**/Berksfile'
904
1016
 
905
1017
  ChefModernize/AllowedActionsFromInitialize:
906
1018
  Description: The allowed actions of a resource can be set with the "allowed_actions" helper instead of using the initialize method.
@@ -910,6 +1022,40 @@ ChefModernize/AllowedActionsFromInitialize:
910
1022
  - '**/resources/*.rb'
911
1023
  - '**/libraries/*.rb'
912
1024
 
1025
+ ChefModernize/FoodcriticComments:
1026
+ 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.
1027
+ Enabled: false
1028
+ VersionAdded: '5.16.0'
1029
+ Exclude:
1030
+ - '**/Berksfile'
1031
+
1032
+ ChefModernize/ExecuteScExe:
1033
+ 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
1034
+ Enabled: false
1035
+ VersionAdded: '5.16.0'
1036
+ Exclude:
1037
+ - '**/metadata.rb'
1038
+ - '**/attributes/*.rb'
1039
+ - '**/Berksfile'
1040
+
1041
+ ChefModernize/WindowsScResource:
1042
+ 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.
1043
+ Enabled: false
1044
+ VersionAdded: '5.16.0'
1045
+ Exclude:
1046
+ - '**/metadata.rb'
1047
+ - '**/attributes/*.rb'
1048
+ - '**/Berksfile'
1049
+
1050
+ ChefModernize/ExecuteSleep:
1051
+ 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.
1052
+ Enabled: false
1053
+ VersionAdded: '5.16.0'
1054
+ Exclude:
1055
+ - '**/metadata.rb'
1056
+ - '**/attributes/*.rb'
1057
+ - '**/Berksfile'
1058
+
913
1059
  ###############################
914
1060
  # ChefRedundantCode: Cleanup unncessary code in your cookbooks regardless of chef-client release
915
1061
  ###############################
@@ -1007,7 +1153,7 @@ ChefRedundantCode/NamePropertyIsRequired:
1007
1153
  - '**/resources/*.rb'
1008
1154
  - '**/libraries/*.rb'
1009
1155
 
1010
- ChefRedundant/CustomResourceWithAllowedActions:
1156
+ ChefRedundantCode/CustomResourceWithAllowedActions:
1011
1157
  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.
1012
1158
  Enabled: true
1013
1159
  VersionAdded: '5.2.0'
@@ -1015,6 +1161,22 @@ ChefRedundant/CustomResourceWithAllowedActions:
1015
1161
  Include:
1016
1162
  - '**/resources/*.rb'
1017
1163
 
1164
+ ChefRedundantCode/SensitivePropertyInResource:
1165
+ Description: Every Chef Infra resources already include a sensitive property with a default value of false.
1166
+ Enabled: true
1167
+ VersionAdded: '5.16.0'
1168
+ Include:
1169
+ - '**/resources/*.rb'
1170
+ - '**/libraries/*.rb'
1171
+
1172
+ ChefRedundantCode/UnnecessaryDesiredState:
1173
+ Description: 'There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.'
1174
+ Enabled: true
1175
+ VersionAdded: '5.16.0'
1176
+ Include:
1177
+ - '**/resources/*.rb'
1178
+ - '**/libraries/*.rb'
1179
+
1018
1180
  ###############################
1019
1181
  # Migrating to new patterns
1020
1182
  ###############################
@@ -1025,6 +1187,7 @@ ChefEffortless/CookbookUsesSearch:
1025
1187
  VersionAdded: '5.1.0'
1026
1188
  Exclude:
1027
1189
  - '**/metadata.rb'
1190
+ - '**/Berksfile'
1028
1191
 
1029
1192
  ChefEffortless/CookbookUsesDatabags:
1030
1193
  Description: Cookbook uses data bags, which cannot be used in the Effortless Infra pattern
@@ -1032,6 +1195,7 @@ ChefEffortless/CookbookUsesDatabags:
1032
1195
  VersionAdded: '5.1.0'
1033
1196
  Exclude:
1034
1197
  - '**/metadata.rb'
1198
+ - '**/Berksfile'
1035
1199
 
1036
1200
  ChefEffortless/CookbookUsesEnvironmments:
1037
1201
  Description: Cookbook uses environments, which cannot be used in the Effortless Infra pattern
@@ -1039,6 +1203,7 @@ ChefEffortless/CookbookUsesEnvironmments:
1039
1203
  VersionAdded: '5.10.0'
1040
1204
  Exclude:
1041
1205
  - '**/metadata.rb'
1206
+ - '**/Berksfile'
1042
1207
 
1043
1208
  ChefEffortless/CookbookUsesPolicygroups:
1044
1209
  Description: Cookbook uses Policy Groups, which cannot be used in the Effortless Infra pattern
@@ -1046,6 +1211,7 @@ ChefEffortless/CookbookUsesPolicygroups:
1046
1211
  VersionAdded: '5.10.0'
1047
1212
  Exclude:
1048
1213
  - '**/metadata.rb'
1214
+ - '**/Berksfile'
1049
1215
 
1050
1216
  ChefEffortless/CookbookUsesRoles:
1051
1217
  Description: Cookbook uses Roles, which cannot be used in the Effortless Infra pattern
@@ -1053,6 +1219,7 @@ ChefEffortless/CookbookUsesRoles:
1053
1219
  VersionAdded: '5.10.0'
1054
1220
  Exclude:
1055
1221
  - '**/metadata.rb'
1222
+ - '**/Berksfile'
1056
1223
 
1057
1224
  ChefEffortless/SearchForEnvironmentsOrRoles:
1058
1225
  Description: Cookbook uses search with a node query that looks for a role or environment
@@ -1060,6 +1227,7 @@ ChefEffortless/SearchForEnvironmentsOrRoles:
1060
1227
  VersionAdded: '5.11.0'
1061
1228
  Exclude:
1062
1229
  - '**/metadata.rb'
1230
+ - '**/Berksfile'
1063
1231
 
1064
1232
  ChefEffortless/Berksfile:
1065
1233
  Description: Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.