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