cookstyle 6.21.1 → 7.3.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -6
- data/config/cookstyle.yml +304 -249
- data/config/disable_all.yml +32 -0
- data/config/upstream.yml +271 -80
- data/lib/cookstyle/version.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_default_action.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/lazy_in_resource_guard.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +1 -1
- 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/node_save.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/property_without_type.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/service_resource.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/tmp_path.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/cb_depends_on_self.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_sugar_helpers.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/cheffile.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +1 -1
- 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/depends_poise.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +3 -4
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_actions.rb +67 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/easy_install.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/erl_call.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/execute_path_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/foodcritic_testing.rb +43 -0
- data/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/librarian_chefspec.rb +42 -0
- data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/macos_userdefaults_global_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_set.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/use_yaml_dump.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/berksfile.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/chef_vault_used.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/data_bags.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/depends_chef_vault.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_environment.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_policygroup.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_roles.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/search_used.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/action_method_in_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/build_essential.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/cron_d_file_or_template.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/definitions.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_sleep.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_sysctl.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/node_init_package.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/sysctl_param_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +17 -13
- data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +4 -4
- data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/double_compile_time.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/provides_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +13 -12
- data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +1 -1
- data/lib/rubocop/cop/chef/style/attribute_keys.rb +1 -1
- data/lib/rubocop/cop/chef/style/chef_whaaat.rb +1 -1
- data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +2 -2
- data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +4 -3
- data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +1 -1
- data/lib/rubocop/cop/chef/style/comments_format.rb +1 -1
- data/lib/rubocop/cop/chef/style/file_mode.rb +1 -1
- data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +1 -1
- data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +1 -1
- data/lib/rubocop/cop/chef/style/negating_only_if.rb +1 -1
- data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +1 -1
- data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +1 -1
- data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +1 -1
- data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +1 -1
- data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +1 -1
- data/lib/rubocop/monkey_patches/comment_config.rb +1 -1
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb3a7e36c658c852bc788ee0f1ee9c0f0d4950be89d0ef6b0c499ea4efd4abcb
|
4
|
+
data.tar.gz: cc49327d8000de38e72bc06288b589aac453bfea9053b6754a30d1a04c5b85fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: babafe578701a7478598faee40918bd3c7b0afe81068794faa9eae3be56eecaa97c0a8e0dc7e5eb232db307e567f91c1570ef969ea5b2eb157b8029ec6b41783
|
7
|
+
data.tar.gz: 2ad51cd32ec595555379194e579a07f3a6bf0502710fd161c6fa201fe5938f987cc301db45fc59704407a7dbb665d40b5d59ef84638f382904fc7ca99e691ffa
|
data/Gemfile
CHANGED
@@ -11,8 +11,6 @@ group :debug do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
group :docs do
|
14
|
-
gem 'github-markup'
|
15
|
-
gem 'redcarpet'
|
16
14
|
gem 'yard'
|
17
15
|
end
|
18
16
|
|
@@ -26,9 +24,6 @@ group :rubocop_gems do
|
|
26
24
|
end
|
27
25
|
|
28
26
|
group :development do
|
29
|
-
gem 'adamantium'
|
30
|
-
gem 'anima'
|
31
|
-
gem 'concord'
|
32
27
|
gem 'rake'
|
33
28
|
gem 'rspec', '>= 3.4'
|
34
|
-
end
|
29
|
+
end
|
data/config/cookstyle.yml
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
AllCops:
|
2
|
+
SuggestExtensions: false
|
2
3
|
TargetRubyVersion: 2.4
|
3
4
|
TargetChefVersion: ~
|
4
5
|
Exclude:
|
@@ -7,13 +8,13 @@ AllCops:
|
|
7
8
|
- Guardfile
|
8
9
|
|
9
10
|
###############################
|
10
|
-
#
|
11
|
+
# Chef/Style: Making cookbooks look better
|
11
12
|
###############################
|
12
13
|
|
13
|
-
|
14
|
-
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/
|
14
|
+
Chef/Style:
|
15
|
+
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chef_style.md
|
15
16
|
|
16
|
-
|
17
|
+
Chef/Style/AttributeKeys:
|
17
18
|
Description: Check which style of keys are used to access node attributes.
|
18
19
|
StyleGuide: '#chefstyleattributekeys'
|
19
20
|
Enabled: true
|
@@ -25,19 +26,19 @@ ChefStyle/AttributeKeys:
|
|
25
26
|
Exclude:
|
26
27
|
- '**/metadata.rb'
|
27
28
|
|
28
|
-
|
29
|
+
Chef/Style/CopyrightCommentFormat:
|
29
30
|
Description: Properly format copyright dates in comment blocks and ensure dates are up to date
|
30
31
|
StyleGuide: '#chefstylecopyrightcommentformat'
|
31
32
|
Enabled: false
|
32
33
|
VersionAdded: '5.0.0'
|
33
34
|
|
34
|
-
|
35
|
+
Chef/Style/CommentSentenceSpacing:
|
35
36
|
Description: Use a single space after sentences in comments
|
36
37
|
StyleGuide: '#chefstylecommentsentencespacing'
|
37
38
|
Enabled: false
|
38
39
|
VersionAdded: '5.1.0'
|
39
40
|
|
40
|
-
|
41
|
+
Chef/Style/CommentFormat:
|
41
42
|
Description: Use Chef's unique format for comment headers
|
42
43
|
StyleGuide: '#chefstylecommentformat'
|
43
44
|
Enabled: true
|
@@ -45,7 +46,7 @@ ChefStyle/CommentFormat:
|
|
45
46
|
Exclude:
|
46
47
|
- '**/Berksfile'
|
47
48
|
|
48
|
-
|
49
|
+
Chef/Style/FileMode:
|
49
50
|
Description: Use strings to represent file modes to avoid confusion between octal and base 10 integer formats.
|
50
51
|
StyleGuide: '#chefstylefilemode'
|
51
52
|
Enabled: true
|
@@ -55,7 +56,7 @@ ChefStyle/FileMode:
|
|
55
56
|
- '**/metadata.rb'
|
56
57
|
- '**/Berksfile'
|
57
58
|
|
58
|
-
|
59
|
+
Chef/Style/UsePlatformHelpers:
|
59
60
|
Description: Use platform? and platform_family? helpers to check node platform in resources and recipes
|
60
61
|
StyleGuide: '#chefstyleuseplatformhelpers'
|
61
62
|
Enabled: true
|
@@ -65,7 +66,7 @@ ChefStyle/UsePlatformHelpers:
|
|
65
66
|
- '**/libraries/*'
|
66
67
|
- '**/Berksfile'
|
67
68
|
|
68
|
-
|
69
|
+
Chef/Style/SimplifyPlatformMajorVersionCheck:
|
69
70
|
Description: Use node['platform_version'].to_i instead of node['platform_version'].split('.').first or node['platform_version'].split('.')[0]
|
70
71
|
StyleGuide: '#chefstylesimplifyplatformmajorversioncheck'
|
71
72
|
Enabled: true
|
@@ -74,13 +75,13 @@ ChefStyle/SimplifyPlatformMajorVersionCheck:
|
|
74
75
|
- '**/metadata.rb'
|
75
76
|
- '**/Berksfile'
|
76
77
|
|
77
|
-
|
78
|
+
Chef/Style/DefaultCopyrightComments:
|
78
79
|
Description: Cookbook copyright comment headers should be updated for a real person or organization.
|
79
80
|
StyleGuide: '#chefstyledefaultcopyrightcomments'
|
80
81
|
Enabled: true
|
81
82
|
VersionAdded: '5.12.0'
|
82
83
|
|
83
|
-
|
84
|
+
Chef/Style/UnnecessaryPlatformCaseStatement:
|
84
85
|
Description: Use the platform?() and platform_family?() helpers instead of a case statement that only includes a single when statement.
|
85
86
|
StyleGuide: '#chefstyleunnecessaryplatformcasestatement'
|
86
87
|
Enabled: true
|
@@ -89,7 +90,7 @@ ChefStyle/UnnecessaryPlatformCaseStatement:
|
|
89
90
|
- '**/metadata.rb'
|
90
91
|
- '**/Berksfile'
|
91
92
|
|
92
|
-
|
93
|
+
Chef/Style/ImmediateNotificationTiming:
|
93
94
|
Description: Use :immediately instead of :immediate for resource notification timing.
|
94
95
|
StyleGuide: '#chefstyleimmediatenotificationtiming'
|
95
96
|
Enabled: true
|
@@ -99,7 +100,7 @@ ChefStyle/ImmediateNotificationTiming:
|
|
99
100
|
- '**/metadata.rb'
|
100
101
|
- '**/Berksfile'
|
101
102
|
|
102
|
-
|
103
|
+
Chef/Style/TrueClassFalseClassResourceProperties:
|
103
104
|
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.
|
104
105
|
StyleGuide: '#chefstyletrueclassfalseclassresourceproperties'
|
105
106
|
Enabled: true
|
@@ -108,7 +109,7 @@ ChefStyle/TrueClassFalseClassResourceProperties:
|
|
108
109
|
- '**/libraries/*.rb'
|
109
110
|
- '**/resources/*.rb'
|
110
111
|
|
111
|
-
|
112
|
+
Chef/Style/OverlyComplexSupportsDependsMetadata:
|
112
113
|
Description: Don't loop over an array to set cookbook dependencies or supported platforms if you have fewer than three values to set.
|
113
114
|
StyleGuide: '#chefstyleovercomplexsupportsdependsmetadata'
|
114
115
|
Enabled: true
|
@@ -116,13 +117,13 @@ ChefStyle/OverlyComplexSupportsDependsMetadata:
|
|
116
117
|
Include:
|
117
118
|
- '**/metadata.rb'
|
118
119
|
|
119
|
-
|
120
|
+
Chef/Style/ChefWhaaat:
|
120
121
|
Description: Do you mean Chef (the company) or a Chef product (e.g. Chef Infra, Chef InSpec, etc)?
|
121
122
|
StyleGuide: '#chefstylechefwhaaat'
|
122
123
|
Enabled: false
|
123
124
|
VersionAdded: '5.20.0'
|
124
125
|
|
125
|
-
|
126
|
+
Chef/Style/UnnecessaryOSCheck:
|
126
127
|
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.
|
127
128
|
StyleGuide: '#chefstyleunnecessaryoscheck'
|
128
129
|
Enabled: true
|
@@ -131,7 +132,7 @@ ChefStyle/UnnecessaryOSCheck:
|
|
131
132
|
- '**/metadata.rb'
|
132
133
|
- '**/Berksfile'
|
133
134
|
|
134
|
-
|
135
|
+
Chef/Style/NegatingOnlyIf:
|
135
136
|
Description: Use not_if instead of only_if that negates the Ruby statement with a !
|
136
137
|
StyleGuide: '#chefstylenegatingonlyif'
|
137
138
|
VersionAdded: '6.2.0'
|
@@ -140,7 +141,7 @@ ChefStyle/NegatingOnlyIf:
|
|
140
141
|
- '**/metadata.rb'
|
141
142
|
- '**/Berksfile'
|
142
143
|
|
143
|
-
|
144
|
+
Chef/Style/IncludeRecipeWithParentheses:
|
144
145
|
Description: There is no need to wrap the recipe in parentheses when using the include_recipe helper
|
145
146
|
StyleGuide: '#includerecipewithparentheses'
|
146
147
|
VersionAdded: '6.11.0'
|
@@ -151,13 +152,13 @@ ChefStyle/IncludeRecipeWithParentheses:
|
|
151
152
|
- '**/Berksfile'
|
152
153
|
|
153
154
|
###############################
|
154
|
-
#
|
155
|
+
# Chef/Correctness: Avoiding potential problems
|
155
156
|
###############################
|
156
157
|
|
157
|
-
|
158
|
-
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/
|
158
|
+
Chef/Correctness:
|
159
|
+
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chef_correctness.md
|
159
160
|
|
160
|
-
|
161
|
+
Chef/Correctness/ServiceResource:
|
161
162
|
Description: Use a service resource to start and stop services instead of execute resources
|
162
163
|
StyleGuide: '#chefcorrectnessserviceresource'
|
163
164
|
Enabled: true
|
@@ -167,7 +168,7 @@ ChefCorrectness/ServiceResource:
|
|
167
168
|
- '**/metadata.rb'
|
168
169
|
- '**/Berksfile'
|
169
170
|
|
170
|
-
|
171
|
+
Chef/Correctness/NodeNormal:
|
171
172
|
Description: Do not use the node.normal method
|
172
173
|
StyleGuide: '#chefcorrectnessnodenormal'
|
173
174
|
Enabled: true
|
@@ -176,7 +177,7 @@ ChefCorrectness/NodeNormal:
|
|
176
177
|
- '**/metadata.rb'
|
177
178
|
- '**/Berksfile'
|
178
179
|
|
179
|
-
|
180
|
+
Chef/Correctness/NodeNormalUnless:
|
180
181
|
Description: Do not use the node.normal_unless method
|
181
182
|
Enabled: true
|
182
183
|
VersionAdded: '5.1.0'
|
@@ -184,7 +185,7 @@ ChefCorrectness/NodeNormalUnless:
|
|
184
185
|
- '**/metadata.rb'
|
185
186
|
- '**/Berksfile'
|
186
187
|
|
187
|
-
|
188
|
+
Chef/Correctness/TmpPath:
|
188
189
|
Description: Use file_cache_path rather than hard-coding tmp paths
|
189
190
|
StyleGuide: '#chefcorrectnessnodenormalunless'
|
190
191
|
Enabled: true
|
@@ -193,7 +194,7 @@ ChefCorrectness/TmpPath:
|
|
193
194
|
- '**/metadata.rb'
|
194
195
|
- '**/Berksfile'
|
195
196
|
|
196
|
-
|
197
|
+
Chef/Correctness/InvalidPlatformMetadata:
|
197
198
|
Description: metadata.rb "supports" platform is invalid
|
198
199
|
StyleGuide: '#chefcorrectnessinvalidplatformmetadata'
|
199
200
|
Enabled: true
|
@@ -201,7 +202,7 @@ ChefCorrectness/InvalidPlatformMetadata:
|
|
201
202
|
Include:
|
202
203
|
- '**/metadata.rb'
|
203
204
|
|
204
|
-
|
205
|
+
Chef/Correctness/CookbookUsesNodeSave:
|
205
206
|
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.
|
206
207
|
StyleGuide: '#chefcorrectnesscookbookusesnodesave'
|
207
208
|
Enabled: true
|
@@ -210,7 +211,7 @@ ChefCorrectness/CookbookUsesNodeSave:
|
|
210
211
|
- '**/metadata.rb'
|
211
212
|
- '**/Berksfile'
|
212
213
|
|
213
|
-
|
214
|
+
Chef/Correctness/MetadataMissingName:
|
214
215
|
Description: The metadata.rb file is missing the name field which is required by Chef Infra Client 12 and later
|
215
216
|
StyleGuide: '#chefcorrectnessmetadatamissingname'
|
216
217
|
Enabled: true
|
@@ -218,7 +219,7 @@ ChefCorrectness/MetadataMissingName:
|
|
218
219
|
Include:
|
219
220
|
- '**/metadata.rb'
|
220
221
|
|
221
|
-
|
222
|
+
Chef/Correctness/BlockGuardWithOnlyString:
|
222
223
|
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.
|
223
224
|
StyleGuide: '#chefcorrectnessblockguardwithonlystring'
|
224
225
|
Enabled: true
|
@@ -228,7 +229,7 @@ ChefCorrectness/BlockGuardWithOnlyString:
|
|
228
229
|
- '**/metadata.rb'
|
229
230
|
- '**/Berksfile'
|
230
231
|
|
231
|
-
|
232
|
+
Chef/Correctness/ResourceSetsInternalProperties:
|
232
233
|
Description: Do not set properties used internally by Chef Infra Client to track the system state.
|
233
234
|
StyleGuide: '#chefcorrectnessresourcesetsinternalproperties'
|
234
235
|
Enabled: true
|
@@ -238,7 +239,7 @@ ChefCorrectness/ResourceSetsInternalProperties:
|
|
238
239
|
- '**/metadata.rb'
|
239
240
|
- '**/Berksfile'
|
240
241
|
|
241
|
-
|
242
|
+
Chef/Correctness/ResourceSetsNameProperty:
|
242
243
|
Description: Resource sets the name property in the resource instead of using a name_property.
|
243
244
|
StyleGuide: '#chefcorrectnessresourcesetsnameproperty'
|
244
245
|
Enabled: true
|
@@ -248,7 +249,7 @@ ChefCorrectness/ResourceSetsNameProperty:
|
|
248
249
|
- '**/metadata.rb'
|
249
250
|
- '**/Berksfile'
|
250
251
|
|
251
|
-
|
252
|
+
Chef/Correctness/ResourceWithNoneAction:
|
252
253
|
Description: Resource uses the nonexistent :none action instead of the :nothing action
|
253
254
|
StyleGuide: '#chefcorrectnessresourcewithnoneaction'
|
254
255
|
Enabled: true
|
@@ -258,7 +259,7 @@ ChefCorrectness/ResourceWithNoneAction:
|
|
258
259
|
- '**/metadata.rb'
|
259
260
|
- '**/Berksfile'
|
260
261
|
|
261
|
-
|
262
|
+
Chef/Correctness/InvalidVersionMetadata:
|
262
263
|
Description: Cookbook metadata.rb version field should follow X.Y.Z version format.
|
263
264
|
StyleGuide: '#chefcorrectnessinvalidversionmetadata'
|
264
265
|
Enabled: true
|
@@ -266,7 +267,7 @@ ChefCorrectness/InvalidVersionMetadata:
|
|
266
267
|
Include:
|
267
268
|
- '**/metadata.rb'
|
268
269
|
|
269
|
-
|
270
|
+
Chef/Correctness/NotifiesActionNotSymbol:
|
270
271
|
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.
|
271
272
|
StyleGuide: '#chefcorrectnessnotifiesactionnotsymbol'
|
272
273
|
Enabled: true
|
@@ -276,7 +277,7 @@ ChefCorrectness/NotifiesActionNotSymbol:
|
|
276
277
|
- '**/metadata.rb'
|
277
278
|
- '**/Berksfile'
|
278
279
|
|
279
|
-
|
280
|
+
Chef/Correctness/IncorrectLibraryInjection:
|
280
281
|
Description: Libraries should be injected into the Chef::DSL::Recipe or Chef::DSL::Resource classes and not Recipe/Resource/Provider classes directly.
|
281
282
|
StyleGuide: '#chefcorrectnessincorrectlibraryinjection'
|
282
283
|
Enabled: true
|
@@ -285,7 +286,7 @@ ChefCorrectness/IncorrectLibraryInjection:
|
|
285
286
|
- '**/metadata.rb'
|
286
287
|
- '**/Berksfile'
|
287
288
|
|
288
|
-
|
289
|
+
Chef/Correctness/InvalidPlatformHelper:
|
289
290
|
Description: Pass valid platforms to the platform? helper.
|
290
291
|
StyleGuide: '#chefcorrectnessinvalidplatformhelper'
|
291
292
|
Enabled: true
|
@@ -294,7 +295,7 @@ ChefCorrectness/InvalidPlatformHelper:
|
|
294
295
|
- '**/metadata.rb'
|
295
296
|
- '**/Berksfile'
|
296
297
|
|
297
|
-
|
298
|
+
Chef/Correctness/InvalidPlatformFamilyHelper:
|
298
299
|
Description: Pass valid platform families to the platform_family? helper.
|
299
300
|
StyleGuide: '#chefcorrectnessinvalidplatformfamilyhelper'
|
300
301
|
Enabled: true
|
@@ -303,7 +304,7 @@ ChefCorrectness/InvalidPlatformFamilyHelper:
|
|
303
304
|
- '**/metadata.rb'
|
304
305
|
- '**/Berksfile'
|
305
306
|
|
306
|
-
|
307
|
+
Chef/Correctness/ScopedFileExist:
|
307
308
|
Description: Scope file exist to access the correct File class by using ::File.exist? not File.exist?.
|
308
309
|
StyleGuide: '#chefcorrectnessscopedfileexist'
|
309
310
|
Enabled: true
|
@@ -313,7 +314,7 @@ ChefCorrectness/ScopedFileExist:
|
|
313
314
|
- '**/metadata.rb'
|
314
315
|
- '**/Berksfile'
|
315
316
|
|
316
|
-
|
317
|
+
Chef/Correctness/InvalidPlatformValueForPlatformFamilyHelper:
|
317
318
|
Description: Pass valid platforms families to the value_for_platform_family helper.
|
318
319
|
StyleGuide: '#chefcorrectnessinvalidplatformvalueforplatformfamilyhelper'
|
319
320
|
Enabled: true
|
@@ -322,7 +323,7 @@ ChefCorrectness/InvalidPlatformValueForPlatformFamilyHelper:
|
|
322
323
|
- '**/metadata.rb'
|
323
324
|
- '**/Berksfile'
|
324
325
|
|
325
|
-
|
326
|
+
Chef/Correctness/InvalidPlatformValueForPlatformHelper:
|
326
327
|
Description: Pass valid platforms to the value_for_platform helper.
|
327
328
|
StyleGuide: '#chefcorrectnessinvalidplatformvalueforplatformhelper'
|
328
329
|
Enabled: true
|
@@ -331,7 +332,7 @@ ChefCorrectness/InvalidPlatformValueForPlatformHelper:
|
|
331
332
|
- '**/metadata.rb'
|
332
333
|
- '**/Berksfile'
|
333
334
|
|
334
|
-
|
335
|
+
Chef/Correctness/InvalidNotificationTiming:
|
335
336
|
Description: Valid notification timings are :immediately, :immediate (alias for :immediately), :delayed, and :before.
|
336
337
|
StyleGuide: '#chefcorrectnessinvalidnotificationtiming'
|
337
338
|
Enabled: true
|
@@ -341,7 +342,7 @@ ChefCorrectness/InvalidNotificationTiming:
|
|
341
342
|
- '**/metadata.rb'
|
342
343
|
- '**/Berksfile'
|
343
344
|
|
344
|
-
|
345
|
+
Chef/Correctness/MalformedPlatformValueForPlatformHelper:
|
345
346
|
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'.
|
346
347
|
StyleGuide: '#chefcorrectnessmalformedplatformvalueforplatformhelper'
|
347
348
|
Enabled: true
|
@@ -350,7 +351,7 @@ ChefCorrectness/MalformedPlatformValueForPlatformHelper:
|
|
350
351
|
- '**/metadata.rb'
|
351
352
|
- '**/Berksfile'
|
352
353
|
|
353
|
-
|
354
|
+
Chef/Correctness/DnfPackageAllowDowngrades:
|
354
355
|
Description: dnf_package does not support the allow_downgrades property
|
355
356
|
StyleGuide: '#chefcorrectnessdnfpackageallowdowngrades'
|
356
357
|
Enabled: true
|
@@ -360,7 +361,7 @@ ChefCorrectness/DnfPackageAllowDowngrades:
|
|
360
361
|
- '**/metadata.rb'
|
361
362
|
- '**/Berksfile'
|
362
363
|
|
363
|
-
|
364
|
+
Chef/Correctness/ChefApplicationFatal:
|
364
365
|
Description: Use raise to force Chef Infra Client to fail instead of using Chef::Application.fatal
|
365
366
|
StyleGuide: '#chefcorrectnesschefapplicationfatal'
|
366
367
|
Enabled: true
|
@@ -369,7 +370,7 @@ ChefCorrectness/ChefApplicationFatal:
|
|
369
370
|
- '**/metadata.rb'
|
370
371
|
- '**/Berksfile'
|
371
372
|
|
372
|
-
|
373
|
+
Chef/Correctness/PowershellScriptDeleteFile:
|
373
374
|
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
|
374
375
|
StyleGuide: '#chefcorrectnesspowershellscriptdeletefiles'
|
375
376
|
Enabled: true
|
@@ -379,7 +380,7 @@ ChefCorrectness/PowershellScriptDeleteFile:
|
|
379
380
|
- '**/metadata.rb'
|
380
381
|
- '**/Berksfile'
|
381
382
|
|
382
|
-
|
383
|
+
Chef/Correctness/ConditionalRubyShellout:
|
383
384
|
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.
|
384
385
|
StyleGuide: '#chefcorrectnessconditionalrubyshellout'
|
385
386
|
Enabled: true
|
@@ -389,7 +390,7 @@ ChefCorrectness/ConditionalRubyShellout:
|
|
389
390
|
- '**/metadata.rb'
|
390
391
|
- '**/Berksfile'
|
391
392
|
|
392
|
-
|
393
|
+
Chef/Correctness/LazyEvalNodeAttributeDefaults:
|
393
394
|
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.
|
394
395
|
StyleGuide: '#chefcorrectnesslazyevalnodeattributedefaults'
|
395
396
|
Enabled: true
|
@@ -398,7 +399,7 @@ ChefCorrectness/LazyEvalNodeAttributeDefaults:
|
|
398
399
|
- '**/libraries/*.rb'
|
399
400
|
- '**/resources/*.rb'
|
400
401
|
|
401
|
-
|
402
|
+
Chef/Correctness/OpenSSLPasswordHelpers:
|
402
403
|
Description: The secure_password helper from the openssl cookbooks Opscode::OpenSSL::Password class should not be used to generate passwords.
|
403
404
|
StyleGuide: '#chefcorrectnessopensslpasswordhelpers'
|
404
405
|
Enabled: true
|
@@ -407,7 +408,7 @@ ChefCorrectness/OpenSSLPasswordHelpers:
|
|
407
408
|
- '**/metadata.rb'
|
408
409
|
- '**/Berksfile'
|
409
410
|
|
410
|
-
|
411
|
+
Chef/Correctness/InvalidPlatformFamilyInCase:
|
411
412
|
Description: Use valid platform family values in case statements.
|
412
413
|
StyleGuide: '#chefcorrectnessinvalidplatformfamilyincase'
|
413
414
|
Enabled: true
|
@@ -416,7 +417,7 @@ ChefCorrectness/InvalidPlatformFamilyInCase:
|
|
416
417
|
- '**/metadata.rb'
|
417
418
|
- '**/Berksfile'
|
418
419
|
|
419
|
-
|
420
|
+
Chef/Correctness/InvalidPlatformInCase:
|
420
421
|
Description: Use valid platform values in case statements.
|
421
422
|
StyleGuide: '#chefcorrectnessinvalidplatformincase'
|
422
423
|
Enabled: true
|
@@ -425,7 +426,7 @@ ChefCorrectness/InvalidPlatformInCase:
|
|
425
426
|
- '**/metadata.rb'
|
426
427
|
- '**/Berksfile'
|
427
428
|
|
428
|
-
|
429
|
+
Chef/Correctness/InvalidDefaultAction:
|
429
430
|
Description: Default actions in resources should be a symbol or an array of symbols.
|
430
431
|
StyleGuide: '#chefcorrectnessinvaliddefaultaction'
|
431
432
|
Enabled: true
|
@@ -434,7 +435,7 @@ ChefCorrectness/InvalidDefaultAction:
|
|
434
435
|
- '**/libraries/*.rb'
|
435
436
|
- '**/resources/*.rb'
|
436
437
|
|
437
|
-
|
438
|
+
Chef/Correctness/SupportsMustBeFloat:
|
438
439
|
Description: Versions used in metadata.rb supports calls should be floats not integers.
|
439
440
|
StyleGuide: '#chefcorrectnesssupportsmustbefloat'
|
440
441
|
Enabled: true
|
@@ -442,7 +443,7 @@ ChefCorrectness/SupportsMustBeFloat:
|
|
442
443
|
Include:
|
443
444
|
- '**/metadata.rb'
|
444
445
|
|
445
|
-
|
446
|
+
Chef/Correctness/MacosUserdefaultsInvalidType:
|
446
447
|
Description: The macos_userdefaults resource prior to Chef Infra Client 16.3 would silently continue if invalid types were passed resulting in unexpected behavior. Valid values are 'array', 'bool', 'dict', 'float', 'int', and 'string'.
|
447
448
|
StyleGuide: '#chefcorrectnessmacosuserdefaultsinvalidtype'
|
448
449
|
Enabled: true
|
@@ -451,7 +452,7 @@ ChefCorrectness/MacosUserdefaultsInvalidType:
|
|
451
452
|
- '**/metadata.rb'
|
452
453
|
- '**/Berksfile'
|
453
454
|
|
454
|
-
|
455
|
+
Chef/Correctness/LazyInResourceGuard:
|
455
456
|
Description: Using `lazy {}` within a resource guard (not_if/only_if) will cause failures and is unnecessary as resource guards are always lazily evaluated.
|
456
457
|
StyleGuide: '#chefcorrectnesslazyinresourceguard'
|
457
458
|
Enabled: true
|
@@ -460,7 +461,7 @@ ChefCorrectness/LazyInResourceGuard:
|
|
460
461
|
- '**/metadata.rb'
|
461
462
|
- '**/Berksfile'
|
462
463
|
|
463
|
-
|
464
|
+
Chef/Correctness/PropertyWithoutType:
|
464
465
|
Description: Custom resource properties or attributes should always define a type to help users understand the correct allowed values.
|
465
466
|
StyleGuide: '#chefcorrectnesspropertywithouttype'
|
466
467
|
Enabled: true
|
@@ -469,7 +470,7 @@ ChefCorrectness/PropertyWithoutType:
|
|
469
470
|
- '**/libraries/*.rb'
|
470
471
|
- '**/resources/*.rb'
|
471
472
|
|
472
|
-
|
473
|
+
Chef/Correctness/OctalModeAsString:
|
473
474
|
Description: Don't represent file modes as strings containing octal values. Use standard base 10 file modes instead.
|
474
475
|
StyleGuide: '#chefcorrectnessoctalmodeasstring'
|
475
476
|
Enabled: true
|
@@ -480,13 +481,13 @@ ChefCorrectness/OctalModeAsString:
|
|
480
481
|
- '**/Berksfile'
|
481
482
|
|
482
483
|
###############################
|
483
|
-
#
|
484
|
+
# Chef/Sharing: Issues that prevent sharing code with other teams or with the Chef community in general
|
484
485
|
###############################
|
485
486
|
|
486
|
-
|
487
|
-
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/
|
487
|
+
Chef/Sharing:
|
488
|
+
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chef_sharing.md
|
488
489
|
|
489
|
-
|
490
|
+
Chef/Sharing/InsecureCookbookURL:
|
490
491
|
Description: Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields
|
491
492
|
StyleGuide: '#chefsharinginsecurecookbookurl'
|
492
493
|
Enabled: true
|
@@ -495,7 +496,7 @@ ChefSharing/InsecureCookbookURL:
|
|
495
496
|
Include:
|
496
497
|
- '**/metadata.rb'
|
497
498
|
|
498
|
-
|
499
|
+
Chef/Sharing/InvalidLicenseString:
|
499
500
|
Description: Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved"
|
500
501
|
StyleGuide: '#chefsharinginvalidlicensestring'
|
501
502
|
Enabled: true
|
@@ -504,7 +505,7 @@ ChefSharing/InvalidLicenseString:
|
|
504
505
|
Include:
|
505
506
|
- '**/metadata.rb'
|
506
507
|
|
507
|
-
|
508
|
+
Chef/Sharing/DefaultMetadataMaintainer:
|
508
509
|
Description: Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb.
|
509
510
|
StyleGuide: '#chefsharingdefaultmetadatamaintainer'
|
510
511
|
Enabled: true
|
@@ -513,7 +514,7 @@ ChefSharing/DefaultMetadataMaintainer:
|
|
513
514
|
Include:
|
514
515
|
- '**/metadata.rb'
|
515
516
|
|
516
|
-
|
517
|
+
Chef/Sharing/EmptyMetadataField:
|
517
518
|
Description: metadata.rb should not include fields with an empty string. Either don't include the field or add a value.
|
518
519
|
StyleGuide: '#chefsharingemptymetadatafield'
|
519
520
|
Enabled: true
|
@@ -522,7 +523,7 @@ ChefSharing/EmptyMetadataField:
|
|
522
523
|
Include:
|
523
524
|
- '**/metadata.rb'
|
524
525
|
|
525
|
-
|
526
|
+
Chef/Sharing/IncludePropertyDescriptions:
|
526
527
|
Description: Properties should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
527
528
|
StyleGuide: '#chefsharingincludepropetydescriptions'
|
528
529
|
Enabled: false
|
@@ -531,7 +532,7 @@ ChefSharing/IncludePropertyDescriptions:
|
|
531
532
|
- '**/libraries/*.rb'
|
532
533
|
- '**/resources/*.rb'
|
533
534
|
|
534
|
-
|
535
|
+
Chef/Sharing/IncludeResourceDescriptions:
|
535
536
|
Description: Resources should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
536
537
|
StyleGuide: '#chefsharingincluderesourcedescriptions'
|
537
538
|
Enabled: false
|
@@ -539,7 +540,7 @@ ChefSharing/IncludeResourceDescriptions:
|
|
539
540
|
Include:
|
540
541
|
- '**/resources/*.rb'
|
541
542
|
|
542
|
-
|
543
|
+
Chef/Sharing/IncludeResourceExamples:
|
543
544
|
Description: Resources should include examples field to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
544
545
|
StyleGuide: '#chefsharingincluderesourceexamples'
|
545
546
|
Enabled: false
|
@@ -548,13 +549,13 @@ ChefSharing/IncludeResourceExamples:
|
|
548
549
|
- '**/resources/*.rb'
|
549
550
|
|
550
551
|
###############################
|
551
|
-
#
|
552
|
+
# Chef/Deprecations: Resolving Deprecations that block upgrading Chef Infra Client
|
552
553
|
###############################
|
553
554
|
|
554
|
-
|
555
|
-
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/
|
555
|
+
Chef/Deprecations:
|
556
|
+
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chef_deprecations.md
|
556
557
|
|
557
|
-
|
558
|
+
Chef/Deprecations/NodeDeepFetch:
|
558
559
|
Description: Do not use the deprecated chef-sugar node.deep_fetch methods
|
559
560
|
StyleGuide: '#chefdeprecationsnodedeepfetch'
|
560
561
|
Enabled: true
|
@@ -563,7 +564,7 @@ ChefDeprecations/NodeDeepFetch:
|
|
563
564
|
- '**/metadata.rb'
|
564
565
|
- '**/Berksfile'
|
565
566
|
|
566
|
-
|
567
|
+
Chef/Deprecations/NodeSet:
|
567
568
|
Description: Do not use the deprecated node.set method
|
568
569
|
StyleGuide: '#chefdeprecationsnodeset'
|
569
570
|
Enabled: true
|
@@ -572,7 +573,7 @@ ChefDeprecations/NodeSet:
|
|
572
573
|
- '**/metadata.rb'
|
573
574
|
- '**/Berksfile'
|
574
575
|
|
575
|
-
|
576
|
+
Chef/Deprecations/NodeSetUnless:
|
576
577
|
Description: Do not use the deprecated node.set_unless method
|
577
578
|
StyleGuide: '#chefdeprecationsnodesetunless'
|
578
579
|
Enabled: true
|
@@ -581,7 +582,7 @@ ChefDeprecations/NodeSetUnless:
|
|
581
582
|
- '**/metadata.rb'
|
582
583
|
- '**/Berksfile'
|
583
584
|
|
584
|
-
|
585
|
+
Chef/Deprecations/EpicFail:
|
585
586
|
Description: Use ignore_failure method instead of the deprecated epic_fail method
|
586
587
|
StyleGuide: '#chefdeprecationsepicfail'
|
587
588
|
Enabled: true
|
@@ -591,7 +592,7 @@ ChefDeprecations/EpicFail:
|
|
591
592
|
- '**/metadata.rb'
|
592
593
|
- '**/Berksfile'
|
593
594
|
|
594
|
-
|
595
|
+
Chef/Deprecations/CookbookDependsOnPoise:
|
595
596
|
Description: Cookbooks should not depend on the deprecated Poise framework
|
596
597
|
StyleGuide: '#chefdeprecationscookbookdependsonpoise'
|
597
598
|
Enabled: true
|
@@ -599,7 +600,7 @@ ChefDeprecations/CookbookDependsOnPoise:
|
|
599
600
|
Include:
|
600
601
|
- '**/metadata.rb'
|
601
602
|
|
602
|
-
|
603
|
+
Chef/Deprecations/CookbookDependsOnCompatResource:
|
603
604
|
Description: Don't depend on the deprecated compat_resource cookbook made obsolete by Chef Infra Client 12.19+
|
604
605
|
StyleGuide: '#chefdeprecationscookbookdependsoncompatresource'
|
605
606
|
Enabled: true
|
@@ -607,7 +608,7 @@ ChefDeprecations/CookbookDependsOnCompatResource:
|
|
607
608
|
Include:
|
608
609
|
- '**/metadata.rb'
|
609
610
|
|
610
|
-
|
611
|
+
Chef/Deprecations/CookbookDependsOnPartialSearch:
|
611
612
|
Description: Don't depend on the deprecated partial_search cookbook made obsolete by Chef Infra Client 13+
|
612
613
|
StyleGuide: '#chefdeprecationscookbookdependsonpartialsearch'
|
613
614
|
Enabled: true
|
@@ -615,7 +616,7 @@ ChefDeprecations/CookbookDependsOnPartialSearch:
|
|
615
616
|
Include:
|
616
617
|
- '**/metadata.rb'
|
617
618
|
|
618
|
-
|
619
|
+
Chef/Deprecations/EasyInstallResource:
|
619
620
|
Description: Don't use the deprecated easy_install resource resource removed in Chef Infra Client 13
|
620
621
|
StyleGuide: '#chefdeprecationseasyinstallresource'
|
621
622
|
Enabled: true
|
@@ -625,7 +626,7 @@ ChefDeprecations/EasyInstallResource:
|
|
625
626
|
- '**/metadata.rb'
|
626
627
|
- '**/Berksfile'
|
627
628
|
|
628
|
-
|
629
|
+
Chef/Deprecations/ErlCallResource:
|
629
630
|
Description: Don't use the deprecated erl_call resource removed in Chef Infra Client 13
|
630
631
|
StyleGuide: '#chefdeprecationserlcallresource'
|
631
632
|
Enabled: true
|
@@ -635,7 +636,7 @@ ChefDeprecations/ErlCallResource:
|
|
635
636
|
- '**/metadata.rb'
|
636
637
|
- '**/Berksfile'
|
637
638
|
|
638
|
-
|
639
|
+
Chef/Deprecations/RequireRecipe:
|
639
640
|
Description: Use include_recipe instead of the require_recipe method
|
640
641
|
StyleGuide: '#chefdeprecationsrequirerecipe'
|
641
642
|
Enabled: true
|
@@ -645,7 +646,7 @@ ChefDeprecations/RequireRecipe:
|
|
645
646
|
- '**/metadata.rb'
|
646
647
|
- '**/Berksfile'
|
647
648
|
|
648
|
-
|
649
|
+
Chef/Deprecations/NodeMethodsInsteadofAttributes:
|
649
650
|
Description: Use node attributes to access Ohai data instead of node methods, which were deprecated in Chef Infra Client 13.
|
650
651
|
StyleGuide: '#chefdeprecationsnodemethodsinsteadofattributes'
|
651
652
|
Enabled: true
|
@@ -654,7 +655,7 @@ ChefDeprecations/NodeMethodsInsteadofAttributes:
|
|
654
655
|
- '**/metadata.rb'
|
655
656
|
- '**/Berksfile'
|
656
657
|
|
657
|
-
|
658
|
+
Chef/Deprecations/UsesDeprecatedMixins:
|
658
659
|
Description: Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later.
|
659
660
|
StyleGuide: '#chefdeprecationsusesdeprecatedmixins'
|
660
661
|
Enabled: true
|
@@ -664,7 +665,7 @@ ChefDeprecations/UsesDeprecatedMixins:
|
|
664
665
|
- '**/providers/*.rb'
|
665
666
|
- '**/resources/*.rb'
|
666
667
|
|
667
|
-
|
668
|
+
Chef/Deprecations/IncludingXMLRubyRecipe:
|
668
669
|
Description: The xml::ruby recipe installs nokogiri which is included in Chef Infra Client 12 and later.
|
669
670
|
StyleGuide: '#chefdeprecationsincludingxmlrubyrecipe'
|
670
671
|
Enabled: true
|
@@ -674,7 +675,7 @@ ChefDeprecations/IncludingXMLRubyRecipe:
|
|
674
675
|
- '**/metadata.rb'
|
675
676
|
- '**/Berksfile'
|
676
677
|
|
677
|
-
|
678
|
+
Chef/Deprecations/LegacyYumCookbookRecipes:
|
678
679
|
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).
|
679
680
|
StyleGuide: '#chefdeprecationslegacyyumcookbookrecipes'
|
680
681
|
Enabled: true
|
@@ -682,7 +683,7 @@ ChefDeprecations/LegacyYumCookbookRecipes:
|
|
682
683
|
Exclude:
|
683
684
|
- '**/metadata.rb'
|
684
685
|
|
685
|
-
|
686
|
+
Chef/Deprecations/UsesChefRESTHelpers:
|
686
687
|
Description: Don't use the helpers in Chef::REST which were removed in Chef Infra Client 13
|
687
688
|
StyleGuide: '#chefdeprecationsuseschefresthelpers'
|
688
689
|
Enabled: true
|
@@ -690,7 +691,7 @@ ChefDeprecations/UsesChefRESTHelpers:
|
|
690
691
|
Exclude:
|
691
692
|
- '**/metadata.rb'
|
692
693
|
|
693
|
-
|
694
|
+
Chef/Deprecations/ChocolateyPackageUninstallAction:
|
694
695
|
Description: Use the :remove action in the chocolatey_package resource instead of :uninstall which was removed in Chef Infra Client 14+
|
695
696
|
StyleGuide: '#chefdeprecationschocolateypackageuninstallaction'
|
696
697
|
Enabled: true
|
@@ -698,7 +699,7 @@ ChefDeprecations/ChocolateyPackageUninstallAction:
|
|
698
699
|
Exclude:
|
699
700
|
- '**/metadata.rb'
|
700
701
|
|
701
|
-
|
702
|
+
Chef/Deprecations/LaunchdDeprecatedHashProperty:
|
702
703
|
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.
|
703
704
|
StyleGuide: '#chefdeprecationslaunchddeprecatedhashproperty'
|
704
705
|
Enabled: true
|
@@ -706,7 +707,7 @@ ChefDeprecations/LaunchdDeprecatedHashProperty:
|
|
706
707
|
Exclude:
|
707
708
|
- '**/metadata.rb'
|
708
709
|
|
709
|
-
|
710
|
+
Chef/Deprecations/LocaleDeprecatedLcAllProperty:
|
710
711
|
Description: The local resource's lc_all property has been deprecated and will be removed in Chef Infra Client 16
|
711
712
|
StyleGuide: '#chefdeprecationslocaledeprecatedlcallproperty'
|
712
713
|
Enabled: true
|
@@ -714,7 +715,7 @@ ChefDeprecations/LocaleDeprecatedLcAllProperty:
|
|
714
715
|
Exclude:
|
715
716
|
- '**/metadata.rb'
|
716
717
|
|
717
|
-
|
718
|
+
Chef/Deprecations/UserDeprecatedSupportsProperty:
|
718
719
|
Description: The supports property was removed in Chef Infra Client 13 in favor of individual 'manage_home' and 'non_unique' properties.
|
719
720
|
StyleGuide: '#chefdeprecationsuserdeprecatedsupportsproperty'
|
720
721
|
Enabled: true
|
@@ -722,7 +723,7 @@ ChefDeprecations/UserDeprecatedSupportsProperty:
|
|
722
723
|
Exclude:
|
723
724
|
- '**/metadata.rb'
|
724
725
|
|
725
|
-
|
726
|
+
Chef/Deprecations/UseInlineResourcesDefined:
|
726
727
|
Description: use_inline_resources is now the default for resources in Chef Infra Client 13+ and does not need to be specified.
|
727
728
|
StyleGuide: '#chefdeprecationsuseinlineresourcesdefined'
|
728
729
|
Enabled: true
|
@@ -732,7 +733,7 @@ ChefDeprecations/UseInlineResourcesDefined:
|
|
732
733
|
- '**/providers/*.rb'
|
733
734
|
- '**/resources/*.rb'
|
734
735
|
|
735
|
-
|
736
|
+
Chef/Deprecations/IncludingYumDNFCompatRecipe:
|
736
737
|
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.
|
737
738
|
StyleGuide: '#chefdeprecationsincludingyumdnfcompatrecipe'
|
738
739
|
Enabled: true
|
@@ -740,7 +741,7 @@ ChefDeprecations/IncludingYumDNFCompatRecipe:
|
|
740
741
|
Exclude:
|
741
742
|
- '**/metadata.rb'
|
742
743
|
|
743
|
-
|
744
|
+
Chef/Deprecations/WindowsTaskChangeAction:
|
744
745
|
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.
|
745
746
|
StyleGuide: '#chefdeprecationswindowstaskchangeaction'
|
746
747
|
Enabled: true
|
@@ -748,7 +749,7 @@ ChefDeprecations/WindowsTaskChangeAction:
|
|
748
749
|
Exclude:
|
749
750
|
- '**/metadata.rb'
|
750
751
|
|
751
|
-
|
752
|
+
Chef/Deprecations/ResourceOverridesProvidesMethod:
|
752
753
|
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.
|
753
754
|
StyleGuide: '#chefdeprecationsresourceoverridesprovidesmethod'
|
754
755
|
Enabled: true
|
@@ -758,7 +759,7 @@ ChefDeprecations/ResourceOverridesProvidesMethod:
|
|
758
759
|
- '**/providers/*.rb'
|
759
760
|
- '**/resources/*.rb'
|
760
761
|
|
761
|
-
|
762
|
+
Chef/Deprecations/ResourceUsesDslNameMethod:
|
762
763
|
Description: Use resource_name instead of the dsl_name method in resources. This will cause failures in Chef Infra Client 13 and later.
|
763
764
|
StyleGuide: '#chefdeprecationsresourceusesdslnamemethod'
|
764
765
|
Enabled: true
|
@@ -768,7 +769,7 @@ ChefDeprecations/ResourceUsesDslNameMethod:
|
|
768
769
|
- '**/providers/*.rb'
|
769
770
|
- '**/resources/*.rb'
|
770
771
|
|
771
|
-
|
772
|
+
Chef/Deprecations/ResourceUsesUpdatedMethod:
|
772
773
|
Description: Don't use updated = true/false to update resource state. This will cause failures in Chef Infra Client 13 and later.
|
773
774
|
StyleGuide: '#chefdeprecationsresourceusesupdatedmethod'
|
774
775
|
Enabled: false # has a high potential for false positives
|
@@ -778,7 +779,7 @@ ChefDeprecations/ResourceUsesUpdatedMethod:
|
|
778
779
|
- '**/providers/*.rb'
|
779
780
|
- '**/resources/*.rb'
|
780
781
|
|
781
|
-
|
782
|
+
Chef/Deprecations/NamePropertyWithDefaultValue:
|
782
783
|
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.
|
783
784
|
StyleGuide: '#chefdeprecationsnamepropertywithdefaultvalue'
|
784
785
|
Enabled: true
|
@@ -787,7 +788,7 @@ ChefDeprecations/NamePropertyWithDefaultValue:
|
|
787
788
|
- '**/libraries/*.rb'
|
788
789
|
- '**/resources/*.rb'
|
789
790
|
|
790
|
-
|
791
|
+
Chef/Deprecations/ResourceUsesProviderBaseMethod:
|
791
792
|
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.
|
792
793
|
StyleGuide: '#chefdeprecationsresourceusesproviderbasemethod'
|
793
794
|
Enabled: true
|
@@ -796,7 +797,7 @@ ChefDeprecations/ResourceUsesProviderBaseMethod:
|
|
796
797
|
- '**/libraries/*.rb'
|
797
798
|
- '**/resources/*.rb'
|
798
799
|
|
799
|
-
|
800
|
+
Chef/Deprecations/ChefSpecCoverageReport:
|
800
801
|
Description: Don't use the deprecated ChefSpec coverage report functionality in your specs.
|
801
802
|
StyleGuide: '#chefdeprecationschefspeccoveragereport'
|
802
803
|
Enabled: true
|
@@ -804,7 +805,7 @@ ChefDeprecations/ChefSpecCoverageReport:
|
|
804
805
|
Include:
|
805
806
|
- '**/spec/*.rb'
|
806
807
|
|
807
|
-
|
808
|
+
Chef/Deprecations/ChefSpecLegacyRunner:
|
808
809
|
Description: Use ChefSpec::SoloRunner or ChefSpec::ServerRunner instead of the deprecated ChefSpec::Runner.
|
809
810
|
StyleGuide: '#chefdeprecationschefspeclegacyrunner'
|
810
811
|
Enabled: true
|
@@ -812,16 +813,17 @@ ChefDeprecations/ChefSpecLegacyRunner:
|
|
812
813
|
Include:
|
813
814
|
- '**/spec/*.rb'
|
814
815
|
|
815
|
-
|
816
|
+
Chef/Deprecations/UsesRunCommandHelper:
|
816
817
|
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.
|
817
818
|
StyleGuide: '#chefdeprecationsusesruncommandhelper'
|
818
819
|
Enabled: true
|
819
820
|
VersionAdded: '5.9.0'
|
820
821
|
Exclude:
|
821
822
|
- '**/metadata.rb'
|
822
|
-
- '
|
823
|
+
- '**/Berksfile'
|
824
|
+
- '**/Rakefile'
|
823
825
|
|
824
|
-
|
826
|
+
Chef/Deprecations/ChefHandlerUsesSupports:
|
825
827
|
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.
|
826
828
|
StyleGuide: '#chefdeprecationschefhandlerusessupports'
|
827
829
|
Enabled: true
|
@@ -829,23 +831,27 @@ ChefDeprecations/ChefHandlerUsesSupports:
|
|
829
831
|
Exclude:
|
830
832
|
- '**/metadata.rb'
|
831
833
|
|
832
|
-
|
834
|
+
Chef/Deprecations/DeprecatedYumRepositoryProperties:
|
833
835
|
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.
|
834
836
|
StyleGuide: '#chefdeprecationsdeprecatedyumrepositoryproperties'
|
835
837
|
Enabled: true
|
836
838
|
VersionAdded: '5.10.0'
|
837
839
|
Exclude:
|
838
840
|
- '**/metadata.rb'
|
841
|
+
- '**/attributes/*.rb'
|
842
|
+
- '**/Berksfile'
|
839
843
|
|
840
|
-
|
844
|
+
Chef/Deprecations/EOLAuditModeUsage:
|
841
845
|
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.
|
842
846
|
StyleGuide: '#chefdeprecationseolauditmodeusage'
|
843
847
|
Enabled: true
|
844
848
|
VersionAdded: '5.10.0'
|
845
849
|
Exclude:
|
846
850
|
- '**/metadata.rb'
|
851
|
+
- '**/attributes/*.rb'
|
852
|
+
- '**/Berksfile'
|
847
853
|
|
848
|
-
|
854
|
+
Chef/Deprecations/ResourceInheritsFromCompatResource:
|
849
855
|
Description: HWRP style resource should inherit from the 'Chef::Resource' class and not the 'ChefCompat::Resource' class from the deprecated compat_resource cookbook.
|
850
856
|
StyleGuide: '#chefdeprecationsresourceinheritsfromcompatresource'
|
851
857
|
Enabled: true
|
@@ -853,21 +859,27 @@ ChefDeprecations/ResourceInheritsFromCompatResource:
|
|
853
859
|
Include:
|
854
860
|
- '**/libraries/*.rb'
|
855
861
|
|
856
|
-
|
862
|
+
Chef/Deprecations/VerifyPropertyUsesFileExpansion:
|
857
863
|
Description: Use the 'path' variable in the verify property and not the 'file' variable which was removed in Chef Infra Client 13.
|
858
864
|
StyleGuide: '#chefdeprecationsverifypropertyusesfileexpansion'
|
859
865
|
Enabled: true
|
860
866
|
VersionAdded: '5.10.0'
|
861
867
|
Exclude:
|
862
868
|
- '**/metadata.rb'
|
869
|
+
- '**/attributes/*.rb'
|
870
|
+
- '**/Berksfile'
|
863
871
|
|
864
|
-
|
872
|
+
Chef/Deprecations/PoiseArchiveUsage:
|
865
873
|
Description: The poise_archive resource in the deprecated poise-archive should be replaced with the archive_file resource found in Chef Infra Client 15+.
|
866
874
|
StyleGuide: '#chefdeprecationspoisearchiveusage'
|
867
875
|
Enabled: true
|
868
876
|
VersionAdded: '5.11.0'
|
877
|
+
Exclude:
|
878
|
+
- '**/metadata.rb'
|
879
|
+
- '**/attributes/*.rb'
|
880
|
+
- '**/Berksfile'
|
869
881
|
|
870
|
-
|
882
|
+
Chef/Deprecations/PartialSearchHelperUsage:
|
871
883
|
Description: Legacy partial_search usage should be updated to use :filter_result in the search helper instead.
|
872
884
|
StyleGuide: '#chefdeprecationspartialsearchhelperusage'
|
873
885
|
Enabled: true
|
@@ -875,7 +887,7 @@ ChefDeprecations/PartialSearchHelperUsage:
|
|
875
887
|
Exclude:
|
876
888
|
- '**/metadata.rb'
|
877
889
|
|
878
|
-
|
890
|
+
Chef/Deprecations/SearchUsesPositionalParameters:
|
879
891
|
Description: Don't use deprecated positional parameters in cookbook search queries.
|
880
892
|
StyleGuide: '#chefdeprecationssearchusespositionalparameters'
|
881
893
|
Enabled: true
|
@@ -883,7 +895,7 @@ ChefDeprecations/SearchUsesPositionalParameters:
|
|
883
895
|
Exclude:
|
884
896
|
- '**/metadata.rb'
|
885
897
|
|
886
|
-
|
898
|
+
Chef/Deprecations/PartialSearchClassUsage:
|
887
899
|
Description: Legacy Chef::PartialSearch class usage should be updated to use the search helper instead with the filter_result key.
|
888
900
|
StyleGuide: '#chefdeprecationspartialsearchclassusage'
|
889
901
|
Enabled: true
|
@@ -891,7 +903,7 @@ ChefDeprecations/PartialSearchClassUsage:
|
|
891
903
|
Exclude:
|
892
904
|
- '**/metadata.rb'
|
893
905
|
|
894
|
-
|
906
|
+
Chef/Deprecations/Cheffile:
|
895
907
|
Description: The Libarian-Chef depsolving project is no longer maintained and should not be used for cookbook depsolving. Consider using Policyfiles instead.
|
896
908
|
StyleGuide: '#chefdeprecationscheffile'
|
897
909
|
Enabled: true
|
@@ -899,15 +911,17 @@ ChefDeprecations/Cheffile:
|
|
899
911
|
Include:
|
900
912
|
- '**/Cheffile'
|
901
913
|
|
902
|
-
|
914
|
+
Chef/Deprecations/LegacyNotifySyntax:
|
903
915
|
Description: Use the new-style notification syntax which allows you to notify resources defined later in a recipe or resource.
|
904
916
|
StyleGuide: '#chefdeprecationslegacynotifysyntax'
|
905
917
|
Enabled: true
|
906
918
|
VersionAdded: '5.13.0'
|
907
919
|
Exclude:
|
908
920
|
- '**/metadata.rb'
|
921
|
+
- '**/attributes/*.rb'
|
922
|
+
- '**/Berksfile'
|
909
923
|
|
910
|
-
|
924
|
+
Chef/Deprecations/NodeSetWithoutLevel:
|
911
925
|
Description: When setting a node attribute in Chef Infra Client 11 and later you must specify the precedence level.
|
912
926
|
StyleGuide: '#chefdeprecationsnodesetwithoutlevel'
|
913
927
|
Enabled: true
|
@@ -916,7 +930,7 @@ ChefDeprecations/NodeSetWithoutLevel:
|
|
916
930
|
- '**/metadata.rb'
|
917
931
|
- '**/attributes/*.rb'
|
918
932
|
|
919
|
-
|
933
|
+
Chef/Deprecations/ChefRewind:
|
920
934
|
Description: Use delete_resource / edit_resource instead of functionality in the deprecated chef-rewind gem
|
921
935
|
StyleGuide: '#chefdeprecationschefrewind'
|
922
936
|
Enabled: true
|
@@ -925,7 +939,7 @@ ChefDeprecations/ChefRewind:
|
|
925
939
|
- '**/metadata.rb'
|
926
940
|
- '**/attributes/*.rb'
|
927
941
|
|
928
|
-
|
942
|
+
Chef/Deprecations/RubyBlockCreateAction:
|
929
943
|
Description: Use the :run action in the ruby_block resource instead of the deprecated :create action
|
930
944
|
StyleGuide: '#chefdeprecationsrubyblockcreateaction'
|
931
945
|
Enabled: true
|
@@ -935,7 +949,7 @@ ChefDeprecations/RubyBlockCreateAction:
|
|
935
949
|
- '**/attributes/*.rb'
|
936
950
|
- '**/Berksfile'
|
937
951
|
|
938
|
-
|
952
|
+
Chef/Deprecations/DeprecatedPlatformMethods:
|
939
953
|
Description: Use provider_for_action or provides instead of the deprecated Chef::Platform methods in resources.
|
940
954
|
StyleGuide: '#chefdeprecationsdeprecatedplatformmethods'
|
941
955
|
Enabled: true
|
@@ -946,7 +960,7 @@ ChefDeprecations/DeprecatedPlatformMethods:
|
|
946
960
|
- '**/resources/*.rb'
|
947
961
|
- '**/providers/*.rb'
|
948
962
|
|
949
|
-
|
963
|
+
Chef/Deprecations/DeprecatedChefSpecPlatform:
|
950
964
|
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
|
951
965
|
StyleGuide: '#chefdeprecationsdeprecatedchefspecplatform'
|
952
966
|
Enabled: true
|
@@ -954,7 +968,7 @@ ChefDeprecations/DeprecatedChefSpecPlatform:
|
|
954
968
|
Include:
|
955
969
|
- '**/spec/**/*.rb'
|
956
970
|
|
957
|
-
|
971
|
+
Chef/Deprecations/WindowsFeatureServermanagercmd:
|
958
972
|
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.
|
959
973
|
StyleGuide: '#chefdeprecationswindowsfeatureservermanagercmd'
|
960
974
|
Enabled: true
|
@@ -964,7 +978,7 @@ ChefDeprecations/WindowsFeatureServermanagercmd:
|
|
964
978
|
- '**/attributes/*.rb'
|
965
979
|
- '**/Berksfile'
|
966
980
|
|
967
|
-
|
981
|
+
Chef/Deprecations/DeprecatedWindowsVersionCheck:
|
968
982
|
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.
|
969
983
|
StyleGuide: '#chefdeprecationsdeprecatedwindowsversioncheck'
|
970
984
|
Enabled: true
|
@@ -973,7 +987,7 @@ ChefDeprecations/DeprecatedWindowsVersionCheck:
|
|
973
987
|
- '**/metadata.rb'
|
974
988
|
- '**/Berksfile'
|
975
989
|
|
976
|
-
|
990
|
+
Chef/Deprecations/ChefWindowsPlatformHelper:
|
977
991
|
Description: Use `platform?('windows')` instead of the legacy `Chef::Platform.windows?` helper.
|
978
992
|
StyleGuide: '#chefdeprecationschefwindowsplatformhelper'
|
979
993
|
Enabled: true
|
@@ -982,7 +996,7 @@ ChefDeprecations/ChefWindowsPlatformHelper:
|
|
982
996
|
- '**/metadata.rb'
|
983
997
|
- '**/Berksfile'
|
984
998
|
|
985
|
-
|
999
|
+
Chef/Deprecations/LogResourceNotifications:
|
986
1000
|
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.
|
987
1001
|
StyleGuide: '#chefdeprecationslogresourcenotifications'
|
988
1002
|
Enabled: true
|
@@ -991,7 +1005,7 @@ ChefDeprecations/LogResourceNotifications:
|
|
991
1005
|
- '**/metadata.rb'
|
992
1006
|
- '**/Berksfile'
|
993
1007
|
|
994
|
-
|
1008
|
+
Chef/Deprecations/HWRPWithoutProvides:
|
995
1009
|
Description: In Chef Infra Client 16 and later a legacy HWRP resource must use `provides` to define how the resource is called in recipes or other resources. To maintain compatibility with Chef Infra Client < 16 use both `resource_name` and `provides`.
|
996
1010
|
StyleGuide: '#chefdeprecationsresourcewithoutnameorprovides'
|
997
1011
|
Enabled: true
|
@@ -1000,7 +1014,7 @@ ChefDeprecations/HWRPWithoutProvides:
|
|
1000
1014
|
Include:
|
1001
1015
|
- '**/libraries/*.rb'
|
1002
1016
|
|
1003
|
-
|
1017
|
+
Chef/Deprecations/WindowsVersionHelpers:
|
1004
1018
|
Description: Use node['platform_version'] data instead of the Windows::VersionHelper helper from the Windows cookbook.
|
1005
1019
|
StyleGuide: '#chefdeprecationswindowsversionhelpers'
|
1006
1020
|
Enabled: true
|
@@ -1009,7 +1023,7 @@ ChefDeprecations/WindowsVersionHelpers:
|
|
1009
1023
|
- '**/metadata.rb'
|
1010
1024
|
- '**/Berksfile'
|
1011
1025
|
|
1012
|
-
|
1026
|
+
Chef/Deprecations/PowershellCookbookHelpers:
|
1013
1027
|
Description: Use node['powershell']['version'] or the new powershell_version helper available in Chef Infra Client 16+ instead of the deprecated PowerShell cookbook helpers.
|
1014
1028
|
StyleGuide: '#chefdeprecationspowershellcookbookhelpers'
|
1015
1029
|
Enabled: true
|
@@ -1018,7 +1032,7 @@ ChefDeprecations/PowershellCookbookHelpers:
|
|
1018
1032
|
- '**/metadata.rb'
|
1019
1033
|
- '**/Berksfile'
|
1020
1034
|
|
1021
|
-
|
1035
|
+
Chef/Deprecations/DeprecatedShelloutMethods:
|
1022
1036
|
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.
|
1023
1037
|
StyleGuide: '#chefdeprecationsdeprecatedshelloutmethods'
|
1024
1038
|
Enabled: true
|
@@ -1028,7 +1042,7 @@ ChefDeprecations/DeprecatedShelloutMethods:
|
|
1028
1042
|
- '**/attributes/*.rb'
|
1029
1043
|
- '**/Berksfile'
|
1030
1044
|
|
1031
|
-
|
1045
|
+
Chef/Deprecations/Ruby27KeywordArgumentWarnings:
|
1032
1046
|
Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
|
1033
1047
|
StyleGuide: '#chefdeprecationsruby27keywordargumentwarnings'
|
1034
1048
|
Enabled: true
|
@@ -1037,7 +1051,7 @@ ChefDeprecations/Ruby27KeywordArgumentWarnings:
|
|
1037
1051
|
- '**/metadata.rb'
|
1038
1052
|
- '**/Berksfile'
|
1039
1053
|
|
1040
|
-
|
1054
|
+
Chef/Deprecations/ResourceUsesOnlyResourceName:
|
1041
1055
|
Description: Starting with Chef Infra Client 16, using `resource_name` without also using `provides` will result in resource failures. Use `provides` to change the name of the resource instead and omit `resource_name` entirely if it matches the name Chef Infra Client automatically assigns based on COOKBOOKNAME_FILENAME.
|
1042
1056
|
StyleGuide: '#chefdeprecationsresourceusesonlyresourcename'
|
1043
1057
|
Enabled: true
|
@@ -1046,7 +1060,7 @@ ChefDeprecations/ResourceUsesOnlyResourceName:
|
|
1046
1060
|
- '**/libraries/*.rb'
|
1047
1061
|
- '**/resources/*.rb'
|
1048
1062
|
|
1049
|
-
|
1063
|
+
Chef/Deprecations/ChefDKGenerators:
|
1050
1064
|
Description: Chef Workstation 0.8 and later renamed the ChefDK module used when writing custom cookbook generators from ChefDK to ChefCLI. For compatibility with the latest Chef Workstation releases you'll need to reference the new class names.
|
1051
1065
|
StyleGuide: '#chefdeprecationschefdkgenerators'
|
1052
1066
|
Enabled: true
|
@@ -1055,7 +1069,7 @@ ChefDeprecations/ChefDKGenerators:
|
|
1055
1069
|
- '**/metadata.rb'
|
1056
1070
|
- '**/Berksfile'
|
1057
1071
|
|
1058
|
-
|
1072
|
+
Chef/Deprecations/ChefHandlerRecipe:
|
1059
1073
|
Description: There is no need to include the empty and deprecated chef_handler::default recipe in order to use the chef_handler resource.
|
1060
1074
|
StyleGuide: '#chefdeprecationschefhandlerrecipe'
|
1061
1075
|
Enabled: true
|
@@ -1064,7 +1078,7 @@ ChefDeprecations/ChefHandlerRecipe:
|
|
1064
1078
|
- '**/metadata.rb'
|
1065
1079
|
- '**/Berksfile'
|
1066
1080
|
|
1067
|
-
|
1081
|
+
Chef/Deprecations/UseAutomaticResourceName:
|
1068
1082
|
Description: The use_automatic_resource_name method was removed in Chef Infra Client 16. The resource name/provides should be set explicitly instead.
|
1069
1083
|
StyleGuide: '#chefdeprecationsuseautomaticresourcename'
|
1070
1084
|
Enabled: true
|
@@ -1073,7 +1087,7 @@ ChefDeprecations/UseAutomaticResourceName:
|
|
1073
1087
|
- '**/libraries/*.rb'
|
1074
1088
|
- '**/resources/*.rb'
|
1075
1089
|
|
1076
|
-
|
1090
|
+
Chef/Deprecations/MacosUserdefaultsGlobalProperty:
|
1077
1091
|
Description: The `global` property in the macos_userdefaults resource was deprecated in Chef Infra Client 16.3. Omitting the `domain` property will now set global defaults.
|
1078
1092
|
StyleGuide: '#chefdeprecationsmacosuserdefaultsglobalproperty'
|
1079
1093
|
Enabled: true
|
@@ -1082,7 +1096,7 @@ ChefDeprecations/MacosUserdefaultsGlobalProperty:
|
|
1082
1096
|
- '**/metadata.rb'
|
1083
1097
|
- '**/Berksfile'
|
1084
1098
|
|
1085
|
-
|
1099
|
+
Chef/Deprecations/CookbooksDependsOnSelf:
|
1086
1100
|
Description: A cookbook cannot depend on itself in Chef Infra Client 13 or later.
|
1087
1101
|
StyleGuide: '#chefdeprecationscookbooksdependonself'
|
1088
1102
|
Enabled: true
|
@@ -1091,7 +1105,7 @@ ChefDeprecations/CookbooksDependsOnSelf:
|
|
1091
1105
|
Include:
|
1092
1106
|
- '**/metadata.rb'
|
1093
1107
|
|
1094
|
-
|
1108
|
+
Chef/Deprecations/ChefShellout:
|
1095
1109
|
Description: Don't use deprecated Chef::ShellOut which was removed in Chef Infra Client 13. Use Mixlib::ShellOut instead, which behaves identically.
|
1096
1110
|
StyleGuide: '#chefdeprecationschefshellout'
|
1097
1111
|
Enabled: true
|
@@ -1101,7 +1115,7 @@ ChefDeprecations/ChefShellout:
|
|
1101
1115
|
- '**/attributes/*.rb'
|
1102
1116
|
- '**/Berksfile'
|
1103
1117
|
|
1104
|
-
|
1118
|
+
Chef/Deprecations/ExecutePathProperty:
|
1105
1119
|
Description: In Chef Infra Client 13 and later you must set path env vars in `execute` resources using the `environment` property not the legacy `path` property.
|
1106
1120
|
StyleGuide: '#chefdeprecationsexecutepathproperty'
|
1107
1121
|
Enabled: true
|
@@ -1111,7 +1125,7 @@ ChefDeprecations/ExecutePathProperty:
|
|
1111
1125
|
- '**/attributes/*.rb'
|
1112
1126
|
- '**/Berksfile'
|
1113
1127
|
|
1114
|
-
|
1128
|
+
Chef/Deprecations/ExecuteRelativeCreatesWithoutCwd:
|
1115
1129
|
Description: In Chef Infra Client 13 and later you must either specify an absolute path when using the `execute` resource's `creates` property or also use the `cwd` property.
|
1116
1130
|
StyleGuide: '#chefdeprecationsexecuterelativecreateswithoutcwd'
|
1117
1131
|
Enabled: true
|
@@ -1121,7 +1135,7 @@ ChefDeprecations/ExecuteRelativeCreatesWithoutCwd:
|
|
1121
1135
|
- '**/attributes/*.rb'
|
1122
1136
|
- '**/Berksfile'
|
1123
1137
|
|
1124
|
-
|
1138
|
+
Chef/Deprecations/WindowsPackageInstallerTypeString:
|
1125
1139
|
Description: In Chef Infra Client 13 and later the `windows_package` resource's `installer_type` property must be a symbol.
|
1126
1140
|
StyleGuide: '#chefdeprecationswindowspackageinstallertypestring'
|
1127
1141
|
Enabled: true
|
@@ -1131,20 +1145,58 @@ ChefDeprecations/WindowsPackageInstallerTypeString:
|
|
1131
1145
|
- '**/attributes/*.rb'
|
1132
1146
|
- '**/Berksfile'
|
1133
1147
|
|
1134
|
-
|
1148
|
+
Chef/Deprecations/UseYamlDump:
|
1135
1149
|
Description: Chef Infra Client 16.5 introduced performance enhancements to Ruby library loading. Due to the underlying implementation of Ruby's `.to_yaml` method, it does not automatically load the `yaml` library and `YAML.dump()` should be used instead to properly load the `yaml` library.
|
1136
1150
|
StyleGuide: '#chefdeprecationsuseyamldump'
|
1137
1151
|
Enabled: true
|
1138
1152
|
VersionAdded: '6.21.0'
|
1139
1153
|
|
1154
|
+
Chef/Deprecations/LibrarianChefSpec:
|
1155
|
+
Description: The Librarian-Chef depsolving project is no longer maintained and ChefSpec should not use Librarian-Chef for cookbook depsolving. Consider using Policyfiles instead.
|
1156
|
+
StyleGuide: '#chefdeprecationslibrarianchefspec'
|
1157
|
+
Enabled: true
|
1158
|
+
VersionAdded: '7.1.0'
|
1159
|
+
Include:
|
1160
|
+
- '**/specs/*.rb'
|
1161
|
+
|
1162
|
+
Chef/Deprecations/FoodcriticTesting:
|
1163
|
+
Description: The Foodcritic cookbook linter has been deprecated and should no longer be used for validating cookbooks
|
1164
|
+
StyleGuide: '#chefdeprecationsfoodcritictesting'
|
1165
|
+
Enabled: true
|
1166
|
+
VersionAdded: '7.1.0'
|
1167
|
+
Include:
|
1168
|
+
- '**/Rakefile'
|
1169
|
+
- '**/Gemfile'
|
1170
|
+
|
1171
|
+
Chef/Deprecations/DeprecatedYumRepositoryActions:
|
1172
|
+
Description: With the release of Chef Infra Client 12.14 and the yum cookbook 3.0 several actions in the yum_repository resource actions were renamed. The `add` action became `create` and `delete` became `remove` to better match other resources in Chef Infra Client.
|
1173
|
+
StyleGuide: '#chefdeprecationsdeprecatedyumrepositoryactions'
|
1174
|
+
Enabled: true
|
1175
|
+
VersionAdded: '7.3.0'
|
1176
|
+
Exclude:
|
1177
|
+
- '**/metadata.rb'
|
1178
|
+
- '**/attributes/*.rb'
|
1179
|
+
- '**/Berksfile'
|
1180
|
+
- '**/Rakefile'
|
1181
|
+
|
1182
|
+
Chef/Deprecations/ChefSugarHelpers:
|
1183
|
+
Description: Do not use legacy chef-sugar helper methods, which will not be moved into Chef Infra Client itself. For a complete set of chef-sugar helpers now shipping in Chef Infra Client itself see https://github.com/chef/chef/tree/master/chef-utils#getting-started
|
1184
|
+
StyleGuide: '#chefdeprecationschefsugarhelpers'
|
1185
|
+
Enabled: true
|
1186
|
+
VersionAdded: '7.3.0'
|
1187
|
+
Exclude:
|
1188
|
+
- '**/metadata.rb'
|
1189
|
+
- '**/Berksfile'
|
1190
|
+
- '**/Rakefile'
|
1191
|
+
|
1140
1192
|
###############################
|
1141
|
-
#
|
1193
|
+
# Chef/Modernize: Cleaning up legacy code and using new built-in resources
|
1142
1194
|
###############################
|
1143
1195
|
|
1144
|
-
|
1145
|
-
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/
|
1196
|
+
Chef/Modernize:
|
1197
|
+
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chef_modernize.md
|
1146
1198
|
|
1147
|
-
|
1199
|
+
Chef/Modernize/LegacyBerksfileSource:
|
1148
1200
|
Description: Do not use legacy Berksfile community sources. Use Chef Supermarket instead.
|
1149
1201
|
StyleGuide: '#chefmodernizelegacyberksfilesource'
|
1150
1202
|
Enabled: true
|
@@ -1152,7 +1204,7 @@ ChefModernize/LegacyBerksfileSource:
|
|
1152
1204
|
Include:
|
1153
1205
|
- '**/Berksfile'
|
1154
1206
|
|
1155
|
-
|
1207
|
+
Chef/Modernize/WhyRunSupportedTrue:
|
1156
1208
|
Description: whyrun_supported? no longer needs to be set to true as it is the default in Chef 13+
|
1157
1209
|
StyleGuide: '#chefmodernizewhyrunsupportedtrue'
|
1158
1210
|
Enabled: true
|
@@ -1162,7 +1214,7 @@ ChefModernize/WhyRunSupportedTrue:
|
|
1162
1214
|
- '**/providers/*.rb'
|
1163
1215
|
- '**/libraries/*.rb'
|
1164
1216
|
|
1165
|
-
|
1217
|
+
Chef/Modernize/UnnecessaryDependsChef14:
|
1166
1218
|
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.
|
1167
1219
|
StyleGuide: '#chefmodernizeunnecessarydependschef14'
|
1168
1220
|
Enabled: true
|
@@ -1170,7 +1222,7 @@ ChefModernize/UnnecessaryDependsChef14:
|
|
1170
1222
|
Include:
|
1171
1223
|
- '**/metadata.rb'
|
1172
1224
|
|
1173
|
-
|
1225
|
+
Chef/Modernize/RespondToInMetadata:
|
1174
1226
|
Description: It is no longer necessary to use respond_to? in metadata.rb in Chef Infra Client 12.15 and later
|
1175
1227
|
StyleGuide: '#chefmodernizerespondtoinmetadata'
|
1176
1228
|
Enabled: true
|
@@ -1178,7 +1230,7 @@ ChefModernize/RespondToInMetadata:
|
|
1178
1230
|
Include:
|
1179
1231
|
- '**/metadata.rb'
|
1180
1232
|
|
1181
|
-
|
1233
|
+
Chef/Modernize/RespondToResourceName:
|
1182
1234
|
Description: respond_to?(:resource_name) in resources is no longer necessary in Chef Infra Client 12.5+
|
1183
1235
|
StyleGuide: '#chefmodernizerespondtoresourcename'
|
1184
1236
|
Enabled: true
|
@@ -1187,16 +1239,17 @@ ChefModernize/RespondToResourceName:
|
|
1187
1239
|
- '**/resources/*.rb'
|
1188
1240
|
- '**/libraries/*.rb'
|
1189
1241
|
|
1190
|
-
|
1242
|
+
Chef/Modernize/RespondToProvides:
|
1191
1243
|
Description: respond_to?(:provides) in resources is no longer necessary in Chef Infra Client 12+
|
1192
1244
|
StyleGuide: '#chefmodernizerespondtoprovides'
|
1193
1245
|
Enabled: true
|
1194
1246
|
VersionAdded: '5.2.0'
|
1195
1247
|
Include:
|
1196
1248
|
- '**/providers/*.rb'
|
1249
|
+
- '**/resources/*.rb'
|
1197
1250
|
- '**/libraries/*.rb'
|
1198
1251
|
|
1199
|
-
|
1252
|
+
Chef/Modernize/SetOrReturnInResources:
|
1200
1253
|
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.
|
1201
1254
|
StyleGuide: '#chefmodernizesetorreturninresources'
|
1202
1255
|
Enabled: true
|
@@ -1205,7 +1258,7 @@ ChefModernize/SetOrReturnInResources:
|
|
1205
1258
|
- '**/resources/*.rb'
|
1206
1259
|
- '**/libraries/*.rb'
|
1207
1260
|
|
1208
|
-
|
1261
|
+
Chef/Modernize/CustomResourceWithAttributes:
|
1209
1262
|
Description: Custom Resources should contain properties not attributes.
|
1210
1263
|
StyleGuide: '#chefmodernizecustomresourcewithattributes'
|
1211
1264
|
Enabled: true
|
@@ -1213,7 +1266,7 @@ ChefModernize/CustomResourceWithAttributes:
|
|
1213
1266
|
Include:
|
1214
1267
|
- '**/resources/*.rb'
|
1215
1268
|
|
1216
|
-
|
1269
|
+
Chef/Modernize/IncludingAptDefaultRecipe:
|
1217
1270
|
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.
|
1218
1271
|
StyleGuide: '#chefmodernizeincludingaptdefaultrecipe'
|
1219
1272
|
Enabled: true
|
@@ -1221,7 +1274,7 @@ ChefModernize/IncludingAptDefaultRecipe:
|
|
1221
1274
|
Exclude:
|
1222
1275
|
- '**/metadata.rb'
|
1223
1276
|
|
1224
|
-
|
1277
|
+
Chef/Modernize/IncludingWindowsDefaultRecipe:
|
1225
1278
|
Description: Do not include the Windows default recipe, which only installs win32 gems already included in Chef Infra Client
|
1226
1279
|
StyleGuide: '#chefmodernizeincludingwindowsdefaultrecipe'
|
1227
1280
|
Enabled: true
|
@@ -1229,7 +1282,7 @@ ChefModernize/IncludingWindowsDefaultRecipe:
|
|
1229
1282
|
Exclude:
|
1230
1283
|
- '**/metadata.rb'
|
1231
1284
|
|
1232
|
-
|
1285
|
+
Chef/Modernize/DefinesChefSpecMatchers:
|
1233
1286
|
Description: ChefSpec matchers are now auto generated by ChefSpec 7.1+ and do not need to be defined in a cookbook
|
1234
1287
|
StyleGuide: '#chefmodernizedefineschefspecmatchers'
|
1235
1288
|
Enabled: true
|
@@ -1237,7 +1290,7 @@ ChefModernize/DefinesChefSpecMatchers:
|
|
1237
1290
|
Include:
|
1238
1291
|
- '**/libraries/*.rb'
|
1239
1292
|
|
1240
|
-
|
1293
|
+
Chef/Modernize/ExecuteAptUpdate:
|
1241
1294
|
Description: Use the apt_update resource instead of the execute resource to run an apt-get update package cache update
|
1242
1295
|
StyleGuide: '#chefmodernizeexecuteaptupdate'
|
1243
1296
|
Enabled: true
|
@@ -1245,7 +1298,7 @@ ChefModernize/ExecuteAptUpdate:
|
|
1245
1298
|
Exclude:
|
1246
1299
|
- '**/metadata.rb'
|
1247
1300
|
|
1248
|
-
|
1301
|
+
Chef/Modernize/MinitestHandlerUsage:
|
1249
1302
|
Description: Use Chef InSpec for testing instead of the Minitest Handler cookbook pattern.
|
1250
1303
|
StyleGuide: '#chefmodernizeminitesthandlerusage'
|
1251
1304
|
Enabled: true
|
@@ -1253,7 +1306,7 @@ ChefModernize/MinitestHandlerUsage:
|
|
1253
1306
|
Include:
|
1254
1307
|
- '**/metadata.rb'
|
1255
1308
|
|
1256
|
-
|
1309
|
+
Chef/Modernize/IncludingMixinShelloutInResources:
|
1257
1310
|
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+.
|
1258
1311
|
StyleGuide: '#chefmodernizeincludingmixinshelloutinresources'
|
1259
1312
|
Enabled: true
|
@@ -1263,7 +1316,7 @@ ChefModernize/IncludingMixinShelloutInResources:
|
|
1263
1316
|
- '**/providers/*.rb'
|
1264
1317
|
- '**/libraries/*.rb'
|
1265
1318
|
|
1266
|
-
|
1319
|
+
Chef/Modernize/UseBuildEssentialResource:
|
1267
1320
|
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+
|
1268
1321
|
StyleGuide: '#chefmodernizeusebuildessentialresource'
|
1269
1322
|
Enabled: true
|
@@ -1271,7 +1324,7 @@ ChefModernize/UseBuildEssentialResource:
|
|
1271
1324
|
Exclude:
|
1272
1325
|
- '**/metadata.rb'
|
1273
1326
|
|
1274
|
-
|
1327
|
+
Chef/Modernize/WindowsZipfileUsage:
|
1275
1328
|
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook
|
1276
1329
|
StyleGuide: '#chefmodernizewindowszipfileusage'
|
1277
1330
|
Enabled: true
|
@@ -1279,7 +1332,7 @@ ChefModernize/WindowsZipfileUsage:
|
|
1279
1332
|
Exclude:
|
1280
1333
|
- '**/metadata.rb'
|
1281
1334
|
|
1282
|
-
|
1335
|
+
Chef/Modernize/SevenZipArchiveResource:
|
1283
1336
|
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the seven_zip_archive
|
1284
1337
|
StyleGuide: '#chefmodernizesevenziparchiveresource'
|
1285
1338
|
Enabled: true
|
@@ -1287,7 +1340,7 @@ ChefModernize/SevenZipArchiveResource:
|
|
1287
1340
|
Exclude:
|
1288
1341
|
- '**/metadata.rb'
|
1289
1342
|
|
1290
|
-
|
1343
|
+
Chef/Modernize/LibarchiveFileResource:
|
1291
1344
|
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the libarchive file resource
|
1292
1345
|
StyleGuide: '#chefmodernizelibarchivefileresource'
|
1293
1346
|
Enabled: true
|
@@ -1295,7 +1348,7 @@ ChefModernize/LibarchiveFileResource:
|
|
1295
1348
|
Exclude:
|
1296
1349
|
- '**/metadata.rb'
|
1297
1350
|
|
1298
|
-
|
1351
|
+
Chef/Modernize/PowershellScriptExpandArchive:
|
1299
1352
|
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of using Expand-Archive in a powershell_script resource
|
1300
1353
|
StyleGuide: '#chefmodernizepowershellscriptexpandarchive'
|
1301
1354
|
Enabled: true
|
@@ -1303,7 +1356,7 @@ ChefModernize/PowershellScriptExpandArchive:
|
|
1303
1356
|
Exclude:
|
1304
1357
|
- '**/metadata.rb'
|
1305
1358
|
|
1306
|
-
|
1359
|
+
Chef/Modernize/PowershellInstallPackage:
|
1307
1360
|
Description: Use the package resource built into Chef Infra Client instead of using Install-Package in a powershell_script resource
|
1308
1361
|
StyleGuide: '#chefmodernizepowershellinstallpackage'
|
1309
1362
|
Enabled: true
|
@@ -1311,7 +1364,7 @@ ChefModernize/PowershellInstallPackage:
|
|
1311
1364
|
Exclude:
|
1312
1365
|
- '**/metadata.rb'
|
1313
1366
|
|
1314
|
-
|
1367
|
+
Chef/Modernize/PowershellInstallWindowsFeature:
|
1315
1368
|
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
|
1316
1369
|
StyleGuide: '#chefmodernizepowershellinstallwindowsfeature'
|
1317
1370
|
Enabled: true
|
@@ -1319,7 +1372,7 @@ ChefModernize/PowershellInstallWindowsFeature:
|
|
1319
1372
|
Exclude:
|
1320
1373
|
- '**/metadata.rb'
|
1321
1374
|
|
1322
|
-
|
1375
|
+
Chef/Modernize/ShellOutToChocolatey:
|
1323
1376
|
Description: Use the Chocolatey resources built into Chef Infra Client instead of shelling out to the choco command
|
1324
1377
|
StyleGuide: '#chefmodernizeshellouttochocolatey'
|
1325
1378
|
Enabled: true
|
@@ -1327,7 +1380,7 @@ ChefModernize/ShellOutToChocolatey:
|
|
1327
1380
|
Exclude:
|
1328
1381
|
- '**/metadata.rb'
|
1329
1382
|
|
1330
|
-
|
1383
|
+
Chef/Modernize/CronManageResource:
|
1331
1384
|
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.
|
1332
1385
|
StyleGuide: '#chefmodernizecronmanageresource'
|
1333
1386
|
Enabled: true
|
@@ -1335,7 +1388,7 @@ ChefModernize/CronManageResource:
|
|
1335
1388
|
Exclude:
|
1336
1389
|
- '**/metadata.rb'
|
1337
1390
|
|
1338
|
-
|
1391
|
+
Chef/Modernize/UsesZypperRepo:
|
1339
1392
|
Description: The zypper_repo resource was renamed zypper_repository when it was added to Chef Infra Client 13.3.
|
1340
1393
|
StyleGuide: '#chefmodernizeuseszypperrepo'
|
1341
1394
|
Enabled: true
|
@@ -1343,7 +1396,7 @@ ChefModernize/UsesZypperRepo:
|
|
1343
1396
|
Exclude:
|
1344
1397
|
- '**/metadata.rb'
|
1345
1398
|
|
1346
|
-
|
1399
|
+
Chef/Modernize/DependsOnZypperCookbook:
|
1347
1400
|
Description: Don't include the zypper cookbook as the zypper_repository resource is built into Chef Infra Client 13.3+
|
1348
1401
|
StyleGuide: '#chefmodernizedependsonzyppercookbook'
|
1349
1402
|
Enabled: true
|
@@ -1351,7 +1404,7 @@ ChefModernize/DependsOnZypperCookbook:
|
|
1351
1404
|
Exclude:
|
1352
1405
|
- '**/metadata.rb'
|
1353
1406
|
|
1354
|
-
|
1407
|
+
Chef/Modernize/ExecuteTzUtil:
|
1355
1408
|
Description: Use the timezone resource included in Chef Infra Client 14.6+ instead of shelling out to tzutil
|
1356
1409
|
StyleGuide: '#chefmodernizeexecutetzutil'
|
1357
1410
|
Enabled: true
|
@@ -1359,7 +1412,7 @@ ChefModernize/ExecuteTzUtil:
|
|
1359
1412
|
Exclude:
|
1360
1413
|
- '**/metadata.rb'
|
1361
1414
|
|
1362
|
-
|
1415
|
+
Chef/Modernize/OpensslRsaKeyResource:
|
1363
1416
|
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.
|
1364
1417
|
StyleGuide: '#chefmodernizeopensslrsakeyresource'
|
1365
1418
|
Enabled: true
|
@@ -1367,7 +1420,7 @@ ChefModernize/OpensslRsaKeyResource:
|
|
1367
1420
|
Exclude:
|
1368
1421
|
- '**/metadata.rb'
|
1369
1422
|
|
1370
|
-
|
1423
|
+
Chef/Modernize/OpensslX509Resource:
|
1371
1424
|
Description: The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4. The new resource name should be used.
|
1372
1425
|
StyleGuide: '#chefmodernizeopensslx509resource'
|
1373
1426
|
Enabled: true
|
@@ -1375,7 +1428,7 @@ ChefModernize/OpensslX509Resource:
|
|
1375
1428
|
Exclude:
|
1376
1429
|
- '**/metadata.rb'
|
1377
1430
|
|
1378
|
-
|
1431
|
+
Chef/Modernize/OsxConfigProfileResource:
|
1379
1432
|
Description: The osx_config_profile resource was renamed to osx_profile. The new resource name should be used.
|
1380
1433
|
StyleGuide: '#chefmodernizeosxconfigprofileresource'
|
1381
1434
|
Enabled: true
|
@@ -1383,7 +1436,7 @@ ChefModernize/OsxConfigProfileResource:
|
|
1383
1436
|
Exclude:
|
1384
1437
|
- '**/metadata.rb'
|
1385
1438
|
|
1386
|
-
|
1439
|
+
Chef/Modernize/SysctlParamResource:
|
1387
1440
|
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.
|
1388
1441
|
StyleGuide: '#chefmodernizesysctlparamresource'
|
1389
1442
|
Enabled: true
|
@@ -1391,7 +1444,7 @@ ChefModernize/SysctlParamResource:
|
|
1391
1444
|
Exclude:
|
1392
1445
|
- '**/metadata.rb'
|
1393
1446
|
|
1394
|
-
|
1447
|
+
Chef/Modernize/MacOsXUserdefaults:
|
1395
1448
|
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.
|
1396
1449
|
StyleGuide: '#chefmodernizemacosxuserdefaults'
|
1397
1450
|
Enabled: true
|
@@ -1399,7 +1452,7 @@ ChefModernize/MacOsXUserdefaults:
|
|
1399
1452
|
Exclude:
|
1400
1453
|
- '**/metadata.rb'
|
1401
1454
|
|
1402
|
-
|
1455
|
+
Chef/Modernize/PowerShellGuardInterpreter:
|
1403
1456
|
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.
|
1404
1457
|
StyleGuide: '#chefmodernizepowershellguardinterpreter'
|
1405
1458
|
Enabled: true
|
@@ -1407,7 +1460,7 @@ ChefModernize/PowerShellGuardInterpreter:
|
|
1407
1460
|
Exclude:
|
1408
1461
|
- '**/metadata.rb'
|
1409
1462
|
|
1410
|
-
|
1463
|
+
Chef/Modernize/DefaultActionFromInitialize:
|
1411
1464
|
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.
|
1412
1465
|
StyleGuide: '#chefmodernizedefaultactionfrominitialize'
|
1413
1466
|
Enabled: true
|
@@ -1417,7 +1470,7 @@ ChefModernize/DefaultActionFromInitialize:
|
|
1417
1470
|
- '**/providers/*.rb'
|
1418
1471
|
- '**/libraries/*.rb'
|
1419
1472
|
|
1420
|
-
|
1473
|
+
Chef/Modernize/ResourceNameFromInitialize:
|
1421
1474
|
Description: The name of a resource can be set with the "resource_name" helper instead of using the initialize method.
|
1422
1475
|
StyleGuide: '#chefmodernizeresourcenamefrominitialize'
|
1423
1476
|
Enabled: true
|
@@ -1427,7 +1480,7 @@ ChefModernize/ResourceNameFromInitialize:
|
|
1427
1480
|
- '**/providers/*.rb'
|
1428
1481
|
- '**/libraries/*.rb'
|
1429
1482
|
|
1430
|
-
|
1483
|
+
Chef/Modernize/Definitions:
|
1431
1484
|
Description: Legacy Chef Infra definitions should be rewritten as custom resources to take full advantage of the Chef Infra feature set.
|
1432
1485
|
StyleGuide: '#chefmodernizedefinitions'
|
1433
1486
|
Enabled: true
|
@@ -1435,7 +1488,7 @@ ChefModernize/Definitions:
|
|
1435
1488
|
Include:
|
1436
1489
|
- '**/definitions/*.rb'
|
1437
1490
|
|
1438
|
-
|
1491
|
+
Chef/Modernize/IfProvidesDefaultAction:
|
1439
1492
|
Description: if defined?(default_action) is no longer necessary in Chef Infra resources as default_action shipped in Chef Infra Client 10.8.
|
1440
1493
|
StyleGuide: '#chefmodernizeifprovidesdefaultaction'
|
1441
1494
|
Enabled: true
|
@@ -1444,13 +1497,13 @@ ChefModernize/IfProvidesDefaultAction:
|
|
1444
1497
|
- '**/resources/*.rb'
|
1445
1498
|
- '**/libraries/*.rb'
|
1446
1499
|
|
1447
|
-
|
1500
|
+
Chef/Modernize/ZipfileResource:
|
1448
1501
|
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the zipfile resource from the zipfile cookbook.
|
1449
1502
|
StyleGuide: '#chefmodernizezipfileresource'
|
1450
1503
|
Enabled: true
|
1451
1504
|
VersionAdded: '5.12.0'
|
1452
1505
|
|
1453
|
-
|
1506
|
+
Chef/Modernize/UnnecessaryMixlibShelloutRequire:
|
1454
1507
|
Description: Chef Infra Client 12.4 and later include mixlib/shellout automatically in resources and providers.
|
1455
1508
|
StyleGuide: '#chefmodernizeunnecessarymixlibshelloutrequire'
|
1456
1509
|
Enabled: true
|
@@ -1459,7 +1512,7 @@ ChefModernize/UnnecessaryMixlibShelloutRequire:
|
|
1459
1512
|
- '**/resources/*.rb'
|
1460
1513
|
- '**/providers/*.rb'
|
1461
1514
|
|
1462
|
-
|
1515
|
+
Chef/Modernize/EmptyResourceInitializeMethod:
|
1463
1516
|
Description: There is no need for an empty initialize method in a resource
|
1464
1517
|
StyleGuide: '#chefmodernizeemptyresourceinitializemethod'
|
1465
1518
|
Enabled: true
|
@@ -1468,7 +1521,7 @@ ChefModernize/EmptyResourceInitializeMethod:
|
|
1468
1521
|
- '**/resources/*.rb'
|
1469
1522
|
- '**/providers/*.rb'
|
1470
1523
|
|
1471
|
-
|
1524
|
+
Chef/Modernize/ChefGemNokogiri:
|
1472
1525
|
Description: The nokogiri gem ships in Chef Infra Client 12+ and does not need to be installed before being used.
|
1473
1526
|
StyleGuide: '#chefmodernizechefgemnokogiri'
|
1474
1527
|
Enabled: true
|
@@ -1477,7 +1530,7 @@ ChefModernize/ChefGemNokogiri:
|
|
1477
1530
|
- '**/metadata.rb'
|
1478
1531
|
- '**/attributes/*.rb'
|
1479
1532
|
|
1480
|
-
|
1533
|
+
Chef/Modernize/PropertyWithNameAttribute:
|
1481
1534
|
Description: Resource property sets name_attribute not name_property
|
1482
1535
|
StyleGuide: '#chefmodernizepropertywithnameattribute'
|
1483
1536
|
Enabled: true
|
@@ -1487,7 +1540,7 @@ ChefModernize/PropertyWithNameAttribute:
|
|
1487
1540
|
- '**/resources/*.rb'
|
1488
1541
|
- '**/libraries/*.rb'
|
1489
1542
|
|
1490
|
-
|
1543
|
+
Chef/Modernize/IncludingOhaiDefaultRecipe:
|
1491
1544
|
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.
|
1492
1545
|
StyleGuide: '#chefmodernizeincludingohaidefaultrecipe'
|
1493
1546
|
Enabled: true
|
@@ -1497,7 +1550,7 @@ ChefModernize/IncludingOhaiDefaultRecipe:
|
|
1497
1550
|
- '**/metadata.rb'
|
1498
1551
|
- '**/Berksfile'
|
1499
1552
|
|
1500
|
-
|
1553
|
+
Chef/Modernize/AllowedActionsFromInitialize:
|
1501
1554
|
Description: The allowed actions of a resource can be set with the "allowed_actions" helper instead of using the initialize method.
|
1502
1555
|
StyleGuide: '#chefmodernizeallowedactionsfrominitialize'
|
1503
1556
|
Enabled: true
|
@@ -1506,7 +1559,7 @@ ChefModernize/AllowedActionsFromInitialize:
|
|
1506
1559
|
- '**/resources/*.rb'
|
1507
1560
|
- '**/libraries/*.rb'
|
1508
1561
|
|
1509
|
-
|
1562
|
+
Chef/Modernize/FoodcriticComments:
|
1510
1563
|
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.
|
1511
1564
|
StyleGuide: '#chefmodernizefoodcriticcomments'
|
1512
1565
|
Enabled: true
|
@@ -1514,7 +1567,7 @@ ChefModernize/FoodcriticComments:
|
|
1514
1567
|
Exclude:
|
1515
1568
|
- '**/Berksfile'
|
1516
1569
|
|
1517
|
-
|
1570
|
+
Chef/Modernize/ExecuteScExe:
|
1518
1571
|
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
|
1519
1572
|
StyleGuide: '#chefmodernizeexecutescexe'
|
1520
1573
|
Enabled: true
|
@@ -1524,7 +1577,7 @@ ChefModernize/ExecuteScExe:
|
|
1524
1577
|
- '**/attributes/*.rb'
|
1525
1578
|
- '**/Berksfile'
|
1526
1579
|
|
1527
|
-
|
1580
|
+
Chef/Modernize/WindowsScResource:
|
1528
1581
|
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.
|
1529
1582
|
StyleGuide: '#chefmodernizewindowsscresource'
|
1530
1583
|
Enabled: true
|
@@ -1534,7 +1587,7 @@ ChefModernize/WindowsScResource:
|
|
1534
1587
|
- '**/attributes/*.rb'
|
1535
1588
|
- '**/Berksfile'
|
1536
1589
|
|
1537
|
-
|
1590
|
+
Chef/Modernize/ExecuteSleep:
|
1538
1591
|
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.
|
1539
1592
|
StyleGuide: '#chefmodernizeexecutesleep'
|
1540
1593
|
Enabled: true
|
@@ -1544,7 +1597,7 @@ ChefModernize/ExecuteSleep:
|
|
1544
1597
|
- '**/attributes/*.rb'
|
1545
1598
|
- '**/Berksfile'
|
1546
1599
|
|
1547
|
-
|
1600
|
+
Chef/Modernize/DslIncludeInResource:
|
1548
1601
|
Description: 'There is no need to include Chef::DSL::Recipe or Chef::DSL::IncludeRecipe classes in resources or providers as this is done automatically.'
|
1549
1602
|
StyleGuide: '#chefmodernizedslincludeinresource'
|
1550
1603
|
Enabled: true
|
@@ -1553,7 +1606,7 @@ ChefModernize/DslIncludeInResource:
|
|
1553
1606
|
- '**/resources/*.rb'
|
1554
1607
|
- '**/providers/*.rb'
|
1555
1608
|
|
1556
|
-
|
1609
|
+
Chef/Modernize/ResourceForcingCompileTime:
|
1557
1610
|
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`.
|
1558
1611
|
StyleGuide: '#chefmodernizeresourceforcingcompiletime'
|
1559
1612
|
Enabled: true
|
@@ -1563,7 +1616,7 @@ ChefModernize/ResourceForcingCompileTime:
|
|
1563
1616
|
- '**/attributes/*.rb'
|
1564
1617
|
- '**/Berksfile'
|
1565
1618
|
|
1566
|
-
|
1619
|
+
Chef/Modernize/ExecuteSysctl:
|
1567
1620
|
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.
|
1568
1621
|
StyleGuide: '#chefmodernizeexecutesysctl'
|
1569
1622
|
Enabled: true
|
@@ -1573,7 +1626,7 @@ ChefModernize/ExecuteSysctl:
|
|
1573
1626
|
- '**/attributes/*.rb'
|
1574
1627
|
- '**/Berksfile'
|
1575
1628
|
|
1576
|
-
|
1629
|
+
Chef/Modernize/SimplifyAptPpaSetup:
|
1577
1630
|
Description: The apt_repository resource allows setting up PPAs without using the full URL to ppa.launchpad.net.
|
1578
1631
|
StyleGuide: '#chefmodernizesimplifyaptppasetup'
|
1579
1632
|
Enabled: true
|
@@ -1583,7 +1636,7 @@ ChefModernize/SimplifyAptPpaSetup:
|
|
1583
1636
|
- '**/attributes/*.rb'
|
1584
1637
|
- '**/Berksfile'
|
1585
1638
|
|
1586
|
-
|
1639
|
+
Chef/Modernize/UseRequireRelative:
|
1587
1640
|
Description: Instead of using require with a File.expand_path and __FILE__ use the simpler require_relative method.
|
1588
1641
|
StyleGuide: '#chefmodernizeuserequirerelative'
|
1589
1642
|
Enabled: true
|
@@ -1593,7 +1646,7 @@ ChefModernize/UseRequireRelative:
|
|
1593
1646
|
- '**/attributes/*.rb'
|
1594
1647
|
- '**/Berksfile'
|
1595
1648
|
|
1596
|
-
|
1649
|
+
Chef/Modernize/NodeInitPackage:
|
1597
1650
|
Description: Use node['init_package'] to check for systemd instead of reading the contents of '/proc/1/comm'
|
1598
1651
|
StyleGuide: '#chefmodernizenodeinitpackage'
|
1599
1652
|
Enabled: true
|
@@ -1602,7 +1655,7 @@ ChefModernize/NodeInitPackage:
|
|
1602
1655
|
- '**/metadata.rb'
|
1603
1656
|
- '**/Berksfile'
|
1604
1657
|
|
1605
|
-
|
1658
|
+
Chef/Modernize/WindowsRegistryUAC:
|
1606
1659
|
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.
|
1607
1660
|
StyleGuide: '#chefmodernizewindowsregistryuac'
|
1608
1661
|
Enabled: true
|
@@ -1612,7 +1665,7 @@ ChefModernize/WindowsRegistryUAC:
|
|
1612
1665
|
- '**/attributes/*.rb'
|
1613
1666
|
- '**/Berksfile'
|
1614
1667
|
|
1615
|
-
|
1668
|
+
Chef/Modernize/UseMultipackageInstalls:
|
1616
1669
|
Description: Pass an array of packages to package resources instead of iterating over an array of packages when using multi-package capable package subsystem such as apt, yum, chocolatey, dnf, or zypper. Multi-package installs are faster and simplify logs.
|
1617
1670
|
StyleGuide: '#chefmodernizeusemultipackageinstalls'
|
1618
1671
|
Enabled: true
|
@@ -1622,7 +1675,7 @@ ChefModernize/UseMultipackageInstalls:
|
|
1622
1675
|
- '**/attributes/*.rb'
|
1623
1676
|
- '**/Berksfile'
|
1624
1677
|
|
1625
|
-
|
1678
|
+
Chef/Modernize/ProvidesFromInitialize:
|
1626
1679
|
Description: Provides should be set using the `provides` resource DSL method instead of instead of setting @provides in the initialize method.
|
1627
1680
|
StyleGuide: '#chefmodernizeprovidesfrominitialize'
|
1628
1681
|
Enabled: true
|
@@ -1632,7 +1685,7 @@ ChefModernize/ProvidesFromInitialize:
|
|
1632
1685
|
- '**/providers/*.rb'
|
1633
1686
|
- '**/libraries/*.rb'
|
1634
1687
|
|
1635
|
-
|
1688
|
+
Chef/Modernize/DatabagHelpers:
|
1636
1689
|
Description: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`.
|
1637
1690
|
StyleGuide: '#chefmodernizedatabaghelpers'
|
1638
1691
|
Enabled: true
|
@@ -1641,7 +1694,7 @@ ChefModernize/DatabagHelpers:
|
|
1641
1694
|
- '**/metadata.rb'
|
1642
1695
|
- '**/Berksfile'
|
1643
1696
|
|
1644
|
-
|
1697
|
+
Chef/Modernize/NodeRolesInclude:
|
1645
1698
|
Description: Use `node.role?('foo')` to check if a node includes a role instead of `node['roles'].include?('foo')`.
|
1646
1699
|
StyleGuide: '#chefmodernizenoderolesinclude'
|
1647
1700
|
Enabled: true
|
@@ -1650,7 +1703,7 @@ ChefModernize/NodeRolesInclude:
|
|
1650
1703
|
- '**/metadata.rb'
|
1651
1704
|
- '**/Berksfile'
|
1652
1705
|
|
1653
|
-
|
1706
|
+
Chef/Modernize/RespondToCompileTime:
|
1654
1707
|
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.
|
1655
1708
|
StyleGuide: '#chefmodernizeresondtocompiletime'
|
1656
1709
|
Enabled: true
|
@@ -1659,7 +1712,7 @@ ChefModernize/RespondToCompileTime:
|
|
1659
1712
|
- '**/metadata.rb'
|
1660
1713
|
- '**/Berksfile'
|
1661
1714
|
|
1662
|
-
|
1715
|
+
Chef/Modernize/ShellOutHelper:
|
1663
1716
|
Description: Use the built-in shell_out helper available in Chef Infra Client 12.11+ instead of calling Mixlib::ShellOut.new('foo').run_command.
|
1664
1717
|
StyleGuide: '#chefmodernizeshellouthelper'
|
1665
1718
|
Enabled: true
|
@@ -1669,7 +1722,7 @@ ChefModernize/ShellOutHelper:
|
|
1669
1722
|
- '**/Berksfile'
|
1670
1723
|
- '**/libraries/*.rb'
|
1671
1724
|
|
1672
|
-
|
1725
|
+
Chef/Modernize/ConditionalUsingTest:
|
1673
1726
|
Description: Use ::File.exist?('/foo/bar') instead of the slower 'test -f /foo/bar' which requires shelling out.
|
1674
1727
|
StyleGuide: '#chefmodernizeconditionalusingtest'
|
1675
1728
|
Enabled: true
|
@@ -1679,7 +1732,7 @@ ChefModernize/ConditionalUsingTest:
|
|
1679
1732
|
- '**/Berksfile'
|
1680
1733
|
- '**/attributes/*.rb'
|
1681
1734
|
|
1682
|
-
|
1735
|
+
Chef/Modernize/CronDFileOrTemplate:
|
1683
1736
|
Description: Use the cron_d resource that ships with Chef Infra Client 14.4+ instead of manually creating the file with template, file, or cookbook_file resources
|
1684
1737
|
StyleGuide: '#chefmodernizecrondfileortemplate'
|
1685
1738
|
Enabled: true
|
@@ -1689,7 +1742,7 @@ ChefModernize/CronDFileOrTemplate:
|
|
1689
1742
|
- '**/Berksfile'
|
1690
1743
|
- '**/attributes/*.rb'
|
1691
1744
|
|
1692
|
-
|
1745
|
+
Chef/Modernize/ActionMethodInResource:
|
1693
1746
|
Description: Use the custom resource language's `action :my_action` blocks instead of creating actions with methods.
|
1694
1747
|
StyleGuide: '#chefmodernizeactionmethodinresource'
|
1695
1748
|
Enabled: true
|
@@ -1697,16 +1750,15 @@ ChefModernize/ActionMethodInResource:
|
|
1697
1750
|
Include:
|
1698
1751
|
- '**/resources/*.rb'
|
1699
1752
|
- '**/providers/*.rb'
|
1700
|
-
- '**/libraries/*.rb'
|
1701
1753
|
|
1702
1754
|
###############################
|
1703
|
-
#
|
1755
|
+
# Chef/RedundantCode: Cleanup unnecessary code in your cookbooks regardless of Chef Infra Client release
|
1704
1756
|
###############################
|
1705
1757
|
|
1706
|
-
|
1707
|
-
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/
|
1758
|
+
Chef/RedundantCode:
|
1759
|
+
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chef_redundantcode.md
|
1708
1760
|
|
1709
|
-
|
1761
|
+
Chef/RedundantCode/ConflictsMetadata:
|
1710
1762
|
Description: Don't use the deprecated 'conflicts' metadata value
|
1711
1763
|
StyleGuide: '#chefredundantcodeconflictsmetadata'
|
1712
1764
|
Enabled: true
|
@@ -1715,7 +1767,7 @@ ChefRedundantCode/ConflictsMetadata:
|
|
1715
1767
|
Include:
|
1716
1768
|
- '**/metadata.rb'
|
1717
1769
|
|
1718
|
-
|
1770
|
+
Chef/RedundantCode/SuggestsMetadata:
|
1719
1771
|
Description: The suggests metadata.rb method is not used and is unnecessary in cookbooks.
|
1720
1772
|
StyleGuide: '#chefredundantcodesuggestsmetadata'
|
1721
1773
|
Enabled: true
|
@@ -1724,7 +1776,7 @@ ChefRedundantCode/SuggestsMetadata:
|
|
1724
1776
|
Include:
|
1725
1777
|
- '**/metadata.rb'
|
1726
1778
|
|
1727
|
-
|
1779
|
+
Chef/RedundantCode/ProvidesMetadata:
|
1728
1780
|
Description: The provides metadata.rb method is not used and is unnecessary in cookbooks.
|
1729
1781
|
StyleGuide: '#chefredundantcodeprovidesmetadata'
|
1730
1782
|
Enabled: true
|
@@ -1733,7 +1785,7 @@ ChefRedundantCode/ProvidesMetadata:
|
|
1733
1785
|
Include:
|
1734
1786
|
- '**/metadata.rb'
|
1735
1787
|
|
1736
|
-
|
1788
|
+
Chef/RedundantCode/ReplacesMetadata:
|
1737
1789
|
Description: The replaces metadata.rb method is not used and is unnecessary in cookbooks.
|
1738
1790
|
StyleGuide: '#chefredundantcodereplacesmetadata'
|
1739
1791
|
Enabled: true
|
@@ -1742,7 +1794,7 @@ ChefRedundantCode/ReplacesMetadata:
|
|
1742
1794
|
Include:
|
1743
1795
|
- '**/metadata.rb'
|
1744
1796
|
|
1745
|
-
|
1797
|
+
Chef/RedundantCode/AttributeMetadata:
|
1746
1798
|
Description: The attribute metadata.rb method is not used and is unnecessary in cookbooks.
|
1747
1799
|
StyleGuide: '#chefredundantcodeattributemetadata'
|
1748
1800
|
Enabled: true
|
@@ -1751,7 +1803,7 @@ ChefRedundantCode/AttributeMetadata:
|
|
1751
1803
|
Include:
|
1752
1804
|
- '**/metadata.rb'
|
1753
1805
|
|
1754
|
-
|
1806
|
+
Chef/RedundantCode/LongDescriptionMetadata:
|
1755
1807
|
Description: The long_description metadata.rb method is not used and is unnecessary in cookbooks
|
1756
1808
|
StyleGuide: '#chefredundantcodelongdescriptionmetadata'
|
1757
1809
|
Enabled: true
|
@@ -1760,7 +1812,7 @@ ChefRedundantCode/LongDescriptionMetadata:
|
|
1760
1812
|
Include:
|
1761
1813
|
- '**/metadata.rb'
|
1762
1814
|
|
1763
|
-
|
1815
|
+
Chef/RedundantCode/RecipeMetadata:
|
1764
1816
|
Description: The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the README.md file instead.
|
1765
1817
|
StyleGuide: '#chefredundantcoderecipemetadata'
|
1766
1818
|
Enabled: true
|
@@ -1769,7 +1821,7 @@ ChefRedundantCode/RecipeMetadata:
|
|
1769
1821
|
Include:
|
1770
1822
|
- '**/metadata.rb'
|
1771
1823
|
|
1772
|
-
|
1824
|
+
Chef/RedundantCode/ResourceWithNothingAction:
|
1773
1825
|
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.
|
1774
1826
|
StyleGuide: '#chefredundantcoderesourcewithnothingaction'
|
1775
1827
|
Enabled: true
|
@@ -1780,7 +1832,7 @@ ChefRedundantCode/ResourceWithNothingAction:
|
|
1780
1832
|
- '**/resources/*.rb'
|
1781
1833
|
- '**/providers/*.rb'
|
1782
1834
|
|
1783
|
-
|
1835
|
+
Chef/RedundantCode/UnnecessaryNameProperty:
|
1784
1836
|
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.
|
1785
1837
|
StyleGuide: '#chefredundantcodeunnecessarynameproperty'
|
1786
1838
|
Enabled: true
|
@@ -1790,7 +1842,7 @@ ChefRedundantCode/UnnecessaryNameProperty:
|
|
1790
1842
|
- '**/resources/*.rb'
|
1791
1843
|
- '**/libraries/*.rb'
|
1792
1844
|
|
1793
|
-
|
1845
|
+
Chef/RedundantCode/PropertyWithRequiredAndDefault:
|
1794
1846
|
Description: Resource property should not be both required and have a default value
|
1795
1847
|
StyleGuide: '#chefredundantcodepropertywithrequiredanddefault'
|
1796
1848
|
Enabled: true
|
@@ -1800,7 +1852,7 @@ ChefRedundantCode/PropertyWithRequiredAndDefault:
|
|
1800
1852
|
- '**/resources/*.rb'
|
1801
1853
|
- '**/libraries/*.rb'
|
1802
1854
|
|
1803
|
-
|
1855
|
+
Chef/RedundantCode/NamePropertyIsRequired:
|
1804
1856
|
Description: Resource properties marked as name properties should not also be required properties
|
1805
1857
|
StyleGuide: '#chefredundantcodenamepropertyisrequired'
|
1806
1858
|
Enabled: true
|
@@ -1810,7 +1862,7 @@ ChefRedundantCode/NamePropertyIsRequired:
|
|
1810
1862
|
- '**/resources/*.rb'
|
1811
1863
|
- '**/libraries/*.rb'
|
1812
1864
|
|
1813
|
-
|
1865
|
+
Chef/RedundantCode/CustomResourceWithAllowedActions:
|
1814
1866
|
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.
|
1815
1867
|
StyleGuide: '#chefredundantcodecustomresourcewithallowedactions'
|
1816
1868
|
Enabled: true
|
@@ -1819,7 +1871,7 @@ ChefRedundantCode/CustomResourceWithAllowedActions:
|
|
1819
1871
|
Include:
|
1820
1872
|
- '**/resources/*.rb'
|
1821
1873
|
|
1822
|
-
|
1874
|
+
Chef/RedundantCode/SensitivePropertyInResource:
|
1823
1875
|
Description: Every Chef Infra resources already include a sensitive property with a default value of false.
|
1824
1876
|
StyleGuide: '#chefredundantcodesensitivepropertyinresource'
|
1825
1877
|
Enabled: true
|
@@ -1828,7 +1880,7 @@ ChefRedundantCode/SensitivePropertyInResource:
|
|
1828
1880
|
- '**/resources/*.rb'
|
1829
1881
|
- '**/libraries/*.rb'
|
1830
1882
|
|
1831
|
-
|
1883
|
+
Chef/RedundantCode/UnnecessaryDesiredState:
|
1832
1884
|
Description: 'There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.'
|
1833
1885
|
StyleGuide: '#chefredundantcodeunnecessarydesiredstate'
|
1834
1886
|
Enabled: true
|
@@ -1837,7 +1889,7 @@ ChefRedundantCode/UnnecessaryDesiredState:
|
|
1837
1889
|
- '**/resources/*.rb'
|
1838
1890
|
- '**/libraries/*.rb'
|
1839
1891
|
|
1840
|
-
|
1892
|
+
Chef/RedundantCode/AptRepositoryNotifiesAptUpdate:
|
1841
1893
|
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.
|
1842
1894
|
StyleGuide: '#chefredundantcodeaptrepositorynotifiesaptupdate'
|
1843
1895
|
Enabled: true
|
@@ -1847,7 +1899,7 @@ ChefRedundantCode/AptRepositoryNotifiesAptUpdate:
|
|
1847
1899
|
- '**/attributes/*.rb'
|
1848
1900
|
- '**/Berksfile'
|
1849
1901
|
|
1850
|
-
|
1902
|
+
Chef/RedundantCode/AptRepositoryDistributionDefault:
|
1851
1903
|
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.
|
1852
1904
|
StyleGuide: '#chefredundantcodeaptrepositorydistributiondefault'
|
1853
1905
|
Enabled: true
|
@@ -1857,7 +1909,7 @@ ChefRedundantCode/AptRepositoryDistributionDefault:
|
|
1857
1909
|
- '**/attributes/*.rb'
|
1858
1910
|
- '**/Berksfile'
|
1859
1911
|
|
1860
|
-
|
1912
|
+
Chef/RedundantCode/GroupingMetadata:
|
1861
1913
|
Description: The grouping metadata.rb method is not used and is unnecessary in cookbooks.
|
1862
1914
|
StyleGuide: '#chefredundantcodegroupingmetadata'
|
1863
1915
|
Enabled: true
|
@@ -1865,7 +1917,7 @@ ChefRedundantCode/GroupingMetadata:
|
|
1865
1917
|
Include:
|
1866
1918
|
- '**/metadata.rb'
|
1867
1919
|
|
1868
|
-
|
1920
|
+
Chef/RedundantCode/StringPropertyWithNilDefault:
|
1869
1921
|
Description: Properties have a nil value by default so there is no need to set the default value to nil.
|
1870
1922
|
StyleGuide: '#chefredundantcodestringpropertywithnildefault'
|
1871
1923
|
Enabled: true
|
@@ -1874,7 +1926,7 @@ ChefRedundantCode/StringPropertyWithNilDefault:
|
|
1874
1926
|
- '**/resources/*.rb'
|
1875
1927
|
- '**/libraries/*.rb'
|
1876
1928
|
|
1877
|
-
|
1929
|
+
Chef/RedundantCode/PropertySplatRegex:
|
1878
1930
|
Description: There is no need to validate the input of properties in resources using a regex value that will always pass.
|
1879
1931
|
StyleGuide: '#chefredundantcodepropertysplatregex'
|
1880
1932
|
Enabled: true
|
@@ -1883,7 +1935,7 @@ ChefRedundantCode/PropertySplatRegex:
|
|
1883
1935
|
- '**/resources/*.rb'
|
1884
1936
|
- '**/libraries/*.rb'
|
1885
1937
|
|
1886
|
-
|
1938
|
+
Chef/RedundantCode/UseCreateIfMissing:
|
1887
1939
|
Description: Use the :create_if_missing action instead of not_if with a ::File.exist(FOO) check.
|
1888
1940
|
StyleGuide: '#chefredundantcodeusecreateifmissing'
|
1889
1941
|
Enabled: true
|
@@ -1893,7 +1945,7 @@ ChefRedundantCode/UseCreateIfMissing:
|
|
1893
1945
|
- '**/attributes/*.rb'
|
1894
1946
|
- '**/Berksfile'
|
1895
1947
|
|
1896
|
-
|
1948
|
+
Chef/RedundantCode/OhaiAttributeToString:
|
1897
1949
|
Description: Many Ohai node attributes are already strings and don't need to be cast to strings again
|
1898
1950
|
StyleGuide: '#chefredundantcodeohaiattributetostring'
|
1899
1951
|
Enabled: true
|
@@ -1902,7 +1954,7 @@ ChefRedundantCode/OhaiAttributeToString:
|
|
1902
1954
|
- '**/metadata.rb'
|
1903
1955
|
- '**/Berksfile'
|
1904
1956
|
|
1905
|
-
|
1957
|
+
Chef/RedundantCode/MultiplePlatformChecks:
|
1906
1958
|
Description: You can pass multiple values to the platform? and platform_family? helpers instead of calling the helpers multiple times.
|
1907
1959
|
StyleGuide: '#chefredundantcodemultipleplatformchecks'
|
1908
1960
|
Enabled: true
|
@@ -1911,7 +1963,7 @@ ChefRedundantCode/MultiplePlatformChecks:
|
|
1911
1963
|
- '**/metadata.rb'
|
1912
1964
|
- '**/Berksfile'
|
1913
1965
|
|
1914
|
-
|
1966
|
+
Chef/RedundantCode/DoubleCompileTime:
|
1915
1967
|
Description: If a resource includes the `compile_time` property there's no need to also use `.run_action(:some_action)` on the resource block
|
1916
1968
|
StyleGuide: '#chefredundantcodedoublecompiletime'
|
1917
1969
|
Enabled: true
|
@@ -1922,13 +1974,13 @@ ChefRedundantCode/DoubleCompileTime:
|
|
1922
1974
|
- '**/Berksfile'
|
1923
1975
|
|
1924
1976
|
###############################
|
1925
|
-
#
|
1977
|
+
# Chef/Effortless: Migrating to new patterns
|
1926
1978
|
###############################
|
1927
1979
|
|
1928
|
-
|
1929
|
-
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/
|
1980
|
+
Chef/Effortless:
|
1981
|
+
StyleGuideBaseURL: https://github.com/chef/cookstyle/blob/master/docs/cops_chef_effortless.md
|
1930
1982
|
|
1931
|
-
|
1983
|
+
Chef/Effortless/CookbookUsesSearch:
|
1932
1984
|
Description: Cookbook uses search, which cannot be used in the Effortless Infra pattern
|
1933
1985
|
StyleGuide: '#chefeffortlesscookbookusessearch'
|
1934
1986
|
Enabled: false
|
@@ -1937,7 +1989,7 @@ ChefEffortless/CookbookUsesSearch:
|
|
1937
1989
|
- '**/metadata.rb'
|
1938
1990
|
- '**/Berksfile'
|
1939
1991
|
|
1940
|
-
|
1992
|
+
Chef/Effortless/CookbookUsesDatabags:
|
1941
1993
|
Description: Cookbook uses data bags, which cannot be used in the Effortless Infra pattern
|
1942
1994
|
StyleGuide: '#chefeffortlesscookbookusesdatabags'
|
1943
1995
|
Enabled: false
|
@@ -1947,7 +1999,7 @@ ChefEffortless/CookbookUsesDatabags:
|
|
1947
1999
|
- '**/Berksfile'
|
1948
2000
|
|
1949
2001
|
# https://github.com/chef/cookstyle/issues/346
|
1950
|
-
|
2002
|
+
Chef/Effortless/ChefVaultUsed:
|
1951
2003
|
Description: Cookbook uses Chef Vault, which cannot be used in the Effortless Infra pattern
|
1952
2004
|
StyleGuide: '#chefeffortlesscookbookuseschefvault'
|
1953
2005
|
Enabled: false
|
@@ -1957,7 +2009,7 @@ ChefEffortless/ChefVaultUsed:
|
|
1957
2009
|
- '**/Berksfile'
|
1958
2010
|
|
1959
2011
|
# https://github.com/chef/cookstyle/issues/346
|
1960
|
-
|
2012
|
+
Chef/Effortless/DependsChefVault:
|
1961
2013
|
Description: Cookbook depends on Chef Vault, which cannot be used in the Effortless Infra pattern
|
1962
2014
|
StyleGuide: '#chefeffortlesscookbookdependschefvault'
|
1963
2015
|
Enabled: false
|
@@ -1965,7 +2017,7 @@ ChefEffortless/DependsChefVault:
|
|
1965
2017
|
Include:
|
1966
2018
|
- '**/metadata.rb'
|
1967
2019
|
|
1968
|
-
|
2020
|
+
Chef/Effortless/CookbookUsesEnvironments:
|
1969
2021
|
Description: Cookbook uses environments, which cannot be used in the Effortless Infra pattern
|
1970
2022
|
StyleGuide: '#chefeffortlesscookbookusesenvironments'
|
1971
2023
|
Enabled: false
|
@@ -1974,7 +2026,7 @@ ChefEffortless/CookbookUsesEnvironments:
|
|
1974
2026
|
- '**/metadata.rb'
|
1975
2027
|
- '**/Berksfile'
|
1976
2028
|
|
1977
|
-
|
2029
|
+
Chef/Effortless/CookbookUsesPolicygroups:
|
1978
2030
|
Description: Cookbook uses Policy Groups, which cannot be used in the Effortless Infra pattern
|
1979
2031
|
StyleGuide: '#chefeffortlesscookbookusespolicygroups'
|
1980
2032
|
Enabled: false
|
@@ -1983,7 +2035,7 @@ ChefEffortless/CookbookUsesPolicygroups:
|
|
1983
2035
|
- '**/metadata.rb'
|
1984
2036
|
- '**/Berksfile'
|
1985
2037
|
|
1986
|
-
|
2038
|
+
Chef/Effortless/CookbookUsesRoles:
|
1987
2039
|
Description: Cookbook uses Roles, which cannot be used in the Effortless Infra pattern
|
1988
2040
|
StyleGuide: '#chefeffortlesscookbookusesroles'
|
1989
2041
|
Enabled: false
|
@@ -1992,7 +2044,7 @@ ChefEffortless/CookbookUsesRoles:
|
|
1992
2044
|
- '**/metadata.rb'
|
1993
2045
|
- '**/Berksfile'
|
1994
2046
|
|
1995
|
-
|
2047
|
+
Chef/Effortless/SearchForEnvironmentsOrRoles:
|
1996
2048
|
Description: Cookbook uses search with a node query that looks for a role or environment
|
1997
2049
|
StyleGuide: '#chefeffortlesssearchforenvironmentsorroles'
|
1998
2050
|
Enabled: false
|
@@ -2001,7 +2053,7 @@ ChefEffortless/SearchForEnvironmentsOrRoles:
|
|
2001
2053
|
- '**/metadata.rb'
|
2002
2054
|
- '**/Berksfile'
|
2003
2055
|
|
2004
|
-
|
2056
|
+
Chef/Effortless/Berksfile:
|
2005
2057
|
Description: Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.
|
2006
2058
|
StyleGuide: '#chefeffortlessberksfile'
|
2007
2059
|
Enabled: false
|
@@ -2079,6 +2131,7 @@ Style/EmptyElse:
|
|
2079
2131
|
Enabled: true
|
2080
2132
|
Layout/EmptyLineBetweenDefs:
|
2081
2133
|
Enabled: true
|
2134
|
+
AllowAdjacentOneLineDefs: true
|
2082
2135
|
Layout/EmptyLines:
|
2083
2136
|
Enabled: true
|
2084
2137
|
Layout/EmptyLinesAroundAccessModifier:
|
@@ -2422,10 +2475,9 @@ Metrics/BlockNesting:
|
|
2422
2475
|
Metrics/ParameterLists:
|
2423
2476
|
Enabled: false
|
2424
2477
|
|
2425
|
-
#
|
2426
|
-
# Chef::Recipe.send(:include, ::Apt::Helpers) -> Chef::Recipe.include ::Apt::Helpers
|
2478
|
+
# The warning message from this is misleading and can lead to wrong but syntactically valid code.
|
2427
2479
|
Lint/SendWithMixinArgument:
|
2428
|
-
Enabled:
|
2480
|
+
Enabled: false
|
2429
2481
|
|
2430
2482
|
# this migrates old # rubocop: comments to use the latest namespaces, which prevents a ton of spam during cookstyle runs
|
2431
2483
|
Migration/DepartmentName:
|
@@ -2493,10 +2545,9 @@ Style/EachForSimpleLoop:
|
|
2493
2545
|
Style/EmptyCaseCondition:
|
2494
2546
|
Enabled: true
|
2495
2547
|
|
2496
|
-
#
|
2548
|
+
# It doesn't matter if people use the friendly helpers or not for overall readability
|
2497
2549
|
Style/NumericPredicate:
|
2498
|
-
Enabled:
|
2499
|
-
EnforcedStyle: comparison
|
2550
|
+
Enabled: false
|
2500
2551
|
|
2501
2552
|
# this is bad %w(something another_thing one_more)
|
2502
2553
|
Layout/SpaceInsideArrayPercentLiteral:
|
@@ -2747,4 +2798,8 @@ Style/ExpandPathArguments:
|
|
2747
2798
|
|
2748
2799
|
# Avoid a safe navigation operator if we don't need it
|
2749
2800
|
Lint/RedundantSafeNavigation:
|
2750
|
-
Enabled: true
|
2801
|
+
Enabled: true
|
2802
|
+
|
2803
|
+
# Avoid using blocks to remove nils from a Hash/Array
|
2804
|
+
Style/CollectionCompact:
|
2805
|
+
Enabled: true
|