cookstyle 5.4.13 → 5.5.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/cookstyle.yml +231 -129
- data/lib/cookstyle.rb +1 -0
- data/lib/cookstyle/version.rb +1 -1
- data/lib/rubocop/chef/cookbook_helpers.rb +67 -0
- data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +34 -31
- data/lib/rubocop/cop/chef/correctness/cb_depends_on_self.rb +16 -14
- data/lib/rubocop/cop/chef/correctness/default_maintainer_metadata.rb +22 -20
- data/lib/rubocop/cop/chef/correctness/insecure_cookbook_url.rb +32 -30
- data/lib/rubocop/cop/chef/correctness/invalid_license_string.rb +454 -453
- data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +57 -57
- data/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +18 -16
- data/lib/rubocop/cop/chef/correctness/name_property_and_required.rb +61 -59
- data/lib/rubocop/cop/chef/correctness/node_normal.rb +29 -27
- data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +29 -27
- data/lib/rubocop/cop/chef/correctness/node_save.rb +46 -0
- data/lib/rubocop/cop/chef/correctness/ohai_default_recipe.rb +47 -0
- data/lib/rubocop/cop/chef/correctness/property_with_default_and_required.rb +35 -33
- data/lib/rubocop/cop/chef/correctness/property_with_name_attribute.rb +29 -27
- data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +52 -0
- data/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +51 -0
- data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +52 -0
- data/lib/rubocop/cop/chef/correctness/service_resource.rb +26 -24
- data/lib/rubocop/cop/chef/correctness/tmp_path.rb +30 -28
- data/lib/rubocop/cop/chef/deprecation/attribute_metadata.rb +22 -21
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +58 -0
- data/lib/rubocop/cop/chef/deprecation/conflicts_metadata.rb +18 -16
- data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +21 -19
- data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +17 -15
- data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +17 -15
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +39 -37
- data/lib/rubocop/cop/chef/deprecation/easy_install.rb +15 -13
- data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +24 -22
- data/lib/rubocop/cop/chef/deprecation/erl_call.rb +15 -13
- data/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +55 -0
- data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +24 -22
- data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +45 -0
- data/lib/rubocop/cop/chef/deprecation/long_description_metadata.rb +21 -19
- data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +55 -53
- data/lib/rubocop/cop/chef/deprecation/node_set.rb +27 -25
- data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +27 -25
- data/lib/rubocop/cop/chef/deprecation/provides_metadata.rb +18 -16
- data/lib/rubocop/cop/chef/deprecation/replaces_metadata.rb +18 -16
- data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +23 -21
- data/lib/rubocop/cop/chef/deprecation/suggests_metadata.rb +18 -16
- data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +53 -0
- data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +51 -0
- data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +51 -0
- data/lib/rubocop/cop/chef/effortless/data_bags.rb +13 -11
- data/lib/rubocop/cop/chef/effortless/search_used.rb +13 -11
- data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +22 -20
- data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +31 -29
- data/lib/rubocop/cop/chef/modernize/build_essential.rb +25 -23
- data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +27 -25
- data/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +25 -23
- data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +19 -17
- data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +27 -25
- data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +41 -0
- data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +21 -19
- data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +48 -0
- data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +51 -0
- data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +25 -23
- data/lib/rubocop/cop/chef/modernize/resource_with_allowed_actions.rb +77 -0
- data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +37 -35
- data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +25 -23
- data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +26 -24
- data/lib/rubocop/cop/chef/{effortless/node_save.rb → modernize/seven_zip_archive.rb} +16 -16
- data/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +59 -0
- data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +20 -18
- data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +23 -21
- data/lib/rubocop/cop/chef/modernize/windows_version_helper.rb +20 -18
- data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +15 -13
- data/lib/rubocop/cop/chef/style/attribute_keys.rb +59 -57
- data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +14 -12
- data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +65 -63
- data/lib/rubocop/cop/chef/style/comments_format.rb +48 -45
- data/lib/rubocop/cop/chef/style/file_mode.rb +32 -30
- metadata +24 -9
- data/lib/rubocop/cop/chef/deprecation/respond_to_metadata.rb +0 -53
- data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +0 -45
- data/lib/rubocop/cop/chef/modernize/resource_with_allowed_action.rb +0 -75
- data/lib/rubocop/cop/chef/modernize/use_inline_resources.rb +0 -54
- data/lib/rubocop/cop/chef/modernize/xml_ruby_recipe.rb +0 -49
- data/lib/rubocop/cop/chef/modernize/yum_dnf_compat_recipe.rb +0 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0322e55fbe3e8ec36d29d1cc23fccb0bb23c4025d46bcd629d476adb7bf40eba
|
4
|
+
data.tar.gz: 5962352d31f41fbb630963a0ae68d096afda0d6daae6b5f49fd426794e287232
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bd4f43082807bea03e36e319a9c71cbe49f92f250b4a8e14fc8dd99b2aeaaa687e3802a4abfc575556d691f8d888b94a23231cc7c89d8ffd669baf28ae3b243
|
7
|
+
data.tar.gz: 27dc56eb8c75ada36578b55a36c19d9ff1d8dfd96c0e95190581ffc5a80030918b475cd9d156219fa1559acd2d1f3d178351c009793030f0d2d70f9afa89e8d0
|
data/config/cookstyle.yml
CHANGED
@@ -27,10 +27,10 @@ AllCops:
|
|
27
27
|
- resources/.*\.rb
|
28
28
|
|
29
29
|
###############################
|
30
|
-
# Making cookbooks look better
|
30
|
+
# ChefStyle: Making cookbooks look better
|
31
31
|
###############################
|
32
32
|
|
33
|
-
|
33
|
+
ChefStyle/AttributeKeys:
|
34
34
|
Description: Check which style of keys are used to access node attributes.
|
35
35
|
Enabled: true
|
36
36
|
EnforcedStyle: strings
|
@@ -41,283 +41,390 @@ Chef/AttributeKeys:
|
|
41
41
|
Exclude:
|
42
42
|
- '**/metadata.rb'
|
43
43
|
|
44
|
-
|
44
|
+
ChefStyle/CopyrightCommentFormat:
|
45
45
|
Description: Properly format copyright dates in comment blocks and ensure dates are up to date
|
46
46
|
Enabled: false
|
47
47
|
VersionAdded: '5.0.0'
|
48
48
|
|
49
|
-
|
49
|
+
ChefStyle/CommentSentenceSpacing:
|
50
50
|
Description: Use a single space after sentences in comments
|
51
51
|
Enabled: false
|
52
52
|
VersionAdded: '5.1.0'
|
53
53
|
|
54
|
-
|
54
|
+
ChefStyle/CommentFormat:
|
55
55
|
Description: Use Chef's unique format for comment headers
|
56
56
|
Enabled: true
|
57
57
|
VersionAdded: '5.0.0'
|
58
58
|
|
59
|
-
|
60
|
-
Description: Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb.
|
61
|
-
Enabled: true
|
62
|
-
VersionAdded: '5.4.0'
|
63
|
-
Include:
|
64
|
-
- '**/metadata.rb'
|
65
|
-
|
66
|
-
###############################
|
67
|
-
# Avoiding potential problems
|
68
|
-
###############################
|
69
|
-
|
70
|
-
Chef/FileMode:
|
59
|
+
ChefStyle/FileMode:
|
71
60
|
Description: Use strings to represent file modes in Chef resources
|
72
61
|
Enabled: true
|
73
62
|
VersionAdded: '5.0.0'
|
74
63
|
Exclude:
|
75
64
|
- '**/metadata.rb'
|
76
65
|
|
77
|
-
|
66
|
+
###############################
|
67
|
+
# ChefCorrectness: Avoiding potential problems
|
68
|
+
###############################
|
69
|
+
|
70
|
+
ChefCorrectness/ServiceResource:
|
78
71
|
Description: Use a service resource to start and stop services instead of execute resources
|
79
72
|
Enabled: true
|
80
73
|
VersionAdded: '5.0.0'
|
81
74
|
Exclude:
|
82
75
|
- '**/metadata.rb'
|
83
76
|
|
84
|
-
|
77
|
+
ChefCorrectness/NodeNormal:
|
85
78
|
Description: Do not use the node.normal method
|
86
79
|
Enabled: true
|
87
80
|
VersionAdded: '5.1.0'
|
88
81
|
Exclude:
|
89
82
|
- '**/metadata.rb'
|
90
83
|
|
91
|
-
|
84
|
+
ChefCorrectness/NodeNormalUnless:
|
92
85
|
Description: Do not use the node.normal_unless method
|
93
86
|
Enabled: true
|
94
87
|
VersionAdded: '5.1.0'
|
95
88
|
Exclude:
|
96
89
|
- '**/metadata.rb'
|
97
90
|
|
98
|
-
|
91
|
+
ChefCorrectness/TmpPath:
|
99
92
|
Description: Use file_cache_path rather than hard-coding tmp paths
|
100
93
|
Enabled: true
|
101
94
|
VersionAdded: '5.0.0'
|
102
95
|
Exclude:
|
103
96
|
- '**/metadata.rb'
|
104
97
|
|
105
|
-
|
98
|
+
ChefCorrectness/InsecureCookbookURL:
|
106
99
|
Description: Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields
|
107
100
|
Enabled: true
|
108
101
|
VersionAdded: '5.1.0'
|
109
102
|
Include:
|
110
103
|
- '**/metadata.rb'
|
111
104
|
|
112
|
-
|
105
|
+
ChefCorrectness/NamePropertyIsRequired:
|
113
106
|
Description: Resource properties marked as name properties should not also be required properties
|
114
107
|
Enabled: true
|
115
108
|
VersionAdded: '5.1.0'
|
116
109
|
|
117
|
-
|
110
|
+
ChefCorrectness/InvalidLicenseString:
|
118
111
|
Description: Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved"
|
119
112
|
Enabled: true
|
120
113
|
VersionAdded: '5.2.0'
|
121
114
|
Include:
|
122
115
|
- '**/metadata.rb'
|
123
116
|
|
124
|
-
|
117
|
+
ChefCorrectness/InvalidPlatformMetadata:
|
125
118
|
Description: metadata.rb "supports" platform is invalid
|
126
119
|
Enabled: true
|
127
120
|
VersionAdded: '5.2.0'
|
128
121
|
Include:
|
129
122
|
- '**/metadata.rb'
|
130
123
|
|
124
|
+
ChefCorrectness/CookbookUsesNodeSave:
|
125
|
+
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.
|
126
|
+
Enabled: true
|
127
|
+
VersionAdded: '5.5.0'
|
128
|
+
Exclude:
|
129
|
+
- '**/metadata.rb'
|
130
|
+
|
131
|
+
ChefCorrectness/DefaultMetadataMaintainer:
|
132
|
+
Description: Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb.
|
133
|
+
Enabled: true
|
134
|
+
VersionAdded: '5.4.0'
|
135
|
+
Include:
|
136
|
+
- '**/metadata.rb'
|
137
|
+
|
138
|
+
ChefCorrectness/PropertyWithNameAttribute:
|
139
|
+
Description: Resource property sets name_attribute not name_property
|
140
|
+
Enabled: true
|
141
|
+
VersionAdded: '5.1.0'
|
142
|
+
Include:
|
143
|
+
- '**/resources/*.rb'
|
144
|
+
- '**/libraries/*.rb'
|
145
|
+
|
146
|
+
ChefCorrectness/PropertyWithRequiredAndDefault:
|
147
|
+
Description: Resource property should not be both required and have a default value
|
148
|
+
Enabled: true
|
149
|
+
VersionAdded: '5.1.0'
|
150
|
+
Include:
|
151
|
+
- '**/resources/*.rb'
|
152
|
+
- '**/libraries/*.rb'
|
153
|
+
|
154
|
+
ChefCorrectness/CookbooksDependsOnSelf:
|
155
|
+
Description: A cookbook cannot depend on itself
|
156
|
+
Enabled: true
|
157
|
+
VersionAdded: '5.2.0'
|
158
|
+
Include:
|
159
|
+
- '**/metadata.rb'
|
160
|
+
|
161
|
+
ChefCorrectness/MetadataMissingName:
|
162
|
+
Description: MetadataMissingName
|
163
|
+
Enabled: true
|
164
|
+
VersionAdded: '5.2.0'
|
165
|
+
Include:
|
166
|
+
- '**/metadata.rb'
|
167
|
+
|
168
|
+
ChefCorrectness/BlockGuardWithOnlyString:
|
169
|
+
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.
|
170
|
+
Enabled: true
|
171
|
+
VersionAdded: '5.2.0'
|
172
|
+
Exclude:
|
173
|
+
- '**/metadata.rb'
|
174
|
+
|
175
|
+
ChefCorrectness/ResourceSetsInternalProperties:
|
176
|
+
Description: Do not set properties used internally by Chef Infra Client to track the system state.
|
177
|
+
Enabled: true
|
178
|
+
VersionAdded: '5.5.0'
|
179
|
+
Exclude:
|
180
|
+
- '**/metadata.rb'
|
181
|
+
|
182
|
+
ChefCorrectness/ResourceSetsNameProperty:
|
183
|
+
Description: Resource sets the name property in the resource instead of using a name_property.
|
184
|
+
Enabled: true
|
185
|
+
VersionAdded: '5.5.0'
|
186
|
+
Exclude:
|
187
|
+
- '**/metadata.rb'
|
188
|
+
|
189
|
+
ChefCorrectness/ResourceWithNoneAction:
|
190
|
+
Description: Resource uses the nonexistent :none action instead of the :nothing action
|
191
|
+
Enabled: true
|
192
|
+
VersionAdded: '5.5.0'
|
193
|
+
Exclude:
|
194
|
+
- '**/metadata.rb'
|
195
|
+
|
196
|
+
ChefCorrectness/IncludingOhaiDefaultRecipe:
|
197
|
+
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.
|
198
|
+
Enabled: true
|
199
|
+
VersionAdded: '5.4.0'
|
200
|
+
Exclude:
|
201
|
+
- '**/metadata.rb'
|
202
|
+
|
131
203
|
###############################
|
132
|
-
# Resolving Deprecations
|
204
|
+
# ChefDeprecations: Resolving Deprecations that block upgrading Chef Infra Client
|
133
205
|
###############################
|
134
206
|
|
135
|
-
|
207
|
+
ChefDeprecations/NodeSet:
|
136
208
|
Description: Do not use the deprecated node.set method
|
137
209
|
Enabled: true
|
138
210
|
VersionAdded: '5.0.0'
|
139
211
|
Exclude:
|
140
212
|
- '**/metadata.rb'
|
141
213
|
|
142
|
-
|
214
|
+
ChefDeprecations/NodeSetUnless:
|
143
215
|
Description: Do not use the deprecated node.set_unless method
|
144
216
|
Enabled: true
|
145
217
|
VersionAdded: '5.1.0'
|
146
218
|
Exclude:
|
147
219
|
- '**/metadata.rb'
|
148
220
|
|
149
|
-
|
221
|
+
ChefDeprecations/EpicFail:
|
150
222
|
Description: Use ignore_failure method instead of the deprecated epic_fail method
|
151
223
|
Enabled: true
|
152
224
|
VersionAdded: '5.1.0'
|
153
225
|
Exclude:
|
154
226
|
- '**/metadata.rb'
|
155
227
|
|
156
|
-
|
228
|
+
ChefDeprecations/CookbookDependsOnPoise:
|
157
229
|
Description: Cookbooks should not depend on the deprecated Poise framework
|
158
230
|
Enabled: true
|
159
231
|
VersionAdded: '5.1.0'
|
160
232
|
Include:
|
161
233
|
- '**/metadata.rb'
|
162
234
|
|
163
|
-
|
235
|
+
ChefDeprecations/ConflictsMetadata:
|
164
236
|
Description: Don't use the deprecated 'conflicts' metadata value
|
165
237
|
Enabled: true
|
166
238
|
VersionAdded: '5.1.0'
|
167
239
|
Include:
|
168
240
|
- '**/metadata.rb'
|
169
241
|
|
170
|
-
|
242
|
+
ChefDeprecations/SuggestsMetadata:
|
171
243
|
Description: Don't use the deprecated 'suggests' metadata value
|
172
244
|
Enabled: true
|
173
245
|
VersionAdded: '5.1.0'
|
174
246
|
Include:
|
175
247
|
- '**/metadata.rb'
|
176
248
|
|
177
|
-
|
249
|
+
ChefDeprecations/ProvidesMetadata:
|
178
250
|
Description: Don't use the deprecated 'provides' metadata value
|
179
251
|
Enabled: true
|
180
252
|
VersionAdded: '5.1.0'
|
181
253
|
Include:
|
182
254
|
- '**/metadata.rb'
|
183
255
|
|
184
|
-
|
256
|
+
ChefDeprecations/ReplacesMetadata:
|
185
257
|
Description: Don't use the deprecated 'replaces' metadata value
|
186
258
|
Enabled: true
|
187
259
|
VersionAdded: '5.1.0'
|
188
260
|
Include:
|
189
261
|
- '**/metadata.rb'
|
190
262
|
|
191
|
-
|
263
|
+
ChefDeprecations/AttributeMetadata:
|
192
264
|
Description: Don't use the deprecated 'attribute' metadata value
|
193
265
|
Enabled: true
|
194
266
|
VersionAdded: '5.1.0'
|
195
267
|
Include:
|
196
268
|
- '**/metadata.rb'
|
197
269
|
|
198
|
-
|
270
|
+
ChefDeprecations/LongDescriptionMetadata:
|
199
271
|
Description: The long_description metadata.rb method is not used and is unnecessary in cookbooks
|
200
272
|
Enabled: true
|
201
273
|
VersionAdded: '5.2.0'
|
202
274
|
Include:
|
203
275
|
- '**/metadata.rb'
|
204
276
|
|
205
|
-
|
277
|
+
ChefDeprecations/CookbookDependsOnCompatResource:
|
206
278
|
Description: Don't depend on the deprecated compat_resource cookbook made obsolete by Chef 12.19+
|
207
279
|
Enabled: true
|
208
280
|
VersionAdded: '5.1.0'
|
209
281
|
Include:
|
210
282
|
- '**/metadata.rb'
|
211
283
|
|
212
|
-
|
284
|
+
ChefDeprecations/CookbookDependsOnPartialSearch:
|
213
285
|
Description: Don't depend on the deprecated partial_search cookbook made obsolete by Chef 13+
|
214
286
|
Enabled: true
|
215
287
|
VersionAdded: '5.1.0'
|
216
288
|
Include:
|
217
289
|
- '**/metadata.rb'
|
218
290
|
|
219
|
-
|
291
|
+
ChefDeprecations/EasyInstallResource:
|
220
292
|
Description: Don't use the deprecated easy_install resource resource removed in Chef 13
|
221
293
|
Enabled: true
|
222
294
|
VersionAdded: '5.1.0'
|
223
295
|
Exclude:
|
224
296
|
- '**/metadata.rb'
|
225
297
|
|
226
|
-
|
298
|
+
ChefDeprecations/ErlCallResource:
|
227
299
|
Description: Don't use the deprecated erl_call resource removed in Chef 13
|
228
300
|
Enabled: true
|
229
301
|
VersionAdded: '5.1.0'
|
230
302
|
Exclude:
|
231
303
|
- '**/metadata.rb'
|
232
304
|
|
233
|
-
|
305
|
+
ChefDeprecations/RequireRecipe:
|
234
306
|
Description: Use include_recipe instead of the require_recipe method
|
235
307
|
Enabled: true
|
236
308
|
VersionAdded: '5.2.0'
|
237
309
|
Exclude:
|
238
310
|
- '**/metadata.rb'
|
239
311
|
|
240
|
-
|
312
|
+
ChefDeprecations/NodeMethodsInsteadofAttributes:
|
241
313
|
Description: Use node attributes to access Ohai data instead of node methods, which were deprecated in Chef Infra Client 13.
|
242
314
|
Enabled: true
|
243
315
|
VersionAdded: '5.4.0'
|
244
316
|
Exclude:
|
245
317
|
- '**/metadata.rb'
|
246
318
|
|
247
|
-
|
319
|
+
ChefDeprecations/UsesDeprecatedMixins:
|
248
320
|
Description: Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later.
|
249
321
|
Enabled: true
|
250
322
|
VersionAdded: '5.4.0'
|
251
323
|
Include:
|
252
324
|
- '**/libraries/*.rb'
|
253
325
|
- '**/providers/*.rb'
|
326
|
+
- '**/resources/*.rb'
|
254
327
|
|
255
|
-
|
256
|
-
Description:
|
328
|
+
ChefDeprecations/IncludingXMLRubyRecipe:
|
329
|
+
Description: The xml::ruby recipe installs nokogiri which is included in Chef Infra Client 12 and later.
|
257
330
|
Enabled: true
|
258
331
|
VersionAdded: '5.4.0'
|
259
|
-
|
260
|
-
- '**/
|
261
|
-
- '**/providers/*.rb'
|
332
|
+
Exclude:
|
333
|
+
- '**/metadata.rb'
|
262
334
|
|
263
|
-
|
335
|
+
ChefDeprecations/LegacyYumCookbookRecipes:
|
264
336
|
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).
|
265
337
|
Enabled: true
|
266
338
|
VersionAdded: '5.4.0'
|
267
339
|
Exclude:
|
268
340
|
- '**/metadata.rb'
|
269
341
|
|
270
|
-
|
271
|
-
|
272
|
-
|
342
|
+
ChefDeprecations/UsesChefRESTHelpers:
|
343
|
+
Description: Don't use the helpers in Chef::REST which were removed in Chef Infra Client 13
|
344
|
+
Enabled: true
|
345
|
+
VersionAdded: '5.5.0'
|
346
|
+
Exclude:
|
347
|
+
- '**/metadata.rb'
|
273
348
|
|
274
|
-
|
275
|
-
Description:
|
349
|
+
ChefDeprecations/ChocolateyPackageUninstallAction:
|
350
|
+
Description: Use the :remove action in the chocolatey_package resource instead of :uninstall which was removed in Chef Infra Client 14+
|
276
351
|
Enabled: true
|
277
|
-
VersionAdded: '5.
|
278
|
-
|
279
|
-
- '**/
|
352
|
+
VersionAdded: '5.5.0'
|
353
|
+
Exclude:
|
354
|
+
- '**/metadata.rb'
|
280
355
|
|
281
|
-
|
282
|
-
Description:
|
356
|
+
ChefDeprecations/LaunchdDeprecatedHashProperty:
|
357
|
+
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.
|
283
358
|
Enabled: true
|
284
|
-
VersionAdded: '5.
|
359
|
+
VersionAdded: '5.5.0'
|
360
|
+
Exclude:
|
361
|
+
- '**/metadata.rb'
|
362
|
+
|
363
|
+
ChefDeprecations/LocaleDeprecatedLcAllProperty:
|
364
|
+
Description: The local resource's lc_all property has been deprecated and will be removed in Chef Infra Client 16
|
365
|
+
Enabled: true
|
366
|
+
VersionAdded: '5.5.0'
|
367
|
+
Exclude:
|
368
|
+
- '**/metadata.rb'
|
369
|
+
|
370
|
+
ChefDeprecations/UserDeprecatedSupportsProperty:
|
371
|
+
Description: The supports property was removed in Chef Infra Client 13 in favor of individual 'manage_home' and 'non_unique' properties.
|
372
|
+
Enabled: true
|
373
|
+
VersionAdded: '5.5.0'
|
374
|
+
Exclude:
|
375
|
+
- '**/metadata.rb'
|
376
|
+
|
377
|
+
ChefDeprecations/UseInlineResourcesDefined:
|
378
|
+
Description: use_inline_resources is now the default for resources in Chef Infra Client 13+ and does not need to be specified.
|
379
|
+
Enabled: true
|
380
|
+
VersionAdded: '5.4.0'
|
285
381
|
Include:
|
286
|
-
- '**/resources/*.rb'
|
287
|
-
- '**/providers/*.rb'
|
288
382
|
- '**/libraries/*.rb'
|
383
|
+
- '**/providers/*.rb'
|
384
|
+
- '**/resources/*.rb'
|
289
385
|
|
290
|
-
|
291
|
-
Description:
|
386
|
+
ChefDeprecations/IncludingYumDNFCompatRecipe:
|
387
|
+
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.
|
388
|
+
Enabled: true
|
389
|
+
VersionAdded: '5.3.0'
|
390
|
+
Exclude:
|
391
|
+
- '**/metadata.rb'
|
392
|
+
|
393
|
+
###############################
|
394
|
+
# ChefModernize: Cleaning up legacy code and using new built-in resources
|
395
|
+
###############################
|
396
|
+
|
397
|
+
ChefModernize/LegacyBerksfileSource:
|
398
|
+
Description: Do not use legacy Berksfile community sources. Use Chef Supermarket instead.
|
292
399
|
Enabled: true
|
293
400
|
VersionAdded: '5.1.0'
|
294
401
|
Include:
|
295
|
-
- '**/
|
296
|
-
- '**/libraries/*.rb'
|
402
|
+
- '**/Berksfile'
|
297
403
|
|
298
|
-
|
299
|
-
Description:
|
404
|
+
ChefModernize/WhyRunSupportedTrue:
|
405
|
+
Description: whyrun_supported? no longer needs to be set to true as it is the default in Chef 13+
|
300
406
|
Enabled: true
|
301
407
|
VersionAdded: '5.1.0'
|
302
408
|
Include:
|
303
409
|
- '**/resources/*.rb'
|
410
|
+
- '**/providers/*.rb'
|
304
411
|
- '**/libraries/*.rb'
|
305
412
|
|
306
|
-
|
413
|
+
ChefModernize/UnnecessaryDependsChef14:
|
307
414
|
Description: Don't depend on cookbooks made obsolete by Chef 14
|
308
415
|
Enabled: true
|
309
416
|
VersionAdded: '5.1.0'
|
310
417
|
Include:
|
311
418
|
- '**/metadata.rb'
|
312
419
|
|
313
|
-
|
420
|
+
ChefModernize/RespondToInMetadata:
|
314
421
|
Description: It is no longer necessary to use respond_to? in metadata.rb in Chef 12.15 and later
|
315
422
|
Enabled: true
|
316
423
|
VersionAdded: '5.2.0'
|
317
424
|
Include:
|
318
425
|
- '**/metadata.rb'
|
319
426
|
|
320
|
-
|
427
|
+
ChefModernize/RespondToResourceName:
|
321
428
|
Description: respond_to?(:resource_name) in resources is no longer necessary in Chef Infra Client 12.5+
|
322
429
|
Enabled: true
|
323
430
|
VersionAdded: '5.2.0'
|
@@ -325,7 +432,7 @@ Chef/RespondToResourceName:
|
|
325
432
|
- '**/resources/*.rb'
|
326
433
|
- '**/libraries/*.rb'
|
327
434
|
|
328
|
-
|
435
|
+
ChefModernize/RespondToProvides:
|
329
436
|
Description: respond_to?(:provides) in resources is no longer necessary in Chef Infra Client 12+
|
330
437
|
Enabled: true
|
331
438
|
VersionAdded: '5.2.0'
|
@@ -333,7 +440,7 @@ Chef/RespondToProvides:
|
|
333
440
|
- '**/providers/*.rb'
|
334
441
|
- '**/libraries/*.rb'
|
335
442
|
|
336
|
-
|
443
|
+
ChefModernize/SetOrReturnInResources:
|
337
444
|
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.
|
338
445
|
Enabled: true
|
339
446
|
VersionAdded: '5.2.0'
|
@@ -341,141 +448,136 @@ Chef/SetOrReturnInResources:
|
|
341
448
|
- '**/resources/*.rb'
|
342
449
|
- '**/libraries/*.rb'
|
343
450
|
|
344
|
-
|
451
|
+
ChefModernize/CustomResourceWithAttributes:
|
345
452
|
Description: Custom Resources should contain properties not attributes.
|
346
453
|
Enabled: true
|
347
454
|
VersionAdded: '5.2.0'
|
348
455
|
Include:
|
349
456
|
- '**/resources/*.rb'
|
350
457
|
|
351
|
-
|
458
|
+
ChefModernize/CustomResourceWithAllowedActions:
|
352
459
|
Description: Custom Resources don't need to define the allowed actions with allowed_actions or actions methods
|
353
460
|
Enabled: true
|
354
461
|
VersionAdded: '5.2.0'
|
355
462
|
Include:
|
356
463
|
- '**/resources/*.rb'
|
357
464
|
|
358
|
-
|
465
|
+
ChefModernize/IncludingAptDefaultRecipe:
|
359
466
|
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.
|
360
467
|
Enabled: true
|
361
468
|
VersionAdded: '5.3.0'
|
362
469
|
Exclude:
|
363
470
|
- '**/metadata.rb'
|
364
471
|
|
365
|
-
|
472
|
+
ChefModernize/IncludingWindowsDefaultRecipe:
|
366
473
|
Description: Do not include the Windows default recipe, which only installs win32 gems already included in Chef Infra Client
|
367
474
|
Enabled: true
|
368
475
|
VersionAdded: '5.3.0'
|
369
476
|
Exclude:
|
370
477
|
- '**/metadata.rb'
|
371
478
|
|
372
|
-
|
373
|
-
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.
|
374
|
-
Enabled: true
|
375
|
-
VersionAdded: '5.3.0'
|
376
|
-
Exclude:
|
377
|
-
- '**/metadata.rb'
|
378
|
-
|
379
|
-
Chef/DefinesChefSpecMatchers:
|
479
|
+
ChefModernize/DefinesChefSpecMatchers:
|
380
480
|
Description: ChefSpec matchers are now auto generated by ChefSpec 7.1+ and do not need to be defined in a cookbook
|
381
481
|
Enabled: true
|
382
482
|
VersionAdded: '5.3.0'
|
383
483
|
Include:
|
384
484
|
- '**/libraries/*.rb'
|
385
485
|
|
386
|
-
|
486
|
+
ChefModernize/ExecuteAptUpdate:
|
387
487
|
Description: Use the apt_update resource instead of the execute resource to run an apt-get update package cache update
|
388
488
|
Enabled: true
|
389
489
|
VersionAdded: '5.3.0'
|
390
490
|
Exclude:
|
391
491
|
- '**/metadata.rb'
|
392
492
|
|
393
|
-
|
394
|
-
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook
|
395
|
-
Enabled: true
|
396
|
-
VersionAdded: '5.4.0'
|
397
|
-
Exclude:
|
398
|
-
- '**/metadata.rb'
|
399
|
-
|
400
|
-
Chef/WindowsVersionHelper:
|
493
|
+
ChefModernize/WindowsVersionHelper:
|
401
494
|
Description: Use node['platform_version'] data instead of the Windows::VersionHelper helper from the Windows cookbook.
|
402
495
|
Enabled: true
|
403
496
|
VersionAdded: '5.4.0'
|
404
497
|
Exclude:
|
405
498
|
- '**/metadata.rb'
|
406
499
|
|
407
|
-
|
500
|
+
ChefModernize/MinitestHandlerUsage:
|
408
501
|
Description: Use Chef InSpec for testing instead of the Minitest Handler cookbook pattern.
|
409
502
|
Enabled: true
|
410
503
|
VersionAdded: '5.4.0'
|
411
504
|
Include:
|
412
505
|
- '**/metadata.rb'
|
413
506
|
|
414
|
-
|
415
|
-
Description:
|
507
|
+
ChefModernize/IncludingMixinShelloutInResources:
|
508
|
+
Description: There is no need to include Chef::Mixin::ShellOut in resources or providers as this is already done by Chef Infra Client.
|
416
509
|
Enabled: true
|
417
510
|
VersionAdded: '5.4.0'
|
511
|
+
Include:
|
512
|
+
- '**/resources/*.rb'
|
513
|
+
- '**/providers/*.rb'
|
514
|
+
|
515
|
+
ChefModernize/UseBuildEssentialResource:
|
516
|
+
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+
|
517
|
+
Enabled: true
|
518
|
+
VersionAdded: '5.1.0'
|
418
519
|
Exclude:
|
419
520
|
- '**/metadata.rb'
|
420
521
|
|
421
|
-
|
422
|
-
Description:
|
522
|
+
ChefModernize/WindowsZipfileUsage:
|
523
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook
|
423
524
|
Enabled: true
|
424
525
|
VersionAdded: '5.4.0'
|
425
526
|
Exclude:
|
426
527
|
- '**/metadata.rb'
|
427
528
|
|
428
|
-
|
429
|
-
Description:
|
529
|
+
ChefModernize/SevenZipArchiveResource:
|
530
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the seven_zip_archive
|
430
531
|
Enabled: true
|
431
|
-
VersionAdded: '5.
|
432
|
-
|
433
|
-
- '**/
|
434
|
-
- '**/providers/*.rb'
|
435
|
-
- '**/resources/*.rb'
|
436
|
-
|
437
|
-
###############################
|
438
|
-
# Detecting code that breaks Chef
|
439
|
-
###############################
|
532
|
+
VersionAdded: '5.5.0'
|
533
|
+
Exclude:
|
534
|
+
- '**/metadata.rb'
|
440
535
|
|
441
|
-
|
442
|
-
Description:
|
536
|
+
ChefModernize/LibarchiveFileResource:
|
537
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the libarchive file resource
|
443
538
|
Enabled: true
|
444
|
-
VersionAdded: '5.
|
445
|
-
|
539
|
+
VersionAdded: '5.5.0'
|
540
|
+
Exclude:
|
446
541
|
- '**/metadata.rb'
|
447
542
|
|
448
|
-
|
449
|
-
Description:
|
543
|
+
ChefModernize/PowershellScriptExpandArchive:
|
544
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of using Expand-Archive in a powershell_script resource
|
450
545
|
Enabled: true
|
451
|
-
VersionAdded: '5.
|
452
|
-
|
546
|
+
VersionAdded: '5.5.0'
|
547
|
+
Exclude:
|
453
548
|
- '**/metadata.rb'
|
454
549
|
|
455
|
-
|
456
|
-
Description:
|
550
|
+
ChefModernize/PowershellInstallPackage:
|
551
|
+
Description: Use the package resource built into Chef Infra Client instead of using Install-Package in a powershell_script resource
|
457
552
|
Enabled: true
|
458
|
-
VersionAdded: '5.
|
553
|
+
VersionAdded: '5.5.0'
|
554
|
+
Exclude:
|
555
|
+
- '**/metadata.rb'
|
459
556
|
|
460
|
-
|
461
|
-
|
462
|
-
|
557
|
+
ChefModernize/PowershellInstallWindowsFeature:
|
558
|
+
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
|
559
|
+
Enabled: true
|
560
|
+
VersionAdded: '5.5.0'
|
561
|
+
Exclude:
|
562
|
+
- '**/metadata.rb'
|
463
563
|
|
464
|
-
|
465
|
-
Description: Use the
|
564
|
+
ChefModernize/ShellOutToChocolatey:
|
565
|
+
Description: Use the Chocolatey resources built into Chef Infra Client instead of shelling out to the choco command
|
466
566
|
Enabled: true
|
467
|
-
VersionAdded: '5.
|
567
|
+
VersionAdded: '5.5.0'
|
568
|
+
Exclude:
|
569
|
+
- '**/metadata.rb'
|
468
570
|
|
469
571
|
###############################
|
470
572
|
# Migrating to new patterns
|
471
573
|
###############################
|
472
574
|
|
473
|
-
|
575
|
+
ChefEffortless/CookbookUsesSearch:
|
474
576
|
Description: Cookbook uses search, which cannot be used in the Effortless Infra pattern
|
475
577
|
Enabled: false
|
476
578
|
VersionAdded: '5.1.0'
|
477
579
|
|
478
|
-
|
580
|
+
ChefEffortless/CookbookUsesDatabags:
|
479
581
|
Description: Cookbook uses data bags, which cannot be used in the Effortless Infra pattern
|
480
582
|
Enabled: false
|
481
583
|
VersionAdded: '5.1.0'
|