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