cookstyle-ng 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +25 -0
- data/LICENSE +201 -0
- data/bin/cookstyle +26 -0
- data/bin/cookstyle-profile +31 -0
- data/config/cookstyle.yml +3248 -0
- data/cookstyle.gemspec +30 -0
- data/lib/cookstyle/version.rb +5 -0
- data/lib/cookstyle.rb +44 -0
- data/lib/rubocop/chef/autocorrect_helpers.rb +33 -0
- data/lib/rubocop/chef/cookbook_helpers.rb +127 -0
- data/lib/rubocop/chef/cookbook_only.rb +76 -0
- data/lib/rubocop/chef/platform_helpers.rb +72 -0
- data/lib/rubocop/chef.rb +11 -0
- data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +61 -0
- data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +56 -0
- data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +69 -0
- data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +55 -0
- data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +77 -0
- data/lib/rubocop/cop/chef/correctness/invalid_cookbook_name.rb +47 -0
- data/lib/rubocop/cop/chef/correctness/invalid_default_action.rb +48 -0
- data/lib/rubocop/cop/chef/correctness/invalid_notification_resource.rb +59 -0
- data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +55 -0
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +72 -0
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +70 -0
- data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +57 -0
- data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +89 -0
- data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +70 -0
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +70 -0
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +69 -0
- data/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +48 -0
- data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +53 -0
- data/lib/rubocop/cop/chef/correctness/lazy_in_resource_guard.rb +67 -0
- data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +67 -0
- data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +67 -0
- data/lib/rubocop/cop/chef/correctness/metadata_malformed_version.rb +58 -0
- data/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +54 -0
- data/lib/rubocop/cop/chef/correctness/metadata_missing_version.rb +51 -0
- data/lib/rubocop/cop/chef/correctness/node_normal.rb +53 -0
- data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +53 -0
- data/lib/rubocop/cop/chef/correctness/node_save.rb +46 -0
- data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +64 -0
- data/lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb +48 -0
- data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +46 -0
- data/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +54 -0
- data/lib/rubocop/cop/chef/correctness/powershell_file_exists.rb +50 -0
- data/lib/rubocop/cop/chef/correctness/property_without_type.rb +59 -0
- data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +51 -0
- data/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +50 -0
- data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +56 -0
- data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +52 -0
- data/lib/rubocop/cop/chef/correctness/service_resource.rb +56 -0
- data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +52 -0
- data/lib/rubocop/cop/chef/correctness/tmp_path.rb +59 -0
- data/lib/rubocop/cop/chef/deprecation/cb_depends_on_self.rb +57 -0
- data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +52 -0
- data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +55 -0
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +57 -0
- data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +98 -0
- data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +83 -0
- data/lib/rubocop/cop/chef/deprecation/chef_sugar_helpers.rb +55 -0
- data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +55 -0
- data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/cheffile.rb +39 -0
- data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +49 -0
- data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +61 -0
- data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/delivery.rb +48 -0
- data/lib/rubocop/cop/chef/deprecation/depends_chef_nginx_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/deprecation/depends_chef_reporting_cookbook.rb +51 -0
- data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +54 -0
- data/lib/rubocop/cop/chef/deprecation/depends_omnibus_updater_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +50 -0
- data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +48 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +129 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +78 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +61 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +64 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_sudo_actions.rb +65 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +42 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_actions.rb +67 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +69 -0
- data/lib/rubocop/cop/chef/deprecation/easy_install.rb +42 -0
- data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +49 -0
- data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +51 -0
- data/lib/rubocop/cop/chef/deprecation/erl_call.rb +42 -0
- data/lib/rubocop/cop/chef/deprecation/execute_path_property.rb +50 -0
- data/lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb +66 -0
- data/lib/rubocop/cop/chef/deprecation/foodcritic_file.rb +41 -0
- data/lib/rubocop/cop/chef/deprecation/foodcritic_testing.rb +43 -0
- data/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb +140 -0
- data/lib/rubocop/cop/chef/deprecation/hwrp_without_unified_mode_true.rb +86 -0
- data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +59 -0
- data/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +91 -0
- data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +53 -0
- data/lib/rubocop/cop/chef/deprecation/librarian_chefspec.rb +42 -0
- data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +46 -0
- data/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb +63 -0
- data/lib/rubocop/cop/chef/deprecation/macos_userdefaults_global_property.rb +60 -0
- data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +60 -0
- data/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +65 -0
- data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +80 -0
- data/lib/rubocop/cop/chef/deprecation/node_set.rb +54 -0
- data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +54 -0
- data/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +70 -0
- data/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +67 -0
- data/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +61 -0
- data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +63 -0
- data/lib/rubocop/cop/chef/deprecation/policyfile_community_source.rb +53 -0
- data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +59 -0
- data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +53 -0
- data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +48 -0
- data/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb +46 -0
- data/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +84 -0
- data/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +40 -0
- data/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb +50 -0
- data/lib/rubocop/cop/chef/deprecation/resource_without_unified_mode_true.rb +87 -0
- data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +56 -0
- data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +62 -0
- data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +63 -0
- data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +136 -0
- data/lib/rubocop/cop/chef/deprecation/use_automatic_resource_name.rb +52 -0
- data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +57 -0
- data/lib/rubocop/cop/chef/deprecation/use_yaml_dump.rb +47 -0
- data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +71 -0
- data/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb +57 -0
- data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +58 -0
- data/lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb +60 -0
- data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +83 -0
- data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +71 -0
- data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +51 -0
- data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +53 -0
- data/lib/rubocop/cop/chef/effortless/berksfile.rb +39 -0
- data/lib/rubocop/cop/chef/effortless/chef_vault_used.rb +87 -0
- data/lib/rubocop/cop/chef/effortless/data_bags.rb +40 -0
- data/lib/rubocop/cop/chef/effortless/depends_chef_vault.rb +47 -0
- data/lib/rubocop/cop/chef/effortless/node_environment.rb +45 -0
- data/lib/rubocop/cop/chef/effortless/node_policygroup.rb +44 -0
- data/lib/rubocop/cop/chef/effortless/node_roles.rb +45 -0
- data/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +43 -0
- data/lib/rubocop/cop/chef/effortless/search_used.rb +40 -0
- data/lib/rubocop/cop/chef/modernize/action_method_in_resource.rb +57 -0
- data/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +77 -0
- data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +70 -0
- data/lib/rubocop/cop/chef/modernize/build_essential.rb +55 -0
- data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +60 -0
- data/lib/rubocop/cop/chef/modernize/chef_15_resources.rb +57 -0
- data/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +63 -0
- data/lib/rubocop/cop/chef/modernize/class_eval_action_class.rb +63 -0
- data/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +53 -0
- data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +55 -0
- data/lib/rubocop/cop/chef/modernize/cron_d_file_or_template.rb +121 -0
- data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +50 -0
- data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +59 -0
- data/lib/rubocop/cop/chef/modernize/declare_action_class.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +74 -0
- data/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/definitions.rb +36 -0
- data/lib/rubocop/cop/chef/modernize/depends_chef_vault_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/depends_chocolatey_cookbooks.rb +55 -0
- data/lib/rubocop/cop/chef/modernize/depends_kernel_module_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/depends_locale_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/depends_openssl_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/depends_timezone_lwrp_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/depends_windows_firewall_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +55 -0
- data/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb +52 -0
- data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +81 -0
- data/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +67 -0
- data/lib/rubocop/cop/chef/modernize/execute_sleep.rb +76 -0
- data/lib/rubocop/cop/chef/modernize/execute_sysctl.rb +70 -0
- data/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +83 -0
- data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +46 -0
- data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +48 -0
- data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +83 -0
- data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +70 -0
- data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +58 -0
- data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +51 -0
- data/lib/rubocop/cop/chef/modernize/node_init_package.rb +89 -0
- data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +57 -0
- data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +47 -0
- data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +54 -0
- data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +60 -0
- data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +51 -0
- data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +50 -0
- data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +68 -0
- data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +53 -0
- data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +56 -0
- data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +56 -0
- data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +68 -0
- data/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +63 -0
- data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +49 -0
- data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +66 -0
- data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +94 -0
- data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +77 -0
- data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +63 -0
- data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +52 -0
- data/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +53 -0
- data/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +46 -0
- data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +60 -0
- data/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +58 -0
- data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +63 -0
- data/lib/rubocop/cop/chef/modernize/sysctl_param_resource.rb +55 -0
- data/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +51 -0
- data/lib/rubocop/cop/chef/modernize/use_chef_language_cloud_helpers.rb +93 -0
- data/lib/rubocop/cop/chef/modernize/use_chef_language_env_helpers.rb +69 -0
- data/lib/rubocop/cop/chef/modernize/use_chef_language_systemd_helper.rb +60 -0
- data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +113 -0
- data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +60 -0
- data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +58 -0
- data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +52 -0
- data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +92 -0
- data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +46 -0
- data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +59 -0
- data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +60 -0
- data/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +65 -0
- data/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb +60 -0
- data/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +52 -0
- data/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +46 -0
- data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +60 -0
- data/lib/rubocop/cop/chef/redundant/double_compile_time.rb +68 -0
- data/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +46 -0
- data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +46 -0
- data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +58 -0
- data/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +81 -0
- data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +65 -0
- data/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +59 -0
- data/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +61 -0
- data/lib/rubocop/cop/chef/redundant/provides_metadata.rb +46 -0
- data/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +47 -0
- data/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +46 -0
- data/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb +52 -0
- data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +50 -0
- data/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +64 -0
- data/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +46 -0
- data/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +60 -0
- data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +67 -0
- data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +116 -0
- data/lib/rubocop/cop/chef/security/ssh_private_key.rb +49 -0
- data/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +50 -0
- data/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +47 -0
- data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +55 -0
- data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +52 -0
- data/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +60 -0
- data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +62 -0
- data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +542 -0
- data/lib/rubocop/cop/chef/style/attribute_keys.rb +95 -0
- data/lib/rubocop/cop/chef/style/chef_whaaat.rb +49 -0
- data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +42 -0
- data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +101 -0
- data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +50 -0
- data/lib/rubocop/cop/chef/style/comments_format.rb +71 -0
- data/lib/rubocop/cop/chef/style/file_mode.rb +86 -0
- data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +59 -0
- data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +58 -0
- data/lib/rubocop/cop/chef/style/negating_only_if.rb +69 -0
- data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +70 -0
- data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +89 -0
- data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +53 -0
- data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +103 -0
- data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +100 -0
- data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +86 -0
- data/lib/rubocop/cop/inspec/deprecation/attribute_default.rb +53 -0
- data/lib/rubocop/cop/inspec/deprecation/attribute_helper.rb +47 -0
- data/lib/rubocop/cop/target_chef_version.rb +22 -0
- data/lib/rubocop/monkey_patches/allow_invalid_ruby.rb +28 -0
- data/lib/rubocop/monkey_patches/base.rb +11 -0
- data/lib/rubocop/monkey_patches/config.rb +15 -0
- data/lib/rubocop/monkey_patches/directive_comment.rb +12 -0
- data/lib/rubocop/monkey_patches/registry_cop.rb +15 -0
- data/lib/rubocop/monkey_patches/team.rb +27 -0
- metadata +340 -0
@@ -0,0 +1,3248 @@
|
|
1
|
+
AllCops:
|
2
|
+
NewCops: disable
|
3
|
+
DisabledByDefault: true
|
4
|
+
SuggestExtensions: false
|
5
|
+
TargetRubyVersion: 2.6
|
6
|
+
TargetChefVersion: ~
|
7
|
+
inherit_mode:
|
8
|
+
merge:
|
9
|
+
- Include
|
10
|
+
Include:
|
11
|
+
- '**/.delivery/project.toml' # required by Chef/Deprecations/Delivery
|
12
|
+
- '**/.delivery/config.json' # required by Chef/Deprecations/Delivery
|
13
|
+
- '**/.foodcritic'
|
14
|
+
Exclude:
|
15
|
+
- '**/files/**/*'
|
16
|
+
- '**/vendor/**/*'
|
17
|
+
- Guardfile
|
18
|
+
|
19
|
+
Layout:
|
20
|
+
Exclude:
|
21
|
+
- '**/.delivery/project.toml'
|
22
|
+
- '**/.delivery/config.json'
|
23
|
+
|
24
|
+
Lint:
|
25
|
+
Exclude:
|
26
|
+
- '**/.delivery/project.toml'
|
27
|
+
- '**/.delivery/config.json'
|
28
|
+
|
29
|
+
Style:
|
30
|
+
Exclude:
|
31
|
+
- '**/.delivery/project.toml'
|
32
|
+
- '**/.delivery/config.json'
|
33
|
+
|
34
|
+
###############################
|
35
|
+
# Chef/Style: Making cookbooks look better
|
36
|
+
###############################
|
37
|
+
|
38
|
+
Chef/Style:
|
39
|
+
Enabled: true
|
40
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
41
|
+
Exclude:
|
42
|
+
- '**/.delivery/project.toml'
|
43
|
+
- '**/.delivery/config.json'
|
44
|
+
|
45
|
+
Chef/Style/AttributeKeys:
|
46
|
+
Description: Check which style of keys are used to access node attributes.
|
47
|
+
StyleGuide: 'chef_style_attributekeys'
|
48
|
+
Enabled: true
|
49
|
+
EnforcedStyle: strings
|
50
|
+
VersionAdded: '5.0.0'
|
51
|
+
SupportedStyles:
|
52
|
+
- strings
|
53
|
+
- symbols
|
54
|
+
Exclude:
|
55
|
+
- '**/metadata.rb'
|
56
|
+
|
57
|
+
Chef/Style/CopyrightCommentFormat:
|
58
|
+
Description: Properly format copyright dates in comment blocks and ensure dates are up to date
|
59
|
+
StyleGuide: 'chef_style_copyrightcommentformat'
|
60
|
+
Enabled: false
|
61
|
+
VersionAdded: '5.0.0'
|
62
|
+
|
63
|
+
Chef/Style/CommentSentenceSpacing:
|
64
|
+
Description: Use a single space after sentences in comments
|
65
|
+
StyleGuide: 'chef_style_commentsentencespacing'
|
66
|
+
Enabled: false
|
67
|
+
VersionAdded: '5.1.0'
|
68
|
+
|
69
|
+
Chef/Style/CommentFormat:
|
70
|
+
Description: Use Chef's unique format for comment headers
|
71
|
+
StyleGuide: 'chef_style_commentformat'
|
72
|
+
Enabled: true
|
73
|
+
VersionAdded: '5.0.0'
|
74
|
+
Exclude:
|
75
|
+
- '**/Berksfile'
|
76
|
+
|
77
|
+
Chef/Style/FileMode:
|
78
|
+
Description: Use strings to represent file modes to avoid confusion between octal and base 10 integer formats.
|
79
|
+
StyleGuide: 'chef_style_filemode'
|
80
|
+
Enabled: true
|
81
|
+
VersionAdded: '5.0.0'
|
82
|
+
Exclude:
|
83
|
+
- '**/attributes/*'
|
84
|
+
- '**/metadata.rb'
|
85
|
+
- '**/Berksfile'
|
86
|
+
|
87
|
+
Chef/Style/UsePlatformHelpers:
|
88
|
+
Description: Use platform? and platform_family? helpers to check node platform in resources and recipes
|
89
|
+
StyleGuide: 'chef_style_useplatformhelpers'
|
90
|
+
Enabled: true
|
91
|
+
VersionAdded: '5.6.0'
|
92
|
+
Exclude:
|
93
|
+
- '**/metadata.rb'
|
94
|
+
- '**/libraries/*'
|
95
|
+
- '**/Berksfile'
|
96
|
+
|
97
|
+
Chef/Style/SimplifyPlatformMajorVersionCheck:
|
98
|
+
Description: Use node['platform_version'].to_i instead of node['platform_version'].split('.').first or node['platform_version'].split('.')[0]
|
99
|
+
StyleGuide: 'chef_style_simplifyplatformmajorversioncheck'
|
100
|
+
Enabled: true
|
101
|
+
VersionAdded: '5.8.0'
|
102
|
+
Exclude:
|
103
|
+
- '**/metadata.rb'
|
104
|
+
- '**/Berksfile'
|
105
|
+
|
106
|
+
Chef/Style/DefaultCopyrightComments:
|
107
|
+
Description: Cookbook copyright comment headers should be updated for a real person or organization.
|
108
|
+
StyleGuide: 'chef_style_defaultcopyrightcomments'
|
109
|
+
Enabled: true
|
110
|
+
VersionAdded: '5.12.0'
|
111
|
+
|
112
|
+
Chef/Style/UnnecessaryPlatformCaseStatement:
|
113
|
+
Description: Use the platform?() and platform_family?() helpers instead of a case statement that only includes a single when statement.
|
114
|
+
StyleGuide: 'chef_style_unnecessaryplatformcasestatement'
|
115
|
+
Enabled: true
|
116
|
+
VersionAdded: '5.16.0'
|
117
|
+
Exclude:
|
118
|
+
- '**/metadata.rb'
|
119
|
+
- '**/Berksfile'
|
120
|
+
|
121
|
+
Chef/Style/ImmediateNotificationTiming:
|
122
|
+
Description: Use :immediately instead of :immediate for resource notification timing.
|
123
|
+
StyleGuide: 'chef_style_immediatenotificationtiming'
|
124
|
+
Enabled: true
|
125
|
+
VersionAdded: '5.16.0'
|
126
|
+
Exclude:
|
127
|
+
- '**/attributes/*.rb'
|
128
|
+
- '**/metadata.rb'
|
129
|
+
- '**/Berksfile'
|
130
|
+
|
131
|
+
Chef/Style/TrueClassFalseClassResourceProperties:
|
132
|
+
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.
|
133
|
+
StyleGuide: 'chef_style_trueclassfalseclassresourceproperties'
|
134
|
+
Enabled: true
|
135
|
+
VersionAdded: '5.16.0'
|
136
|
+
Include:
|
137
|
+
- '**/libraries/*.rb'
|
138
|
+
- '**/resources/*.rb'
|
139
|
+
|
140
|
+
Chef/Style/OverlyComplexSupportsDependsMetadata:
|
141
|
+
Description: Don't loop over an array to set cookbook dependencies or supported platforms if you have fewer than three values to set.
|
142
|
+
StyleGuide: 'chef_style_overcomplexsupportsdependsmetadata'
|
143
|
+
Enabled: true
|
144
|
+
VersionAdded: '5.19.0'
|
145
|
+
Include:
|
146
|
+
- '**/metadata.rb'
|
147
|
+
|
148
|
+
Chef/Style/ChefWhaaat:
|
149
|
+
Description: Do you mean Chef (the company) or a Chef product (e.g. Chef Infra, Chef InSpec, etc)?
|
150
|
+
StyleGuide: 'chef_style_chefwhaaat'
|
151
|
+
Enabled: false
|
152
|
+
VersionAdded: '5.20.0'
|
153
|
+
|
154
|
+
Chef/Style/UnnecessaryOSCheck:
|
155
|
+
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.
|
156
|
+
StyleGuide: 'chef_style_unnecessaryoscheck'
|
157
|
+
Enabled: true
|
158
|
+
VersionAdded: '5.21.0'
|
159
|
+
Exclude:
|
160
|
+
- '**/metadata.rb'
|
161
|
+
- '**/Berksfile'
|
162
|
+
|
163
|
+
Chef/Style/NegatingOnlyIf:
|
164
|
+
Description: Use not_if instead of only_if that negates the Ruby statement with a !
|
165
|
+
StyleGuide: 'chef_style_negatingonlyif'
|
166
|
+
VersionAdded: '6.2.0'
|
167
|
+
Enabled: true
|
168
|
+
Exclude:
|
169
|
+
- '**/metadata.rb'
|
170
|
+
- '**/Berksfile'
|
171
|
+
|
172
|
+
Chef/Style/IncludeRecipeWithParentheses:
|
173
|
+
Description: There is no need to wrap the recipe in parentheses when using the include_recipe helper
|
174
|
+
StyleGuide: '#includerecipewithparentheses'
|
175
|
+
VersionAdded: '6.11.0'
|
176
|
+
Enabled: true
|
177
|
+
Exclude:
|
178
|
+
- '**/attributes/*.rb'
|
179
|
+
- '**/metadata.rb'
|
180
|
+
- '**/Berksfile'
|
181
|
+
|
182
|
+
###############################
|
183
|
+
# Chef/Correctness: Avoiding potential problems
|
184
|
+
###############################
|
185
|
+
|
186
|
+
Chef/Correctness:
|
187
|
+
Enabled: true
|
188
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
189
|
+
|
190
|
+
Chef/Correctness/ServiceResource:
|
191
|
+
Description: Use a service resource to start and stop services instead of execute resources
|
192
|
+
StyleGuide: 'chef_correctness_serviceresource'
|
193
|
+
Enabled: true
|
194
|
+
VersionAdded: '5.0.0'
|
195
|
+
Exclude:
|
196
|
+
- '**/attributes/*.rb'
|
197
|
+
- '**/metadata.rb'
|
198
|
+
- '**/Berksfile'
|
199
|
+
|
200
|
+
Chef/Correctness/NodeNormal:
|
201
|
+
Description: Do not use the node.normal method
|
202
|
+
StyleGuide: 'chef_correctness_nodenormal'
|
203
|
+
Enabled: true
|
204
|
+
VersionAdded: '5.1.0'
|
205
|
+
Exclude:
|
206
|
+
- '**/metadata.rb'
|
207
|
+
- '**/Berksfile'
|
208
|
+
|
209
|
+
Chef/Correctness/NodeNormalUnless:
|
210
|
+
Description: Do not use the node.normal_unless method
|
211
|
+
StyleGuide: 'chef_correctness_chernodenormalunless'
|
212
|
+
Enabled: true
|
213
|
+
VersionAdded: '5.1.0'
|
214
|
+
Exclude:
|
215
|
+
- '**/metadata.rb'
|
216
|
+
- '**/Berksfile'
|
217
|
+
|
218
|
+
Chef/Correctness/TmpPath:
|
219
|
+
Description: Use file_cache_path rather than hard-coding tmp paths
|
220
|
+
StyleGuide: 'chef_correctness_nodenormalunless'
|
221
|
+
Enabled: true
|
222
|
+
VersionAdded: '5.0.0'
|
223
|
+
Exclude:
|
224
|
+
- '**/metadata.rb'
|
225
|
+
- '**/Berksfile'
|
226
|
+
|
227
|
+
Chef/Correctness/InvalidPlatformMetadata:
|
228
|
+
Description: metadata.rb "supports" platform is invalid
|
229
|
+
StyleGuide: 'chef_correctness_invalidplatformmetadata'
|
230
|
+
Enabled: true
|
231
|
+
VersionAdded: '5.2.0'
|
232
|
+
Include:
|
233
|
+
- '**/metadata.rb'
|
234
|
+
|
235
|
+
Chef/Correctness/CookbookUsesNodeSave:
|
236
|
+
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.
|
237
|
+
StyleGuide: 'chef_correctness_cookbookusesnodesave'
|
238
|
+
Enabled: true
|
239
|
+
VersionAdded: '5.5.0'
|
240
|
+
Exclude:
|
241
|
+
- '**/metadata.rb'
|
242
|
+
- '**/Berksfile'
|
243
|
+
|
244
|
+
Chef/Correctness/MetadataMissingName:
|
245
|
+
Description: The metadata.rb file is missing the name field which is required by Chef Infra Client 12 and later
|
246
|
+
StyleGuide: 'chef_correctness_metadatamissingname'
|
247
|
+
Enabled: true
|
248
|
+
VersionAdded: '5.2.0'
|
249
|
+
Include:
|
250
|
+
- '**/metadata.rb'
|
251
|
+
|
252
|
+
Chef/Correctness/BlockGuardWithOnlyString:
|
253
|
+
Description: A resource guard (not_if/only_if) that is a string should not be wrapped in {}. Wrapping a guard string in {} causes it to be executed as Ruby code which will always return true instead of a shell command that will actually run.
|
254
|
+
StyleGuide: 'chef_correctness_blockguardwithonlystring'
|
255
|
+
Enabled: true
|
256
|
+
VersionAdded: '5.2.0'
|
257
|
+
Exclude:
|
258
|
+
- '**/attributes/*.rb'
|
259
|
+
- '**/metadata.rb'
|
260
|
+
- '**/Berksfile'
|
261
|
+
|
262
|
+
Chef/Correctness/ResourceSetsInternalProperties:
|
263
|
+
Description: Do not set properties used internally by Chef Infra Client to track the system state.
|
264
|
+
StyleGuide: 'chef_correctness_resourcesetsinternalproperties'
|
265
|
+
Enabled: true
|
266
|
+
VersionAdded: '5.5.0'
|
267
|
+
Exclude:
|
268
|
+
- '**/attributes/*.rb'
|
269
|
+
- '**/metadata.rb'
|
270
|
+
- '**/Berksfile'
|
271
|
+
|
272
|
+
Chef/Correctness/ResourceSetsNameProperty:
|
273
|
+
Description: Resource sets the name property in the resource instead of using a name_property.
|
274
|
+
StyleGuide: 'chef_correctness_resourcesetsnameproperty'
|
275
|
+
Enabled: true
|
276
|
+
VersionAdded: '5.5.0'
|
277
|
+
Exclude:
|
278
|
+
- '**/attributes/*.rb'
|
279
|
+
- '**/metadata.rb'
|
280
|
+
- '**/Berksfile'
|
281
|
+
|
282
|
+
Chef/Correctness/ResourceWithNoneAction:
|
283
|
+
Description: Resource uses the nonexistent :none action instead of the :nothing action
|
284
|
+
StyleGuide: 'chef_correctness_resourcewithnoneaction'
|
285
|
+
Enabled: true
|
286
|
+
VersionAdded: '5.5.0'
|
287
|
+
Exclude:
|
288
|
+
- '**/attributes/*.rb'
|
289
|
+
- '**/metadata.rb'
|
290
|
+
- '**/Berksfile'
|
291
|
+
|
292
|
+
Chef/Correctness/InvalidVersionMetadata:
|
293
|
+
Description: Cookbook metadata.rb version field should follow X.Y.Z version format.
|
294
|
+
StyleGuide: 'chef_correctness_invalidversionmetadata'
|
295
|
+
Enabled: true
|
296
|
+
VersionAdded: '5.8.0'
|
297
|
+
Include:
|
298
|
+
- '**/metadata.rb'
|
299
|
+
|
300
|
+
Chef/Correctness/NotifiesActionNotSymbol:
|
301
|
+
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.
|
302
|
+
StyleGuide: 'chef_correctness_notifiesactionnotsymbol'
|
303
|
+
Enabled: true
|
304
|
+
VersionAdded: '5.10.0'
|
305
|
+
Exclude:
|
306
|
+
- '**/attributes/*.rb'
|
307
|
+
- '**/metadata.rb'
|
308
|
+
- '**/Berksfile'
|
309
|
+
|
310
|
+
Chef/Correctness/IncorrectLibraryInjection:
|
311
|
+
Description: Libraries should be injected into the Chef::DSL::Recipe or Chef::DSL::Resource classes and not Recipe/Resource/Provider classes directly.
|
312
|
+
StyleGuide: 'chef_correctness_incorrectlibraryinjection'
|
313
|
+
Enabled: true
|
314
|
+
VersionAdded: '5.10.0'
|
315
|
+
Exclude:
|
316
|
+
- '**/metadata.rb'
|
317
|
+
- '**/Berksfile'
|
318
|
+
|
319
|
+
Chef/Correctness/InvalidPlatformHelper:
|
320
|
+
Description: Pass valid platforms to the platform? helper.
|
321
|
+
StyleGuide: 'chef_correctness_invalidplatformhelper'
|
322
|
+
Enabled: true
|
323
|
+
VersionAdded: '5.15.0'
|
324
|
+
Exclude:
|
325
|
+
- '**/metadata.rb'
|
326
|
+
- '**/Berksfile'
|
327
|
+
|
328
|
+
Chef/Correctness/InvalidPlatformFamilyHelper:
|
329
|
+
Description: Pass valid platform families to the platform_family? helper.
|
330
|
+
StyleGuide: 'chef_correctness_invalidplatformfamilyhelper'
|
331
|
+
Enabled: true
|
332
|
+
VersionAdded: '5.15.0'
|
333
|
+
Exclude:
|
334
|
+
- '**/metadata.rb'
|
335
|
+
- '**/Berksfile'
|
336
|
+
|
337
|
+
Chef/Correctness/ScopedFileExist:
|
338
|
+
Description: Scope file exist to access the correct File class by using ::File.exist? not File.exist?.
|
339
|
+
StyleGuide: 'chef_correctness_scopedfileexist'
|
340
|
+
Enabled: true
|
341
|
+
VersionAdded: '5.15.0'
|
342
|
+
Exclude:
|
343
|
+
- '**/attributes/*.rb'
|
344
|
+
- '**/metadata.rb'
|
345
|
+
- '**/Berksfile'
|
346
|
+
|
347
|
+
Chef/Correctness/InvalidPlatformValueForPlatformFamilyHelper:
|
348
|
+
Description: Pass valid platforms families to the value_for_platform_family helper.
|
349
|
+
StyleGuide: 'chef_correctness_invalidplatformvalueforplatformfamilyhelper'
|
350
|
+
Enabled: true
|
351
|
+
VersionAdded: '5.15.0'
|
352
|
+
Exclude:
|
353
|
+
- '**/metadata.rb'
|
354
|
+
- '**/Berksfile'
|
355
|
+
|
356
|
+
Chef/Correctness/InvalidPlatformValueForPlatformHelper:
|
357
|
+
Description: Pass valid platforms to the value_for_platform helper.
|
358
|
+
StyleGuide: 'chef_correctness_invalidplatformvalueforplatformhelper'
|
359
|
+
Enabled: true
|
360
|
+
VersionAdded: '5.15.0'
|
361
|
+
Exclude:
|
362
|
+
- '**/metadata.rb'
|
363
|
+
- '**/Berksfile'
|
364
|
+
|
365
|
+
Chef/Correctness/InvalidNotificationTiming:
|
366
|
+
Description: Valid notification timings are :immediately, :immediate (alias for :immediately), :delayed, and :before.
|
367
|
+
StyleGuide: 'chef_correctness_invalidnotificationtiming'
|
368
|
+
Enabled: true
|
369
|
+
VersionAdded: '5.16.0'
|
370
|
+
Exclude:
|
371
|
+
- '**/attributes/*.rb'
|
372
|
+
- '**/metadata.rb'
|
373
|
+
- '**/Berksfile'
|
374
|
+
|
375
|
+
Chef/Correctness/MalformedPlatformValueForPlatformHelper:
|
376
|
+
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'.
|
377
|
+
StyleGuide: 'chef_correctness_malformedplatformvalueforplatformhelper'
|
378
|
+
Enabled: true
|
379
|
+
VersionAdded: '5.16.0'
|
380
|
+
Exclude:
|
381
|
+
- '**/metadata.rb'
|
382
|
+
- '**/Berksfile'
|
383
|
+
|
384
|
+
Chef/Correctness/DnfPackageAllowDowngrades:
|
385
|
+
Description: dnf_package does not support the allow_downgrades property
|
386
|
+
StyleGuide: 'chef_correctness_dnfpackageallowdowngrades'
|
387
|
+
Enabled: true
|
388
|
+
VersionAdded: '5.16.0'
|
389
|
+
Exclude:
|
390
|
+
- '**/attributes/*.rb'
|
391
|
+
- '**/metadata.rb'
|
392
|
+
- '**/Berksfile'
|
393
|
+
|
394
|
+
Chef/Correctness/ChefApplicationFatal:
|
395
|
+
Description: Use raise to force Chef Infra Client to fail instead of using Chef::Application.fatal
|
396
|
+
StyleGuide: 'chef_correctness_chefapplicationfatal'
|
397
|
+
Enabled: true
|
398
|
+
VersionAdded: '6.0.0'
|
399
|
+
Exclude:
|
400
|
+
- '**/metadata.rb'
|
401
|
+
- '**/Berksfile'
|
402
|
+
|
403
|
+
Chef/Correctness/PowershellScriptDeleteFile:
|
404
|
+
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
|
405
|
+
StyleGuide: 'chef_correctness_powershellscriptdeletefiles'
|
406
|
+
Enabled: true
|
407
|
+
VersionAdded: '6.0.0'
|
408
|
+
Exclude:
|
409
|
+
- '**/attributes/*.rb'
|
410
|
+
- '**/metadata.rb'
|
411
|
+
- '**/Berksfile'
|
412
|
+
|
413
|
+
Chef/Correctness/ConditionalRubyShellout:
|
414
|
+
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.
|
415
|
+
StyleGuide: 'chef_correctness_conditionalrubyshellout'
|
416
|
+
Enabled: true
|
417
|
+
VersionAdded: '6.1.0'
|
418
|
+
Exclude:
|
419
|
+
- '**/attributes/*.rb'
|
420
|
+
- '**/metadata.rb'
|
421
|
+
- '**/Berksfile'
|
422
|
+
|
423
|
+
Chef/Correctness/LazyEvalNodeAttributeDefaults:
|
424
|
+
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.
|
425
|
+
StyleGuide: 'chef_correctness_lazyevalnodeattributedefaults'
|
426
|
+
Enabled: true
|
427
|
+
VersionAdded: '6.6.0'
|
428
|
+
Include:
|
429
|
+
- '**/libraries/*.rb'
|
430
|
+
- '**/resources/*.rb'
|
431
|
+
|
432
|
+
Chef/Correctness/OpenSSLPasswordHelpers:
|
433
|
+
Description: The secure_password helper from the openssl cookbooks Opscode::OpenSSL::Password class should not be used to generate passwords.
|
434
|
+
StyleGuide: 'chef_correctness_opensslpasswordhelpers'
|
435
|
+
Enabled: true
|
436
|
+
VersionAdded: '6.6.0'
|
437
|
+
Exclude:
|
438
|
+
- '**/metadata.rb'
|
439
|
+
- '**/Berksfile'
|
440
|
+
|
441
|
+
Chef/Correctness/InvalidPlatformFamilyInCase:
|
442
|
+
Description: Use valid platform family values in case statements.
|
443
|
+
StyleGuide: 'chef_correctness_invalidplatformfamilyincase'
|
444
|
+
Enabled: true
|
445
|
+
VersionAdded: '6.6.0'
|
446
|
+
Exclude:
|
447
|
+
- '**/metadata.rb'
|
448
|
+
- '**/Berksfile'
|
449
|
+
|
450
|
+
Chef/Correctness/InvalidPlatformInCase:
|
451
|
+
Description: Use valid platform values in case statements.
|
452
|
+
StyleGuide: 'chef_correctness_invalidplatformincase'
|
453
|
+
Enabled: true
|
454
|
+
VersionAdded: '6.6.0'
|
455
|
+
Exclude:
|
456
|
+
- '**/metadata.rb'
|
457
|
+
- '**/Berksfile'
|
458
|
+
|
459
|
+
Chef/Correctness/InvalidDefaultAction:
|
460
|
+
Description: Default actions in resources should be a symbol or an array of symbols.
|
461
|
+
StyleGuide: 'chef_correctness_invaliddefaultaction'
|
462
|
+
Enabled: true
|
463
|
+
VersionAdded: '6.13.0'
|
464
|
+
Include:
|
465
|
+
- '**/libraries/*.rb'
|
466
|
+
- '**/resources/*.rb'
|
467
|
+
|
468
|
+
Chef/Correctness/SupportsMustBeFloat:
|
469
|
+
Description: Versions used in metadata.rb supports calls should be floats not integers.
|
470
|
+
StyleGuide: 'chef_correctness_supportsmustbefloat'
|
471
|
+
Enabled: true
|
472
|
+
VersionAdded: '6.13.0'
|
473
|
+
Include:
|
474
|
+
- '**/metadata.rb'
|
475
|
+
|
476
|
+
Chef/Correctness/MacosUserdefaultsInvalidType:
|
477
|
+
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'.
|
478
|
+
StyleGuide: 'chef_correctness_macosuserdefaultsinvalidtype'
|
479
|
+
Enabled: true
|
480
|
+
VersionAdded: '6.14.0'
|
481
|
+
Exclude:
|
482
|
+
- '**/metadata.rb'
|
483
|
+
- '**/Berksfile'
|
484
|
+
|
485
|
+
Chef/Correctness/LazyInResourceGuard:
|
486
|
+
Description: Using `lazy {}` within a resource guard (not_if/only_if) will cause failures and is unnecessary as resource guards are always lazily evaluated.
|
487
|
+
StyleGuide: 'chef_correctness_lazyinresourceguard'
|
488
|
+
Enabled: true
|
489
|
+
VersionAdded: '6.18.0'
|
490
|
+
Exclude:
|
491
|
+
- '**/metadata.rb'
|
492
|
+
- '**/Berksfile'
|
493
|
+
|
494
|
+
Chef/Correctness/PropertyWithoutType:
|
495
|
+
Description: Custom resource properties or attributes should always define a type to help users understand the correct allowed values.
|
496
|
+
StyleGuide: 'chef_correctness_propertywithouttype'
|
497
|
+
Enabled: true
|
498
|
+
VersionAdded: '6.18.0'
|
499
|
+
Include:
|
500
|
+
- '**/libraries/*.rb'
|
501
|
+
- '**/resources/*.rb'
|
502
|
+
|
503
|
+
Chef/Correctness/OctalModeAsString:
|
504
|
+
Description: Don't represent file modes as strings containing octal values. Use standard base 10 file modes instead.
|
505
|
+
StyleGuide: 'chef_correctness_octalmodeasstring'
|
506
|
+
Enabled: true
|
507
|
+
VersionAdded: '6.21.0'
|
508
|
+
Exclude:
|
509
|
+
- '**/attributes/*.rb'
|
510
|
+
- '**/metadata.rb'
|
511
|
+
- '**/Berksfile'
|
512
|
+
|
513
|
+
Chef/Correctness/MetadataMalformedDepends:
|
514
|
+
Description: metadata.rb cookbook dependencies and version constraints should be comma separated.
|
515
|
+
StyleGuide: 'chef_correctness_metadatamalformeddepends'
|
516
|
+
Enabled: true
|
517
|
+
VersionAdded: '7.16'
|
518
|
+
Include:
|
519
|
+
- '**/metadata.rb'
|
520
|
+
|
521
|
+
Chef/Correctness/PowershellFileExists:
|
522
|
+
Description: Use Ruby's built-in `File.exist?('C:\somefile')` method instead of executing PowerShell's `Test-Path` cmdlet, which takes longer to load.
|
523
|
+
StyleGuide: 'chef_correctness_powershellfileexists'
|
524
|
+
Enabled: true
|
525
|
+
VersionAdded: '7.19'
|
526
|
+
Exclude:
|
527
|
+
- '**/metadata.rb'
|
528
|
+
- '**/Berksfile'
|
529
|
+
|
530
|
+
Chef/Correctness/MetadataMissingVersion:
|
531
|
+
Description: metadata.rb should define a version for the cookbook.
|
532
|
+
StyleGuide: 'chef_correctness_metadatamissingversion'
|
533
|
+
Enabled: true
|
534
|
+
VersionAdded: '7.25'
|
535
|
+
Include:
|
536
|
+
- '**/metadata.rb'
|
537
|
+
|
538
|
+
Chef/Correctness/InvalidCookbookName:
|
539
|
+
Description: Cookbook names should not contain invalid characters such as periods.
|
540
|
+
StyleGuide: 'chef_correctness_invalidcookbookname'
|
541
|
+
Enabled: true
|
542
|
+
VersionAdded: '7.27'
|
543
|
+
Include:
|
544
|
+
- '**/metadata.rb'
|
545
|
+
|
546
|
+
Chef/Correctness/InvalidNotificationResource:
|
547
|
+
Description: The resource to notify when calling `notifies` or `subscribes` must be a string.
|
548
|
+
StyleGuide: 'chef_correctness_invalidnotificationresource'
|
549
|
+
Enabled: true
|
550
|
+
VersionAdded: '7.28'
|
551
|
+
Exclude:
|
552
|
+
- '**/attributes/*.rb'
|
553
|
+
- '**/metadata.rb'
|
554
|
+
- '**/Berksfile'
|
555
|
+
|
556
|
+
###############################
|
557
|
+
# Chef/Sharing: Issues that prevent sharing code with other teams or with the Chef community in general
|
558
|
+
###############################
|
559
|
+
|
560
|
+
Chef/Sharing:
|
561
|
+
Enabled: true
|
562
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
563
|
+
|
564
|
+
Chef/Sharing/InsecureCookbookURL:
|
565
|
+
Description: Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields
|
566
|
+
StyleGuide: 'chef_sharing_insecurecookbookurl'
|
567
|
+
Enabled: true
|
568
|
+
VersionAdded: '5.1.0'
|
569
|
+
VersionChanged: '5.15.0'
|
570
|
+
Include:
|
571
|
+
- '**/metadata.rb'
|
572
|
+
|
573
|
+
Chef/Sharing/InvalidLicenseString:
|
574
|
+
Description: Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved"
|
575
|
+
StyleGuide: 'chef_sharing_invalidlicensestring'
|
576
|
+
Enabled: true
|
577
|
+
VersionAdded: '5.2.0'
|
578
|
+
VersionChanged: '5.15.0'
|
579
|
+
Include:
|
580
|
+
- '**/metadata.rb'
|
581
|
+
|
582
|
+
Chef/Sharing/DefaultMetadataMaintainer:
|
583
|
+
Description: Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb.
|
584
|
+
StyleGuide: 'chef_sharing_defaultmetadatamaintainer'
|
585
|
+
Enabled: true
|
586
|
+
VersionAdded: '5.4.0'
|
587
|
+
VersionChanged: '5.15.0'
|
588
|
+
Include:
|
589
|
+
- '**/metadata.rb'
|
590
|
+
|
591
|
+
Chef/Sharing/EmptyMetadataField:
|
592
|
+
Description: metadata.rb should not include fields with an empty string. Either don't include the field or add a value.
|
593
|
+
StyleGuide: 'chef_sharing_emptymetadatafield'
|
594
|
+
Enabled: true
|
595
|
+
VersionAdded: '5.8.0'
|
596
|
+
VersionChanged: '5.15.0'
|
597
|
+
Include:
|
598
|
+
- '**/metadata.rb'
|
599
|
+
|
600
|
+
Chef/Sharing/IncludePropertyDescriptions:
|
601
|
+
Description: Properties should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
602
|
+
StyleGuide: 'chef_sharing_includepropetydescriptions'
|
603
|
+
Enabled: false
|
604
|
+
VersionAdded: '6.1.0'
|
605
|
+
Include:
|
606
|
+
- '**/libraries/*.rb'
|
607
|
+
- '**/resources/*.rb'
|
608
|
+
|
609
|
+
Chef/Sharing/IncludeResourceDescriptions:
|
610
|
+
Description: Resources should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
611
|
+
StyleGuide: 'chef_sharing_includeresourcedescriptions'
|
612
|
+
Enabled: false
|
613
|
+
VersionAdded: '6.1.0'
|
614
|
+
Include:
|
615
|
+
- '**/resources/*.rb'
|
616
|
+
|
617
|
+
Chef/Sharing/IncludeResourceExamples:
|
618
|
+
Description: Resources should include examples field to allow automated documentation. Requires Chef Infra Client 13.9 or later.
|
619
|
+
StyleGuide: 'chef_sharing_includeresourceexamples'
|
620
|
+
Enabled: false
|
621
|
+
VersionAdded: '6.10.0'
|
622
|
+
Include:
|
623
|
+
- '**/resources/*.rb'
|
624
|
+
|
625
|
+
###############################
|
626
|
+
# Chef/Deprecations: Resolving Deprecations that block upgrading Chef Infra Client
|
627
|
+
###############################
|
628
|
+
|
629
|
+
Chef/Deprecations:
|
630
|
+
Enabled: true
|
631
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
632
|
+
|
633
|
+
Chef/Deprecations/NodeDeepFetch:
|
634
|
+
Description: Do not use the deprecated chef-sugar node.deep_fetch methods
|
635
|
+
StyleGuide: 'chef_deprecations_nodedeepfetch'
|
636
|
+
Enabled: true
|
637
|
+
VersionAdded: '5.12.0'
|
638
|
+
Exclude:
|
639
|
+
- '**/metadata.rb'
|
640
|
+
- '**/Berksfile'
|
641
|
+
|
642
|
+
Chef/Deprecations/NodeSet:
|
643
|
+
Description: Do not use the deprecated node.set method
|
644
|
+
StyleGuide: 'chef_deprecations_nodeset'
|
645
|
+
Enabled: true
|
646
|
+
VersionAdded: '5.0.0'
|
647
|
+
Exclude:
|
648
|
+
- '**/metadata.rb'
|
649
|
+
- '**/Berksfile'
|
650
|
+
|
651
|
+
Chef/Deprecations/NodeSetUnless:
|
652
|
+
Description: Do not use the deprecated node.set_unless method
|
653
|
+
StyleGuide: 'chef_deprecations_nodesetunless'
|
654
|
+
Enabled: true
|
655
|
+
VersionAdded: '5.1.0'
|
656
|
+
Exclude:
|
657
|
+
- '**/metadata.rb'
|
658
|
+
- '**/Berksfile'
|
659
|
+
|
660
|
+
Chef/Deprecations/EpicFail:
|
661
|
+
Description: Use `ignore_failure` in resources to continue when failures occur instead of the deprecated `epic_fail` property
|
662
|
+
StyleGuide: 'chef_deprecations_epicfail'
|
663
|
+
Enabled: true
|
664
|
+
VersionAdded: '5.1.0'
|
665
|
+
Exclude:
|
666
|
+
- '**/attributes/*.rb'
|
667
|
+
- '**/metadata.rb'
|
668
|
+
- '**/Berksfile'
|
669
|
+
|
670
|
+
Chef/Deprecations/CookbookDependsOnPoise:
|
671
|
+
Description: Cookbooks should not depend on the deprecated Poise framework
|
672
|
+
StyleGuide: 'chef_deprecations_cookbookdependsonpoise'
|
673
|
+
Enabled: true
|
674
|
+
VersionAdded: '5.1.0'
|
675
|
+
Include:
|
676
|
+
- '**/metadata.rb'
|
677
|
+
|
678
|
+
Chef/Deprecations/CookbookDependsOnCompatResource:
|
679
|
+
Description: Don't depend on the deprecated compat_resource cookbook made obsolete by Chef Infra Client 12.19+
|
680
|
+
StyleGuide: 'chef_deprecations_cookbookdependsoncompatresource'
|
681
|
+
Enabled: true
|
682
|
+
VersionAdded: '5.1.0'
|
683
|
+
Include:
|
684
|
+
- '**/metadata.rb'
|
685
|
+
|
686
|
+
Chef/Deprecations/CookbookDependsOnPartialSearch:
|
687
|
+
Description: Don't depend on the deprecated partial_search cookbook made obsolete by Chef Infra Client 13+
|
688
|
+
StyleGuide: 'chef_deprecations_cookbookdependsonpartialsearch'
|
689
|
+
Enabled: true
|
690
|
+
VersionAdded: '5.1.0'
|
691
|
+
Include:
|
692
|
+
- '**/metadata.rb'
|
693
|
+
|
694
|
+
Chef/Deprecations/EasyInstallResource:
|
695
|
+
Description: Don't use the deprecated easy_install resource resource removed in Chef Infra Client 13
|
696
|
+
StyleGuide: 'chef_deprecations_easyinstallresource'
|
697
|
+
Enabled: true
|
698
|
+
VersionAdded: '5.1.0'
|
699
|
+
Exclude:
|
700
|
+
- '**/attributes/*.rb'
|
701
|
+
- '**/metadata.rb'
|
702
|
+
- '**/Berksfile'
|
703
|
+
|
704
|
+
Chef/Deprecations/ErlCallResource:
|
705
|
+
Description: Don't use the deprecated erl_call resource removed in Chef Infra Client 13
|
706
|
+
StyleGuide: 'chef_deprecations_erlcallresource'
|
707
|
+
Enabled: true
|
708
|
+
VersionAdded: '5.1.0'
|
709
|
+
Exclude:
|
710
|
+
- '**/attributes/*.rb'
|
711
|
+
- '**/metadata.rb'
|
712
|
+
- '**/Berksfile'
|
713
|
+
|
714
|
+
Chef/Deprecations/RequireRecipe:
|
715
|
+
Description: Use include_recipe instead of the require_recipe method
|
716
|
+
StyleGuide: 'chef_deprecations_requirerecipe'
|
717
|
+
Enabled: true
|
718
|
+
VersionAdded: '5.2.0'
|
719
|
+
Exclude:
|
720
|
+
- '**/attributes/*.rb'
|
721
|
+
- '**/metadata.rb'
|
722
|
+
- '**/Berksfile'
|
723
|
+
|
724
|
+
Chef/Deprecations/NodeMethodsInsteadofAttributes:
|
725
|
+
Description: Use node attributes to access Ohai data instead of node methods, which were deprecated in Chef Infra Client 13.
|
726
|
+
StyleGuide: 'chef_deprecations_nodemethodsinsteadofattributes'
|
727
|
+
Enabled: true
|
728
|
+
VersionAdded: '5.4.0'
|
729
|
+
Exclude:
|
730
|
+
- '**/metadata.rb'
|
731
|
+
- '**/Berksfile'
|
732
|
+
|
733
|
+
Chef/Deprecations/UsesDeprecatedMixins:
|
734
|
+
Description: Don't use deprecated Mixins no longer included in Chef Infra Client 14 and later.
|
735
|
+
StyleGuide: 'chef_deprecations_usesdeprecatedmixins'
|
736
|
+
Enabled: true
|
737
|
+
VersionAdded: '5.4.0'
|
738
|
+
Include:
|
739
|
+
- '**/libraries/*.rb'
|
740
|
+
- '**/providers/*.rb'
|
741
|
+
- '**/resources/*.rb'
|
742
|
+
|
743
|
+
Chef/Deprecations/IncludingXMLRubyRecipe:
|
744
|
+
Description: The xml::ruby recipe installs nokogiri which is included in Chef Infra Client 12 and later.
|
745
|
+
StyleGuide: 'chef_deprecations_includingxmlrubyrecipe'
|
746
|
+
Enabled: true
|
747
|
+
VersionAdded: '5.4.0'
|
748
|
+
Exclude:
|
749
|
+
- '**/attributes/*.rb'
|
750
|
+
- '**/metadata.rb'
|
751
|
+
- '**/Berksfile'
|
752
|
+
|
753
|
+
Chef/Deprecations/LegacyYumCookbookRecipes:
|
754
|
+
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).
|
755
|
+
StyleGuide: 'chef_deprecations_legacyyumcookbookrecipes'
|
756
|
+
Enabled: true
|
757
|
+
VersionAdded: '5.4.0'
|
758
|
+
Exclude:
|
759
|
+
- '**/metadata.rb'
|
760
|
+
|
761
|
+
Chef/Deprecations/UsesChefRESTHelpers:
|
762
|
+
Description: Don't use the helpers in Chef::REST which were removed in Chef Infra Client 13
|
763
|
+
StyleGuide: 'chef_deprecations_useschefresthelpers'
|
764
|
+
Enabled: true
|
765
|
+
VersionAdded: '5.5.0'
|
766
|
+
Exclude:
|
767
|
+
- '**/metadata.rb'
|
768
|
+
|
769
|
+
Chef/Deprecations/ChocolateyPackageUninstallAction:
|
770
|
+
Description: Use the :remove action in the chocolatey_package resource instead of :uninstall which was removed in Chef Infra Client 14+
|
771
|
+
StyleGuide: 'chef_deprecations_chocolateypackageuninstallaction'
|
772
|
+
Enabled: true
|
773
|
+
VersionAdded: '5.5.0'
|
774
|
+
Exclude:
|
775
|
+
- '**/metadata.rb'
|
776
|
+
|
777
|
+
Chef/Deprecations/LaunchdDeprecatedHashProperty:
|
778
|
+
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.
|
779
|
+
StyleGuide: 'chef_deprecations_launchddeprecatedhashproperty'
|
780
|
+
Enabled: true
|
781
|
+
VersionAdded: '5.5.0'
|
782
|
+
Exclude:
|
783
|
+
- '**/metadata.rb'
|
784
|
+
|
785
|
+
Chef/Deprecations/LocaleDeprecatedLcAllProperty:
|
786
|
+
Description: The local resource's lc_all property has been deprecated and will be removed in Chef Infra Client 16
|
787
|
+
StyleGuide: 'chef_deprecations_localedeprecatedlcallproperty'
|
788
|
+
Enabled: true
|
789
|
+
VersionAdded: '5.5.0'
|
790
|
+
Exclude:
|
791
|
+
- '**/metadata.rb'
|
792
|
+
|
793
|
+
Chef/Deprecations/UserDeprecatedSupportsProperty:
|
794
|
+
Description: The supports property was removed in Chef Infra Client 13 in favor of individual 'manage_home' and 'non_unique' properties.
|
795
|
+
StyleGuide: 'chef_deprecations_userdeprecatedsupportsproperty'
|
796
|
+
Enabled: true
|
797
|
+
VersionAdded: '5.5.0'
|
798
|
+
Exclude:
|
799
|
+
- '**/metadata.rb'
|
800
|
+
|
801
|
+
Chef/Deprecations/UseInlineResourcesDefined:
|
802
|
+
Description: use_inline_resources is now the default for resources in Chef Infra Client 13+ and does not need to be specified.
|
803
|
+
StyleGuide: 'chef_deprecations_useinlineresourcesdefined'
|
804
|
+
Enabled: true
|
805
|
+
VersionAdded: '5.4.0'
|
806
|
+
Include:
|
807
|
+
- '**/libraries/*.rb'
|
808
|
+
- '**/providers/*.rb'
|
809
|
+
- '**/resources/*.rb'
|
810
|
+
|
811
|
+
Chef/Deprecations/IncludingYumDNFCompatRecipe:
|
812
|
+
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.
|
813
|
+
StyleGuide: 'chef_deprecations_includingyumdnfcompatrecipe'
|
814
|
+
Enabled: true
|
815
|
+
VersionAdded: '5.3.0'
|
816
|
+
Exclude:
|
817
|
+
- '**/metadata.rb'
|
818
|
+
|
819
|
+
Chef/Deprecations/WindowsTaskChangeAction:
|
820
|
+
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.
|
821
|
+
StyleGuide: 'chef_deprecations_windowstaskchangeaction'
|
822
|
+
Enabled: true
|
823
|
+
VersionAdded: '5.6.0'
|
824
|
+
Exclude:
|
825
|
+
- '**/metadata.rb'
|
826
|
+
|
827
|
+
Chef/Deprecations/ResourceOverridesProvidesMethod:
|
828
|
+
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.
|
829
|
+
StyleGuide: 'chef_deprecations_resourceoverridesprovidesmethod'
|
830
|
+
Enabled: true
|
831
|
+
VersionAdded: '5.7.0'
|
832
|
+
Include:
|
833
|
+
- '**/libraries/*.rb'
|
834
|
+
- '**/providers/*.rb'
|
835
|
+
- '**/resources/*.rb'
|
836
|
+
|
837
|
+
Chef/Deprecations/ResourceUsesDslNameMethod:
|
838
|
+
Description: Use resource_name instead of the dsl_name method in resources. This will cause failures in Chef Infra Client 13 and later.
|
839
|
+
StyleGuide: 'chef_deprecations_resourceusesdslnamemethod'
|
840
|
+
Enabled: true
|
841
|
+
VersionAdded: '5.7.0'
|
842
|
+
Include:
|
843
|
+
- '**/libraries/*.rb'
|
844
|
+
- '**/providers/*.rb'
|
845
|
+
- '**/resources/*.rb'
|
846
|
+
|
847
|
+
Chef/Deprecations/ResourceUsesUpdatedMethod:
|
848
|
+
Description: Don't use updated = true/false to update resource state. This will cause failures in Chef Infra Client 13 and later.
|
849
|
+
StyleGuide: 'chef_deprecations_resourceusesupdatedmethod'
|
850
|
+
Enabled: false # has a high potential for false positives
|
851
|
+
VersionAdded: '5.7.0'
|
852
|
+
Include:
|
853
|
+
- '**/libraries/*.rb'
|
854
|
+
- '**/providers/*.rb'
|
855
|
+
- '**/resources/*.rb'
|
856
|
+
|
857
|
+
Chef/Deprecations/NamePropertyWithDefaultValue:
|
858
|
+
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.
|
859
|
+
StyleGuide: 'chef_deprecations_namepropertywithdefaultvalue'
|
860
|
+
Enabled: true
|
861
|
+
VersionAdded: '5.7.0'
|
862
|
+
Include:
|
863
|
+
- '**/libraries/*.rb'
|
864
|
+
- '**/resources/*.rb'
|
865
|
+
|
866
|
+
Chef/Deprecations/ResourceUsesProviderBaseMethod:
|
867
|
+
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.
|
868
|
+
StyleGuide: 'chef_deprecations_resourceusesproviderbasemethod'
|
869
|
+
Enabled: true
|
870
|
+
VersionAdded: '5.7.0'
|
871
|
+
Include:
|
872
|
+
- '**/libraries/*.rb'
|
873
|
+
- '**/resources/*.rb'
|
874
|
+
|
875
|
+
Chef/Deprecations/ChefSpecCoverageReport:
|
876
|
+
Description: Don't use the deprecated ChefSpec coverage report functionality in your specs.
|
877
|
+
StyleGuide: 'chef_deprecations_chefspeccoveragereport'
|
878
|
+
Enabled: true
|
879
|
+
VersionAdded: '5.8.0'
|
880
|
+
Include:
|
881
|
+
- '**/spec/*.rb'
|
882
|
+
|
883
|
+
Chef/Deprecations/ChefSpecLegacyRunner:
|
884
|
+
Description: Use ChefSpec::SoloRunner or ChefSpec::ServerRunner instead of the deprecated ChefSpec::Runner.
|
885
|
+
StyleGuide: 'chef_deprecations_chefspeclegacyrunner'
|
886
|
+
Enabled: true
|
887
|
+
VersionAdded: '5.8.0'
|
888
|
+
Include:
|
889
|
+
- '**/spec/*.rb'
|
890
|
+
|
891
|
+
Chef/Deprecations/UsesRunCommandHelper:
|
892
|
+
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.
|
893
|
+
StyleGuide: 'chef_deprecations_usesruncommandhelper'
|
894
|
+
Enabled: true
|
895
|
+
VersionAdded: '5.9.0'
|
896
|
+
Exclude:
|
897
|
+
- '**/metadata.rb'
|
898
|
+
- '**/Berksfile'
|
899
|
+
- '**/Rakefile'
|
900
|
+
|
901
|
+
Chef/Deprecations/ChefHandlerUsesSupports:
|
902
|
+
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.
|
903
|
+
StyleGuide: 'chef_deprecations_chefhandlerusessupports'
|
904
|
+
Enabled: true
|
905
|
+
VersionAdded: '5.9.0'
|
906
|
+
Exclude:
|
907
|
+
- '**/metadata.rb'
|
908
|
+
|
909
|
+
Chef/Deprecations/DeprecatedYumRepositoryProperties:
|
910
|
+
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.
|
911
|
+
StyleGuide: 'chef_deprecations_deprecatedyumrepositoryproperties'
|
912
|
+
Enabled: true
|
913
|
+
VersionAdded: '5.10.0'
|
914
|
+
Exclude:
|
915
|
+
- '**/metadata.rb'
|
916
|
+
- '**/attributes/*.rb'
|
917
|
+
- '**/Berksfile'
|
918
|
+
|
919
|
+
Chef/Deprecations/EOLAuditModeUsage:
|
920
|
+
Description: The beta Audit Mode feature in Chef Infra Client was removed in Chef Infra Client 15.0.
|
921
|
+
StyleGuide: 'chef_deprecations_eolauditmodeusage'
|
922
|
+
Enabled: true
|
923
|
+
VersionAdded: '5.10.0'
|
924
|
+
Exclude:
|
925
|
+
- '**/metadata.rb'
|
926
|
+
- '**/attributes/*.rb'
|
927
|
+
- '**/Berksfile'
|
928
|
+
|
929
|
+
Chef/Deprecations/ResourceInheritsFromCompatResource:
|
930
|
+
Description: HWRP style resource should inherit from the 'Chef::Resource' class and not the 'ChefCompat::Resource' class from the deprecated compat_resource cookbook.
|
931
|
+
StyleGuide: 'chef_deprecations_resourceinheritsfromcompatresource'
|
932
|
+
Enabled: true
|
933
|
+
VersionAdded: '5.10.0'
|
934
|
+
Include:
|
935
|
+
- '**/libraries/*.rb'
|
936
|
+
|
937
|
+
Chef/Deprecations/VerifyPropertyUsesFileExpansion:
|
938
|
+
Description: Use the 'path' variable in the verify property and not the 'file' variable which was removed in Chef Infra Client 13.
|
939
|
+
StyleGuide: 'chef_deprecations_verifypropertyusesfileexpansion'
|
940
|
+
Enabled: true
|
941
|
+
VersionAdded: '5.10.0'
|
942
|
+
Exclude:
|
943
|
+
- '**/metadata.rb'
|
944
|
+
- '**/attributes/*.rb'
|
945
|
+
- '**/Berksfile'
|
946
|
+
|
947
|
+
Chef/Deprecations/PoiseArchiveUsage:
|
948
|
+
Description: The poise_archive resource in the deprecated poise-archive should be replaced with the archive_file resource found in Chef Infra Client 15+.
|
949
|
+
StyleGuide: 'chef_deprecations_poisearchiveusage'
|
950
|
+
Enabled: true
|
951
|
+
VersionAdded: '5.11.0'
|
952
|
+
Exclude:
|
953
|
+
- '**/metadata.rb'
|
954
|
+
- '**/attributes/*.rb'
|
955
|
+
- '**/Berksfile'
|
956
|
+
|
957
|
+
Chef/Deprecations/PartialSearchHelperUsage:
|
958
|
+
Description: Legacy partial_search usage should be updated to use :filter_result in the search helper instead.
|
959
|
+
StyleGuide: 'chef_deprecations_partialsearchhelperusage'
|
960
|
+
Enabled: true
|
961
|
+
VersionAdded: '5.11.0'
|
962
|
+
Exclude:
|
963
|
+
- '**/metadata.rb'
|
964
|
+
|
965
|
+
Chef/Deprecations/SearchUsesPositionalParameters:
|
966
|
+
Description: Don't use deprecated positional parameters in cookbook search queries.
|
967
|
+
StyleGuide: 'chef_deprecations_searchusespositionalparameters'
|
968
|
+
Enabled: true
|
969
|
+
VersionAdded: '5.11.0'
|
970
|
+
Exclude:
|
971
|
+
- '**/metadata.rb'
|
972
|
+
|
973
|
+
Chef/Deprecations/PartialSearchClassUsage:
|
974
|
+
Description: Legacy Chef::PartialSearch class usage should be updated to use the search helper instead with the filter_result key.
|
975
|
+
StyleGuide: 'chef_deprecations_partialsearchclassusage'
|
976
|
+
Enabled: true
|
977
|
+
VersionAdded: '5.11.0'
|
978
|
+
Exclude:
|
979
|
+
- '**/metadata.rb'
|
980
|
+
|
981
|
+
Chef/Deprecations/Cheffile:
|
982
|
+
Description: The Librarian-Chef depsolving project is no longer maintained and should not be used for cookbook depsolving. Consider using Policyfiles instead.
|
983
|
+
StyleGuide: 'chef_deprecations_cheffile'
|
984
|
+
Enabled: true
|
985
|
+
VersionAdded: '5.12.0'
|
986
|
+
Include:
|
987
|
+
- '**/Cheffile'
|
988
|
+
|
989
|
+
Chef/Deprecations/LegacyNotifySyntax:
|
990
|
+
Description: Use the new-style notification syntax which allows you to notify resources defined later in a recipe or resource.
|
991
|
+
StyleGuide: 'chef_deprecations_legacynotifysyntax'
|
992
|
+
Enabled: true
|
993
|
+
VersionAdded: '5.13.0'
|
994
|
+
Exclude:
|
995
|
+
- '**/metadata.rb'
|
996
|
+
- '**/attributes/*.rb'
|
997
|
+
- '**/Berksfile'
|
998
|
+
|
999
|
+
Chef/Deprecations/NodeSetWithoutLevel:
|
1000
|
+
Description: When setting a node attribute in Chef Infra Client 11 and later you must specify the precedence level.
|
1001
|
+
StyleGuide: 'chef_deprecations_nodesetwithoutlevel'
|
1002
|
+
Enabled: true
|
1003
|
+
VersionAdded: '5.13.0'
|
1004
|
+
Exclude:
|
1005
|
+
- '**/metadata.rb'
|
1006
|
+
- '**/attributes/*.rb'
|
1007
|
+
|
1008
|
+
Chef/Deprecations/ChefRewind:
|
1009
|
+
Description: Use delete_resource / edit_resource instead of functionality in the deprecated chef-rewind gem
|
1010
|
+
StyleGuide: 'chef_deprecations_chefrewind'
|
1011
|
+
Enabled: true
|
1012
|
+
VersionAdded: '5.14.0'
|
1013
|
+
Exclude:
|
1014
|
+
- '**/metadata.rb'
|
1015
|
+
- '**/attributes/*.rb'
|
1016
|
+
|
1017
|
+
Chef/Deprecations/RubyBlockCreateAction:
|
1018
|
+
Description: Use the :run action in the ruby_block resource instead of the deprecated :create action
|
1019
|
+
StyleGuide: 'chef_deprecations_rubyblockcreateaction'
|
1020
|
+
Enabled: true
|
1021
|
+
VersionAdded: '5.16.0'
|
1022
|
+
Exclude:
|
1023
|
+
- '**/metadata.rb'
|
1024
|
+
- '**/attributes/*.rb'
|
1025
|
+
- '**/Berksfile'
|
1026
|
+
|
1027
|
+
Chef/Deprecations/DeprecatedPlatformMethods:
|
1028
|
+
Description: Use provider_for_action or provides instead of the deprecated Chef::Platform methods in resources.
|
1029
|
+
StyleGuide: 'chef_deprecations_deprecatedplatformmethods'
|
1030
|
+
Enabled: true
|
1031
|
+
VersionAdded: '5.16.0'
|
1032
|
+
VersionChanged: '6.17.0'
|
1033
|
+
Include:
|
1034
|
+
- '**/libraries/*.rb'
|
1035
|
+
- '**/resources/*.rb'
|
1036
|
+
- '**/providers/*.rb'
|
1037
|
+
|
1038
|
+
Chef/Deprecations/DeprecatedChefSpecPlatform:
|
1039
|
+
Description: Use currently supported platforms in ChefSpec listed at https://github.com/chefspec/fauxhai/blob/main/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
|
1040
|
+
StyleGuide: 'chef_deprecations_deprecatedchefspecplatform'
|
1041
|
+
Enabled: true
|
1042
|
+
VersionAdded: '5.20.0'
|
1043
|
+
Include:
|
1044
|
+
- '**/spec/**/*.rb'
|
1045
|
+
|
1046
|
+
Chef/Deprecations/WindowsFeatureServermanagercmd:
|
1047
|
+
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.
|
1048
|
+
StyleGuide: 'chef_deprecations_windowsfeatureservermanagercmd'
|
1049
|
+
Enabled: true
|
1050
|
+
VersionAdded: '5.22.0'
|
1051
|
+
Exclude:
|
1052
|
+
- '**/metadata.rb'
|
1053
|
+
- '**/attributes/*.rb'
|
1054
|
+
- '**/Berksfile'
|
1055
|
+
|
1056
|
+
Chef/Deprecations/DeprecatedWindowsVersionCheck:
|
1057
|
+
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.
|
1058
|
+
StyleGuide: 'chef_deprecations_deprecatedwindowsversioncheck'
|
1059
|
+
Enabled: true
|
1060
|
+
VersionAdded: '6.0.0'
|
1061
|
+
Exclude:
|
1062
|
+
- '**/metadata.rb'
|
1063
|
+
- '**/Berksfile'
|
1064
|
+
|
1065
|
+
Chef/Deprecations/ChefWindowsPlatformHelper:
|
1066
|
+
Description: Use `platform?('windows')` instead of the legacy `Chef::Platform.windows?` helper.
|
1067
|
+
StyleGuide: 'chef_deprecations_chefwindowsplatformhelper'
|
1068
|
+
Enabled: true
|
1069
|
+
VersionAdded: '6.0.0'
|
1070
|
+
Exclude:
|
1071
|
+
- '**/metadata.rb'
|
1072
|
+
- '**/Berksfile'
|
1073
|
+
|
1074
|
+
Chef/Deprecations/LogResourceNotifications:
|
1075
|
+
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.
|
1076
|
+
StyleGuide: 'chef_deprecations_logresourcenotifications'
|
1077
|
+
Enabled: true
|
1078
|
+
VersionAdded: '6.0.0'
|
1079
|
+
Exclude:
|
1080
|
+
- '**/metadata.rb'
|
1081
|
+
- '**/Berksfile'
|
1082
|
+
|
1083
|
+
Chef/Deprecations/HWRPWithoutProvides:
|
1084
|
+
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`.
|
1085
|
+
StyleGuide: 'chef_deprecations_resourcewithoutnameorprovides'
|
1086
|
+
Enabled: true
|
1087
|
+
VersionAdded: '6.0.0'
|
1088
|
+
VersionChanged: '6.8.0'
|
1089
|
+
Include:
|
1090
|
+
- '**/libraries/*.rb'
|
1091
|
+
|
1092
|
+
Chef/Deprecations/WindowsVersionHelpers:
|
1093
|
+
Description: Use node['platform_version'] data instead of the Windows::VersionHelper helper from the Windows cookbook.
|
1094
|
+
StyleGuide: 'chef_deprecations_windowsversionhelpers'
|
1095
|
+
Enabled: true
|
1096
|
+
VersionAdded: '5.4.0'
|
1097
|
+
Exclude:
|
1098
|
+
- '**/metadata.rb'
|
1099
|
+
- '**/Berksfile'
|
1100
|
+
|
1101
|
+
Chef/Deprecations/PowershellCookbookHelpers:
|
1102
|
+
Description: Use node['powershell']['version'] or the new powershell_version helper available in Chef Infra Client 16+ instead of the deprecated PowerShell cookbook helpers.
|
1103
|
+
StyleGuide: 'chef_deprecations_powershellcookbookhelpers'
|
1104
|
+
Enabled: true
|
1105
|
+
VersionAdded: '6.1.0'
|
1106
|
+
Exclude:
|
1107
|
+
- '**/metadata.rb'
|
1108
|
+
- '**/Berksfile'
|
1109
|
+
|
1110
|
+
Chef/Deprecations/DeprecatedShelloutMethods:
|
1111
|
+
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.
|
1112
|
+
StyleGuide: 'chef_deprecations_deprecatedshelloutmethods'
|
1113
|
+
Enabled: true
|
1114
|
+
VersionAdded: '6.3.0'
|
1115
|
+
Exclude:
|
1116
|
+
- '**/metadata.rb'
|
1117
|
+
- '**/attributes/*.rb'
|
1118
|
+
- '**/Berksfile'
|
1119
|
+
|
1120
|
+
Chef/Deprecations/Ruby27KeywordArgumentWarnings:
|
1121
|
+
Description: Pass options to shell_out helpers without the brackets to avoid Ruby 2.7 deprecation warnings.
|
1122
|
+
StyleGuide: 'chef_deprecations_ruby27keywordargumentwarnings'
|
1123
|
+
Enabled: true
|
1124
|
+
VersionAdded: '6.5.0'
|
1125
|
+
Exclude:
|
1126
|
+
- '**/metadata.rb'
|
1127
|
+
- '**/Berksfile'
|
1128
|
+
|
1129
|
+
Chef/Deprecations/ResourceUsesOnlyResourceName:
|
1130
|
+
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.
|
1131
|
+
StyleGuide: 'chef_deprecations_resourceusesonlyresourcename'
|
1132
|
+
Enabled: true
|
1133
|
+
VersionAdded: '6.7.0'
|
1134
|
+
Include:
|
1135
|
+
- '**/libraries/*.rb'
|
1136
|
+
- '**/resources/*.rb'
|
1137
|
+
|
1138
|
+
Chef/Deprecations/ChefDKGenerators:
|
1139
|
+
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.
|
1140
|
+
StyleGuide: 'chef_deprecations_chefdkgenerators'
|
1141
|
+
Enabled: true
|
1142
|
+
VersionAdded: '6.12.0'
|
1143
|
+
Exclude:
|
1144
|
+
- '**/metadata.rb'
|
1145
|
+
- '**/Berksfile'
|
1146
|
+
|
1147
|
+
Chef/Deprecations/ChefHandlerRecipe:
|
1148
|
+
Description: There is no need to include the empty and deprecated chef_handler::default recipe to use the chef_handler resource.
|
1149
|
+
StyleGuide: 'chef_deprecations_chefhandlerrecipe'
|
1150
|
+
Enabled: true
|
1151
|
+
VersionAdded: '6.12.0'
|
1152
|
+
Exclude:
|
1153
|
+
- '**/metadata.rb'
|
1154
|
+
- '**/Berksfile'
|
1155
|
+
|
1156
|
+
Chef/Deprecations/UseAutomaticResourceName:
|
1157
|
+
Description: The use_automatic_resource_name method was removed in Chef Infra Client 16. The resource name/provides should be set explicitly instead.
|
1158
|
+
StyleGuide: 'chef_deprecations_useautomaticresourcename'
|
1159
|
+
Enabled: true
|
1160
|
+
VersionAdded: '6.12.0'
|
1161
|
+
Include:
|
1162
|
+
- '**/libraries/*.rb'
|
1163
|
+
- '**/resources/*.rb'
|
1164
|
+
|
1165
|
+
Chef/Deprecations/MacosUserdefaultsGlobalProperty:
|
1166
|
+
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.
|
1167
|
+
StyleGuide: 'chef_deprecations_macosuserdefaultsglobalproperty'
|
1168
|
+
Enabled: true
|
1169
|
+
VersionAdded: '6.14.0'
|
1170
|
+
Exclude:
|
1171
|
+
- '**/metadata.rb'
|
1172
|
+
- '**/Berksfile'
|
1173
|
+
|
1174
|
+
Chef/Deprecations/CookbooksDependsOnSelf:
|
1175
|
+
Description: A cookbook cannot depend on itself in Chef Infra Client 13 or later.
|
1176
|
+
StyleGuide: 'chef_deprecations_cookbooksdependonself'
|
1177
|
+
Enabled: true
|
1178
|
+
VersionAdded: '5.2.0'
|
1179
|
+
VersionChanged: '6.16.0'
|
1180
|
+
Include:
|
1181
|
+
- '**/metadata.rb'
|
1182
|
+
|
1183
|
+
Chef/Deprecations/ChefShellout:
|
1184
|
+
Description: Don't use the deprecated `Chef::ShellOut` class which was removed in Chef Infra Client 13. Use the `Mixlib::ShellOut` class instead, which behaves identically.
|
1185
|
+
StyleGuide: 'chef_deprecations_chefshellout'
|
1186
|
+
Enabled: true
|
1187
|
+
VersionAdded: '6.17.0'
|
1188
|
+
Exclude:
|
1189
|
+
- '**/metadata.rb'
|
1190
|
+
- '**/attributes/*.rb'
|
1191
|
+
- '**/Berksfile'
|
1192
|
+
|
1193
|
+
Chef/Deprecations/ExecutePathProperty:
|
1194
|
+
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.
|
1195
|
+
StyleGuide: 'chef_deprecations_executepathproperty'
|
1196
|
+
Enabled: true
|
1197
|
+
VersionAdded: '6.17.0'
|
1198
|
+
Exclude:
|
1199
|
+
- '**/metadata.rb'
|
1200
|
+
- '**/attributes/*.rb'
|
1201
|
+
- '**/Berksfile'
|
1202
|
+
|
1203
|
+
Chef/Deprecations/ExecuteRelativeCreatesWithoutCwd:
|
1204
|
+
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.
|
1205
|
+
StyleGuide: 'chef_deprecations_executerelativecreateswithoutcwd'
|
1206
|
+
Enabled: true
|
1207
|
+
VersionAdded: '6.17.0'
|
1208
|
+
Exclude:
|
1209
|
+
- '**/metadata.rb'
|
1210
|
+
- '**/attributes/*.rb'
|
1211
|
+
- '**/Berksfile'
|
1212
|
+
|
1213
|
+
Chef/Deprecations/WindowsPackageInstallerTypeString:
|
1214
|
+
Description: In Chef Infra Client 13 and later the `windows_package` resource's `installer_type` property must be a symbol.
|
1215
|
+
StyleGuide: 'chef_deprecations_windowspackageinstallertypestring'
|
1216
|
+
Enabled: true
|
1217
|
+
VersionAdded: '6.17.0'
|
1218
|
+
Exclude:
|
1219
|
+
- '**/metadata.rb'
|
1220
|
+
- '**/attributes/*.rb'
|
1221
|
+
- '**/Berksfile'
|
1222
|
+
|
1223
|
+
Chef/Deprecations/UseYamlDump:
|
1224
|
+
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.
|
1225
|
+
StyleGuide: 'chef_deprecations_useyamldump'
|
1226
|
+
Enabled: true
|
1227
|
+
VersionAdded: '6.21.0'
|
1228
|
+
|
1229
|
+
Chef/Deprecations/LibrarianChefSpec:
|
1230
|
+
Description: The Librarian-Chef depsolving project is no longer maintained and ChefSpec should not use Librarian-Chef for cookbook depsolving. Consider using Policyfiles instead.
|
1231
|
+
StyleGuide: 'chef_deprecations_librarianchefspec'
|
1232
|
+
Enabled: true
|
1233
|
+
VersionAdded: '7.1.0'
|
1234
|
+
Include:
|
1235
|
+
- '**/specs/*.rb'
|
1236
|
+
|
1237
|
+
Chef/Deprecations/FoodcriticTesting:
|
1238
|
+
Description: The Foodcritic cookbook linter has been deprecated and should no longer be used for validating cookbooks
|
1239
|
+
StyleGuide: 'chef_deprecations_foodcritictesting'
|
1240
|
+
Enabled: true
|
1241
|
+
VersionAdded: '7.1.0'
|
1242
|
+
Include:
|
1243
|
+
- '**/Rakefile'
|
1244
|
+
- '**/Gemfile'
|
1245
|
+
|
1246
|
+
Chef/Deprecations/FoodcriticFile:
|
1247
|
+
Description: The Foodcritic cookbook linter has been deprecated and should no longer be used for validating cookbooks
|
1248
|
+
StyleGuide: 'chef_deprecations_foodcriticfile'
|
1249
|
+
Enabled: true
|
1250
|
+
VersionAdded: '7.32.0'
|
1251
|
+
Include:
|
1252
|
+
- '**/.foodcritic'
|
1253
|
+
|
1254
|
+
Chef/Deprecations/DeprecatedYumRepositoryActions:
|
1255
|
+
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.
|
1256
|
+
StyleGuide: 'chef_deprecations_deprecatedyumrepositoryactions'
|
1257
|
+
Enabled: true
|
1258
|
+
VersionAdded: '7.3.0'
|
1259
|
+
Exclude:
|
1260
|
+
- '**/metadata.rb'
|
1261
|
+
- '**/attributes/*.rb'
|
1262
|
+
- '**/Berksfile'
|
1263
|
+
- '**/Rakefile'
|
1264
|
+
|
1265
|
+
Chef/Deprecations/ChefSugarHelpers:
|
1266
|
+
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/main/chef-utils#getting-started
|
1267
|
+
StyleGuide: 'chef_deprecations_chefsugarhelpers'
|
1268
|
+
Enabled: true
|
1269
|
+
VersionAdded: '7.3.0'
|
1270
|
+
Exclude:
|
1271
|
+
- '**/metadata.rb'
|
1272
|
+
- '**/Berksfile'
|
1273
|
+
- '**/Rakefile'
|
1274
|
+
|
1275
|
+
Chef/Deprecations/HWRPWithoutUnifiedTrue:
|
1276
|
+
Description: Set `unified_mode true` in Chef Infra Client 15.3+ HWRP style custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default.
|
1277
|
+
StyleGuide: 'chef_deprecations_hwrpwithoutunifiedtrue'
|
1278
|
+
Enabled: true
|
1279
|
+
VersionAdded: '7.12.0'
|
1280
|
+
Include:
|
1281
|
+
- '**/libraries/*.rb'
|
1282
|
+
|
1283
|
+
Chef/Deprecations/ResourceWithoutUnifiedTrue:
|
1284
|
+
Description: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default.
|
1285
|
+
StyleGuide: 'chef_deprecations_resourcewithoutunifiedtrue'
|
1286
|
+
Enabled: true
|
1287
|
+
VersionAdded: '7.12.0'
|
1288
|
+
Include:
|
1289
|
+
- '**/resources/*.rb'
|
1290
|
+
Exclude:
|
1291
|
+
- '**/resources/_*.rb'
|
1292
|
+
- '**/spec/**/*.rb'
|
1293
|
+
|
1294
|
+
Chef/Deprecations/PolicyfileCommunitySource:
|
1295
|
+
Description: The Policyfile source of `:community` has been replaced with `:supermarket`
|
1296
|
+
StyleGuide: 'chef_deprecations_policyfilecommunitysource'
|
1297
|
+
Enabled: true
|
1298
|
+
VersionAdded: '7.15.0'
|
1299
|
+
Include:
|
1300
|
+
- '**/Policyfile.rb'
|
1301
|
+
|
1302
|
+
Chef/Deprecations/Delivery:
|
1303
|
+
Description: Do not include Chef Delivery (Workflow) configuration in your cookbooks. Chef Delivery (Workflow) went EOL Dec 31st 2021 and the delivery command was removed from Chef Workstation Feb 2022.
|
1304
|
+
StyleGuide: 'chef_deprecations_delivery'
|
1305
|
+
Enabled: true
|
1306
|
+
VersionAdded: '7.31.0'
|
1307
|
+
Include:
|
1308
|
+
- '**/.delivery/project.toml'
|
1309
|
+
- '**/.delivery/config.json'
|
1310
|
+
|
1311
|
+
Chef/Deprecations/DeprecatedSudoActions:
|
1312
|
+
Description: The `sudo` resource in the sudo cookbook 5.0 (2018) or Chef Infra Client 14 and later have replaced the existing `:install` and `:remove` actions with `:create` and `:delete` actions to better match other resources in Chef Infra.
|
1313
|
+
StyleGuide: 'chef_deprecations_deprecatedsudoactions'
|
1314
|
+
Enabled: true
|
1315
|
+
VersionAdded: '7.18.0'
|
1316
|
+
Exclude:
|
1317
|
+
- '**/spec/**/*.rb'
|
1318
|
+
- '**/metadata.rb'
|
1319
|
+
- '**/attributes/*.rb'
|
1320
|
+
- '**/Berksfile'
|
1321
|
+
- '**/Rakefile'
|
1322
|
+
|
1323
|
+
Chef/Deprecations/DependsOnChefNginxCookbook:
|
1324
|
+
Description: Don't depend on the deprecated `chef_nginx` cookbook that was replaced by the `nginx` cookbook. The legacy chef_nginx cookbook may not be compatible with newer Chef Infra Client releases.
|
1325
|
+
StyleGuide: 'chef_deprecations_dependsonchefnginxcookbook'
|
1326
|
+
Enabled: true
|
1327
|
+
VersionAdded: '7.20.0'
|
1328
|
+
Include:
|
1329
|
+
- '**/metadata.rb'
|
1330
|
+
|
1331
|
+
Chef/Deprecations/DependsOnChefReportingCookbook:
|
1332
|
+
Description: Don't depend on the chef-reporting cookbook made obsolete by Chef Infra Client 11.6. This cookbook installs a gem that is not compatible with newer Chef Infra Client releases.
|
1333
|
+
StyleGuide: 'chef_deprecations_dependsonchefreportingcookbook'
|
1334
|
+
Enabled: true
|
1335
|
+
VersionAdded: '7.20.0'
|
1336
|
+
Include:
|
1337
|
+
- '**/metadata.rb'
|
1338
|
+
|
1339
|
+
Chef/Deprecations/DependsOnOmnibusUpdaterCookbook:
|
1340
|
+
Description: Don't depend on the EOL `omnibus_updater` cookbook. This cookbook no longer works with newer Chef Infra Client releases and has been replaced with the more reliable `chef_client_updater` cookbook.
|
1341
|
+
StyleGuide: 'chef_deprecations_dependsonomnibusupdatercookbook'
|
1342
|
+
Enabled: true
|
1343
|
+
VersionAdded: '7.20.0'
|
1344
|
+
Include:
|
1345
|
+
- '**/metadata.rb'
|
1346
|
+
|
1347
|
+
###############################
|
1348
|
+
# Chef/Modernize: Cleaning up legacy code and using new built-in resources
|
1349
|
+
###############################
|
1350
|
+
|
1351
|
+
Chef/Modernize:
|
1352
|
+
Enabled: true
|
1353
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
1354
|
+
|
1355
|
+
Chef/Modernize/LegacyBerksfileSource:
|
1356
|
+
Description: Do not use legacy Berksfile community sources. Use Chef Supermarket instead.
|
1357
|
+
StyleGuide: 'chef_modernize_legacyberksfilesource'
|
1358
|
+
Enabled: true
|
1359
|
+
VersionAdded: '5.1.0'
|
1360
|
+
Include:
|
1361
|
+
- '**/Berksfile'
|
1362
|
+
|
1363
|
+
Chef/Modernize/WhyRunSupportedTrue:
|
1364
|
+
Description: whyrun_supported? no longer needs to be set to true as it is the default in Chef 13+
|
1365
|
+
StyleGuide: 'chef_modernize_whyrunsupportedtrue'
|
1366
|
+
Enabled: true
|
1367
|
+
VersionAdded: '5.1.0'
|
1368
|
+
Include:
|
1369
|
+
- '**/resources/*.rb'
|
1370
|
+
- '**/providers/*.rb'
|
1371
|
+
- '**/libraries/*.rb'
|
1372
|
+
|
1373
|
+
Chef/Modernize/UnnecessaryDependsChef14:
|
1374
|
+
Description: Don't depend on cookbooks made obsolete by Chef Infra Client 14.0+. These community cookbooks contain resources that are now included in Chef Infra Client itself.
|
1375
|
+
StyleGuide: 'chef_modernize_unnecessarydependschef14'
|
1376
|
+
Enabled: true
|
1377
|
+
VersionAdded: '5.1.0'
|
1378
|
+
Include:
|
1379
|
+
- '**/metadata.rb'
|
1380
|
+
|
1381
|
+
Chef/Modernize/RespondToInMetadata:
|
1382
|
+
Description: It is no longer necessary to use respond_to? in metadata.rb in Chef Infra Client 12.15 and later
|
1383
|
+
StyleGuide: 'chef_modernize_respondtoinmetadata'
|
1384
|
+
Enabled: true
|
1385
|
+
VersionAdded: '5.2.0'
|
1386
|
+
Include:
|
1387
|
+
- '**/metadata.rb'
|
1388
|
+
|
1389
|
+
Chef/Modernize/RespondToResourceName:
|
1390
|
+
Description: respond_to?(:resource_name) in resources is no longer necessary in Chef Infra Client 12.5+
|
1391
|
+
StyleGuide: 'chef_modernize_respondtoresourcename'
|
1392
|
+
Enabled: true
|
1393
|
+
VersionAdded: '5.2.0'
|
1394
|
+
Include:
|
1395
|
+
- '**/resources/*.rb'
|
1396
|
+
- '**/libraries/*.rb'
|
1397
|
+
|
1398
|
+
Chef/Modernize/RespondToProvides:
|
1399
|
+
Description: respond_to?(:provides) in resources is no longer necessary in Chef Infra Client 12+
|
1400
|
+
StyleGuide: 'chef_modernize_respondtoprovides'
|
1401
|
+
Enabled: true
|
1402
|
+
VersionAdded: '5.2.0'
|
1403
|
+
Include:
|
1404
|
+
- '**/providers/*.rb'
|
1405
|
+
- '**/resources/*.rb'
|
1406
|
+
- '**/libraries/*.rb'
|
1407
|
+
|
1408
|
+
Chef/Modernize/SetOrReturnInResources:
|
1409
|
+
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.
|
1410
|
+
StyleGuide: 'chef_modernize_setorreturninresources'
|
1411
|
+
Enabled: true
|
1412
|
+
VersionAdded: '5.2.0'
|
1413
|
+
Include:
|
1414
|
+
- '**/resources/*.rb'
|
1415
|
+
- '**/libraries/*.rb'
|
1416
|
+
|
1417
|
+
Chef/Modernize/CustomResourceWithAttributes:
|
1418
|
+
Description: Custom Resources should contain properties not attributes.
|
1419
|
+
StyleGuide: 'chef_modernize_customresourcewithattributes'
|
1420
|
+
Enabled: true
|
1421
|
+
VersionAdded: '5.2.0'
|
1422
|
+
Include:
|
1423
|
+
- '**/resources/*.rb'
|
1424
|
+
|
1425
|
+
Chef/Modernize/IncludingAptDefaultRecipe:
|
1426
|
+
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.
|
1427
|
+
StyleGuide: 'chef_modernize_includingaptdefaultrecipe'
|
1428
|
+
Enabled: true
|
1429
|
+
VersionAdded: '5.3.0'
|
1430
|
+
Exclude:
|
1431
|
+
- '**/metadata.rb'
|
1432
|
+
|
1433
|
+
Chef/Modernize/IncludingWindowsDefaultRecipe:
|
1434
|
+
Description: Do not include the Windows default recipe, which only installs win32 gems already included in Chef Infra Client
|
1435
|
+
StyleGuide: 'chef_modernize_includingwindowsdefaultrecipe'
|
1436
|
+
Enabled: true
|
1437
|
+
VersionAdded: '5.3.0'
|
1438
|
+
Exclude:
|
1439
|
+
- '**/metadata.rb'
|
1440
|
+
|
1441
|
+
Chef/Modernize/DefinesChefSpecMatchers:
|
1442
|
+
Description: ChefSpec matchers are now auto generated by ChefSpec 7.1+ and do not need to be defined in a cookbook
|
1443
|
+
StyleGuide: 'chef_modernize_defineschefspecmatchers'
|
1444
|
+
Enabled: true
|
1445
|
+
VersionAdded: '5.3.0'
|
1446
|
+
Include:
|
1447
|
+
- '**/libraries/*.rb'
|
1448
|
+
|
1449
|
+
Chef/Modernize/ExecuteAptUpdate:
|
1450
|
+
Description: Use the apt_update resource instead of the execute resource to run an apt-get update package cache update
|
1451
|
+
StyleGuide: 'chef_modernize_executeaptupdate'
|
1452
|
+
Enabled: true
|
1453
|
+
VersionAdded: '5.3.0'
|
1454
|
+
Exclude:
|
1455
|
+
- '**/metadata.rb'
|
1456
|
+
|
1457
|
+
Chef/Modernize/MinitestHandlerUsage:
|
1458
|
+
Description: Use Chef InSpec for testing instead of the Minitest Handler cookbook pattern.
|
1459
|
+
StyleGuide: 'chef_modernize_minitesthandlerusage'
|
1460
|
+
Enabled: true
|
1461
|
+
VersionAdded: '5.4.0'
|
1462
|
+
Include:
|
1463
|
+
- '**/metadata.rb'
|
1464
|
+
|
1465
|
+
Chef/Modernize/IncludingMixinShelloutInResources:
|
1466
|
+
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+.
|
1467
|
+
StyleGuide: 'chef_modernize_includingmixinshelloutinresources'
|
1468
|
+
Enabled: true
|
1469
|
+
VersionAdded: '5.4.0'
|
1470
|
+
Include:
|
1471
|
+
- '**/resources/*.rb'
|
1472
|
+
- '**/providers/*.rb'
|
1473
|
+
- '**/libraries/*.rb'
|
1474
|
+
|
1475
|
+
Chef/Modernize/UseBuildEssentialResource:
|
1476
|
+
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+
|
1477
|
+
StyleGuide: 'chef_modernize_usebuildessentialresource'
|
1478
|
+
Enabled: true
|
1479
|
+
VersionAdded: '5.1.0'
|
1480
|
+
Exclude:
|
1481
|
+
- '**/metadata.rb'
|
1482
|
+
|
1483
|
+
Chef/Modernize/WindowsZipfileUsage:
|
1484
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the windows_zipfile from the Windows cookbook
|
1485
|
+
StyleGuide: 'chef_modernize_windowszipfileusage'
|
1486
|
+
Enabled: true
|
1487
|
+
VersionAdded: '5.4.0'
|
1488
|
+
Exclude:
|
1489
|
+
- '**/metadata.rb'
|
1490
|
+
|
1491
|
+
Chef/Modernize/SevenZipArchiveResource:
|
1492
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the seven_zip_archive
|
1493
|
+
StyleGuide: 'chef_modernize_sevenziparchiveresource'
|
1494
|
+
Enabled: true
|
1495
|
+
VersionAdded: '5.5.0'
|
1496
|
+
Exclude:
|
1497
|
+
- '**/metadata.rb'
|
1498
|
+
|
1499
|
+
Chef/Modernize/LibarchiveFileResource:
|
1500
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the libarchive file resource from the libarchive cookbook
|
1501
|
+
StyleGuide: 'chef_modernize_libarchivefileresource'
|
1502
|
+
Enabled: true
|
1503
|
+
VersionAdded: '5.5.0'
|
1504
|
+
Exclude:
|
1505
|
+
- '**/metadata.rb'
|
1506
|
+
|
1507
|
+
Chef/Modernize/PowershellScriptExpandArchive:
|
1508
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of using Expand-Archive in a powershell_script resource
|
1509
|
+
StyleGuide: 'chef_modernize_powershellscriptexpandarchive'
|
1510
|
+
Enabled: true
|
1511
|
+
VersionAdded: '5.5.0'
|
1512
|
+
Exclude:
|
1513
|
+
- '**/metadata.rb'
|
1514
|
+
|
1515
|
+
Chef/Modernize/PowershellInstallPackage:
|
1516
|
+
Description: Use the package resource built into Chef Infra Client instead of using Install-Package in a powershell_script resource
|
1517
|
+
StyleGuide: 'chef_modernize_powershellinstallpackage'
|
1518
|
+
Enabled: true
|
1519
|
+
VersionAdded: '5.5.0'
|
1520
|
+
Exclude:
|
1521
|
+
- '**/metadata.rb'
|
1522
|
+
|
1523
|
+
Chef/Modernize/PowershellInstallWindowsFeature:
|
1524
|
+
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
|
1525
|
+
StyleGuide: 'chef_modernize_powershellinstallwindowsfeature'
|
1526
|
+
Enabled: true
|
1527
|
+
VersionAdded: '5.5.0'
|
1528
|
+
Exclude:
|
1529
|
+
- '**/metadata.rb'
|
1530
|
+
|
1531
|
+
Chef/Modernize/ShellOutToChocolatey:
|
1532
|
+
Description: Use the Chocolatey resources built into Chef Infra Client instead of shelling out to the choco command
|
1533
|
+
StyleGuide: 'chef_modernize_shellouttochocolatey'
|
1534
|
+
Enabled: true
|
1535
|
+
VersionAdded: '5.5.0'
|
1536
|
+
Exclude:
|
1537
|
+
- '**/metadata.rb'
|
1538
|
+
|
1539
|
+
Chef/Modernize/CronManageResource:
|
1540
|
+
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.
|
1541
|
+
StyleGuide: 'chef_modernize_cronmanageresource'
|
1542
|
+
Enabled: true
|
1543
|
+
VersionAdded: '5.6.0'
|
1544
|
+
Exclude:
|
1545
|
+
- '**/metadata.rb'
|
1546
|
+
|
1547
|
+
Chef/Modernize/UsesZypperRepo:
|
1548
|
+
Description: The zypper_repo resource was renamed zypper_repository when it was added to Chef Infra Client 13.3.
|
1549
|
+
StyleGuide: 'chef_modernize_useszypperrepo'
|
1550
|
+
Enabled: true
|
1551
|
+
VersionAdded: '5.6.0'
|
1552
|
+
Exclude:
|
1553
|
+
- '**/metadata.rb'
|
1554
|
+
|
1555
|
+
Chef/Modernize/DependsOnZypperCookbook:
|
1556
|
+
Description: Don't include the zypper cookbook as the zypper_repository resource is built into Chef Infra Client 13.3+
|
1557
|
+
StyleGuide: 'chef_modernize_dependsonzyppercookbook'
|
1558
|
+
Enabled: true
|
1559
|
+
VersionAdded: '5.6.0'
|
1560
|
+
Exclude:
|
1561
|
+
- '**/metadata.rb'
|
1562
|
+
|
1563
|
+
Chef/Modernize/ExecuteTzUtil:
|
1564
|
+
Description: Use the timezone resource included in Chef Infra Client 14.6+ instead of shelling out to tzutil
|
1565
|
+
StyleGuide: 'chef_modernize_executetzutil'
|
1566
|
+
Enabled: true
|
1567
|
+
VersionAdded: '5.6.0'
|
1568
|
+
Exclude:
|
1569
|
+
- '**/metadata.rb'
|
1570
|
+
|
1571
|
+
Chef/Modernize/OpensslRsaKeyResource:
|
1572
|
+
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.
|
1573
|
+
StyleGuide: 'chef_modernize_opensslrsakeyresource'
|
1574
|
+
Enabled: true
|
1575
|
+
VersionAdded: '5.6.0'
|
1576
|
+
Exclude:
|
1577
|
+
- '**/metadata.rb'
|
1578
|
+
|
1579
|
+
Chef/Modernize/OpensslX509Resource:
|
1580
|
+
Description: The openssl_x509 resource was renamed to openssl_x509_certificate in Chef Infra Client 14.4. The new resource name should be used.
|
1581
|
+
StyleGuide: 'chef_modernize_opensslx509resource'
|
1582
|
+
Enabled: true
|
1583
|
+
VersionAdded: '5.6.0'
|
1584
|
+
Exclude:
|
1585
|
+
- '**/metadata.rb'
|
1586
|
+
|
1587
|
+
Chef/Modernize/OsxConfigProfileResource:
|
1588
|
+
Description: The osx_config_profile resource was renamed to osx_profile. The new resource name should be used.
|
1589
|
+
StyleGuide: 'chef_modernize_osxconfigprofileresource'
|
1590
|
+
Enabled: true
|
1591
|
+
VersionAdded: '5.6.0'
|
1592
|
+
Exclude:
|
1593
|
+
- '**/metadata.rb'
|
1594
|
+
|
1595
|
+
Chef/Modernize/SysctlParamResource:
|
1596
|
+
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.
|
1597
|
+
StyleGuide: 'chef_modernize_sysctlparamresource'
|
1598
|
+
Enabled: true
|
1599
|
+
VersionAdded: '5.6.0'
|
1600
|
+
Exclude:
|
1601
|
+
- '**/metadata.rb'
|
1602
|
+
|
1603
|
+
Chef/Modernize/MacOsXUserdefaults:
|
1604
|
+
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.
|
1605
|
+
StyleGuide: 'chef_modernize_macosxuserdefaults'
|
1606
|
+
Enabled: true
|
1607
|
+
VersionAdded: '5.6.0'
|
1608
|
+
Exclude:
|
1609
|
+
- '**/metadata.rb'
|
1610
|
+
|
1611
|
+
Chef/Modernize/PowerShellGuardInterpreter:
|
1612
|
+
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.
|
1613
|
+
StyleGuide: 'chef_modernize_powershellguardinterpreter'
|
1614
|
+
Enabled: true
|
1615
|
+
VersionAdded: '5.9.0'
|
1616
|
+
Exclude:
|
1617
|
+
- '**/metadata.rb'
|
1618
|
+
|
1619
|
+
Chef/Modernize/DefaultActionFromInitialize:
|
1620
|
+
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.
|
1621
|
+
StyleGuide: 'chef_modernize_defaultactionfrominitialize'
|
1622
|
+
Enabled: true
|
1623
|
+
VersionAdded: '5.10.0'
|
1624
|
+
Include:
|
1625
|
+
- '**/resources/*.rb'
|
1626
|
+
- '**/providers/*.rb'
|
1627
|
+
- '**/libraries/*.rb'
|
1628
|
+
|
1629
|
+
Chef/Modernize/ResourceNameFromInitialize:
|
1630
|
+
Description: The name of a resource can be set with the "resource_name" helper instead of using the initialize method.
|
1631
|
+
StyleGuide: 'chef_modernize_resourcenamefrominitialize'
|
1632
|
+
Enabled: true
|
1633
|
+
VersionAdded: '5.10.0'
|
1634
|
+
Include:
|
1635
|
+
- '**/resources/*.rb'
|
1636
|
+
- '**/providers/*.rb'
|
1637
|
+
- '**/libraries/*.rb'
|
1638
|
+
|
1639
|
+
Chef/Modernize/Definitions:
|
1640
|
+
Description: Legacy Chef Infra definitions should be rewritten as custom resources to take full advantage of the Chef Infra feature set.
|
1641
|
+
StyleGuide: 'chef_modernize_definitions'
|
1642
|
+
Enabled: true
|
1643
|
+
VersionAdded: '5.11.0'
|
1644
|
+
Include:
|
1645
|
+
- '**/definitions/*.rb'
|
1646
|
+
|
1647
|
+
Chef/Modernize/IfProvidesDefaultAction:
|
1648
|
+
Description: if defined?(default_action) is no longer necessary in Chef Infra resources as default_action shipped in Chef Infra Client 10.8.
|
1649
|
+
StyleGuide: 'chef_modernize_ifprovidesdefaultaction'
|
1650
|
+
Enabled: true
|
1651
|
+
VersionAdded: '5.12.0'
|
1652
|
+
Include:
|
1653
|
+
- '**/resources/*.rb'
|
1654
|
+
- '**/libraries/*.rb'
|
1655
|
+
|
1656
|
+
Chef/Modernize/ZipfileResource:
|
1657
|
+
Description: Use the archive_file resource built into Chef Infra Client 15+ instead of the zipfile resource from the zipfile cookbook.
|
1658
|
+
StyleGuide: 'chef_modernize_zipfileresource'
|
1659
|
+
Enabled: true
|
1660
|
+
VersionAdded: '5.12.0'
|
1661
|
+
|
1662
|
+
Chef/Modernize/UnnecessaryMixlibShelloutRequire:
|
1663
|
+
Description: Chef Infra Client 12.4 and later include mixlib/shellout automatically in resources and providers.
|
1664
|
+
StyleGuide: 'chef_modernize_unnecessarymixlibshelloutrequire'
|
1665
|
+
Enabled: true
|
1666
|
+
VersionAdded: '5.12.0'
|
1667
|
+
Include:
|
1668
|
+
- '**/resources/*.rb'
|
1669
|
+
- '**/providers/*.rb'
|
1670
|
+
|
1671
|
+
Chef/Modernize/EmptyResourceInitializeMethod:
|
1672
|
+
Description: There is no need for an empty initialize method in a resource
|
1673
|
+
StyleGuide: 'chef_modernize_emptyresourceinitializemethod'
|
1674
|
+
Enabled: true
|
1675
|
+
VersionAdded: '5.13.0'
|
1676
|
+
Include:
|
1677
|
+
- '**/resources/*.rb'
|
1678
|
+
- '**/providers/*.rb'
|
1679
|
+
|
1680
|
+
Chef/Modernize/ChefGemNokogiri:
|
1681
|
+
Description: The nokogiri gem ships in Chef Infra Client 12+ and does not need to be installed before being used.
|
1682
|
+
StyleGuide: 'chef_modernize_chefgemnokogiri'
|
1683
|
+
Enabled: true
|
1684
|
+
VersionAdded: '5.14.0'
|
1685
|
+
Exclude:
|
1686
|
+
- '**/metadata.rb'
|
1687
|
+
- '**/attributes/*.rb'
|
1688
|
+
|
1689
|
+
Chef/Modernize/PropertyWithNameAttribute:
|
1690
|
+
Description: Resource property sets name_attribute not name_property
|
1691
|
+
StyleGuide: 'chef_modernize_propertywithnameattribute'
|
1692
|
+
Enabled: true
|
1693
|
+
VersionAdded: '5.1.0'
|
1694
|
+
VersionChanged: '5.15.0'
|
1695
|
+
Include:
|
1696
|
+
- '**/resources/*.rb'
|
1697
|
+
- '**/libraries/*.rb'
|
1698
|
+
|
1699
|
+
Chef/Modernize/IncludingOhaiDefaultRecipe:
|
1700
|
+
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.
|
1701
|
+
StyleGuide: 'chef_modernize_includingohaidefaultrecipe'
|
1702
|
+
Enabled: true
|
1703
|
+
VersionAdded: '5.4.0'
|
1704
|
+
VersionChanged: '5.15.0'
|
1705
|
+
Exclude:
|
1706
|
+
- '**/metadata.rb'
|
1707
|
+
- '**/Berksfile'
|
1708
|
+
|
1709
|
+
Chef/Modernize/AllowedActionsFromInitialize:
|
1710
|
+
Description: The allowed actions of a resource can be set with the "allowed_actions" helper instead of using the initialize method.
|
1711
|
+
StyleGuide: 'chef_modernize_allowedactionsfrominitialize'
|
1712
|
+
Enabled: true
|
1713
|
+
VersionAdded: '5.15.0'
|
1714
|
+
Include:
|
1715
|
+
- '**/resources/*.rb'
|
1716
|
+
- '**/libraries/*.rb'
|
1717
|
+
|
1718
|
+
Chef/Modernize/FoodcriticComments:
|
1719
|
+
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.
|
1720
|
+
StyleGuide: 'chef_modernize_foodcriticcomments'
|
1721
|
+
Enabled: true
|
1722
|
+
VersionAdded: '5.16.0'
|
1723
|
+
Exclude:
|
1724
|
+
- '**/Berksfile'
|
1725
|
+
|
1726
|
+
Chef/Modernize/ExecuteScExe:
|
1727
|
+
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/resources/windows_service for additional details on creating services with the windows_service resource
|
1728
|
+
StyleGuide: 'chef_modernize_executescexe'
|
1729
|
+
Enabled: true
|
1730
|
+
VersionAdded: '5.16.0'
|
1731
|
+
Exclude:
|
1732
|
+
- '**/metadata.rb'
|
1733
|
+
- '**/attributes/*.rb'
|
1734
|
+
- '**/Berksfile'
|
1735
|
+
|
1736
|
+
Chef/Modernize/WindowsScResource:
|
1737
|
+
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/resources/windows_service for additional details.
|
1738
|
+
StyleGuide: 'chef_modernize_windowsscresource'
|
1739
|
+
Enabled: true
|
1740
|
+
VersionAdded: '5.16.0'
|
1741
|
+
Exclude:
|
1742
|
+
- '**/metadata.rb'
|
1743
|
+
- '**/attributes/*.rb'
|
1744
|
+
- '**/Berksfile'
|
1745
|
+
|
1746
|
+
Chef/Modernize/ExecuteSleep:
|
1747
|
+
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.
|
1748
|
+
StyleGuide: 'chef_modernize_executesleep'
|
1749
|
+
Enabled: true
|
1750
|
+
VersionAdded: '5.16.0'
|
1751
|
+
Exclude:
|
1752
|
+
- '**/metadata.rb'
|
1753
|
+
- '**/attributes/*.rb'
|
1754
|
+
- '**/Berksfile'
|
1755
|
+
|
1756
|
+
Chef/Modernize/DslIncludeInResource:
|
1757
|
+
Description: 'There is no need to include Chef::DSL::Recipe or Chef::DSL::IncludeRecipe classes in resources or providers as this is done automatically.'
|
1758
|
+
StyleGuide: 'chef_modernize_dslincludeinresource'
|
1759
|
+
Enabled: true
|
1760
|
+
VersionAdded: '5.17.0'
|
1761
|
+
Include:
|
1762
|
+
- '**/resources/*.rb'
|
1763
|
+
- '**/providers/*.rb'
|
1764
|
+
|
1765
|
+
Chef/Modernize/ResourceForcingCompileTime:
|
1766
|
+
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`.
|
1767
|
+
StyleGuide: 'chef_modernize_resourceforcingcompiletime'
|
1768
|
+
Enabled: true
|
1769
|
+
VersionAdded: '5.18.0'
|
1770
|
+
Exclude:
|
1771
|
+
- '**/metadata.rb'
|
1772
|
+
- '**/attributes/*.rb'
|
1773
|
+
- '**/Berksfile'
|
1774
|
+
|
1775
|
+
Chef/Modernize/ExecuteSysctl:
|
1776
|
+
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.
|
1777
|
+
StyleGuide: 'chef_modernize_executesysctl'
|
1778
|
+
Enabled: true
|
1779
|
+
VersionAdded: '5.18.0'
|
1780
|
+
Exclude:
|
1781
|
+
- '**/metadata.rb'
|
1782
|
+
- '**/attributes/*.rb'
|
1783
|
+
- '**/Berksfile'
|
1784
|
+
|
1785
|
+
Chef/Modernize/SimplifyAptPpaSetup:
|
1786
|
+
Description: The apt_repository resource allows setting up PPAs without using the full URL to ppa.launchpad.net.
|
1787
|
+
StyleGuide: 'chef_modernize_simplifyaptppasetup'
|
1788
|
+
Enabled: true
|
1789
|
+
VersionAdded: '5.21.0'
|
1790
|
+
Exclude:
|
1791
|
+
- '**/metadata.rb'
|
1792
|
+
- '**/attributes/*.rb'
|
1793
|
+
- '**/Berksfile'
|
1794
|
+
|
1795
|
+
Chef/Modernize/UseRequireRelative:
|
1796
|
+
Description: Instead of using require with a File.expand_path and __FILE__ use the simpler require_relative method.
|
1797
|
+
StyleGuide: 'chef_modernize_userequirerelative'
|
1798
|
+
Enabled: true
|
1799
|
+
VersionAdded: '5.22.0'
|
1800
|
+
Exclude:
|
1801
|
+
- '**/metadata.rb'
|
1802
|
+
- '**/attributes/*.rb'
|
1803
|
+
- '**/Berksfile'
|
1804
|
+
|
1805
|
+
Chef/Modernize/NodeInitPackage:
|
1806
|
+
Description: Use node['init_package'] to check for systemd instead of reading the contents of '/proc/1/comm'
|
1807
|
+
StyleGuide: 'chef_modernize_nodeinitpackage'
|
1808
|
+
Enabled: true
|
1809
|
+
VersionAdded: '5.22.0'
|
1810
|
+
Exclude:
|
1811
|
+
- '**/metadata.rb'
|
1812
|
+
- '**/Berksfile'
|
1813
|
+
|
1814
|
+
Chef/Modernize/WindowsRegistryUAC:
|
1815
|
+
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.
|
1816
|
+
StyleGuide: 'chef_modernize_windowsregistryuac'
|
1817
|
+
Enabled: true
|
1818
|
+
VersionAdded: '5.22.0'
|
1819
|
+
Exclude:
|
1820
|
+
- '**/metadata.rb'
|
1821
|
+
- '**/attributes/*.rb'
|
1822
|
+
- '**/Berksfile'
|
1823
|
+
|
1824
|
+
Chef/Modernize/UseMultipackageInstalls:
|
1825
|
+
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.
|
1826
|
+
StyleGuide: 'chef_modernize_usemultipackageinstalls'
|
1827
|
+
Enabled: true
|
1828
|
+
VersionAdded: '6.0.0'
|
1829
|
+
Exclude:
|
1830
|
+
- '**/metadata.rb'
|
1831
|
+
- '**/attributes/*.rb'
|
1832
|
+
- '**/Berksfile'
|
1833
|
+
|
1834
|
+
Chef/Modernize/ProvidesFromInitialize:
|
1835
|
+
Description: Provides should be set using the `provides` resource DSL method instead of instead of setting @provides in the initialize method.
|
1836
|
+
StyleGuide: 'chef_modernize_providesfrominitialize'
|
1837
|
+
Enabled: true
|
1838
|
+
VersionAdded: '6.0.0'
|
1839
|
+
Include:
|
1840
|
+
- '**/resources/*.rb'
|
1841
|
+
- '**/providers/*.rb'
|
1842
|
+
- '**/libraries/*.rb'
|
1843
|
+
|
1844
|
+
Chef/Modernize/DatabagHelpers:
|
1845
|
+
Description: Use the `data_bag_item` helper instead of `Chef::DataBagItem.load` or `Chef::EncryptedDataBagItem.load`.
|
1846
|
+
StyleGuide: 'chef_modernize_databaghelpers'
|
1847
|
+
Enabled: true
|
1848
|
+
VersionAdded: '6.0.0'
|
1849
|
+
Exclude:
|
1850
|
+
- '**/metadata.rb'
|
1851
|
+
- '**/Berksfile'
|
1852
|
+
|
1853
|
+
Chef/Modernize/NodeRolesInclude:
|
1854
|
+
Description: Use `node.role?('foo')` to check if a node includes a role instead of `node['roles'].include?('foo')`.
|
1855
|
+
StyleGuide: 'chef_modernize_noderolesinclude'
|
1856
|
+
Enabled: true
|
1857
|
+
VersionAdded: '6.1.0'
|
1858
|
+
Exclude:
|
1859
|
+
- '**/metadata.rb'
|
1860
|
+
- '**/Berksfile'
|
1861
|
+
|
1862
|
+
Chef/Modernize/RespondToCompileTime:
|
1863
|
+
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.
|
1864
|
+
StyleGuide: 'chef_modernize_resondtocompiletime'
|
1865
|
+
Enabled: true
|
1866
|
+
VersionAdded: '6.3.0'
|
1867
|
+
Exclude:
|
1868
|
+
- '**/metadata.rb'
|
1869
|
+
- '**/Berksfile'
|
1870
|
+
|
1871
|
+
Chef/Modernize/ShellOutHelper:
|
1872
|
+
Description: Use the built-in shell_out helper available in Chef Infra Client 12.11+ instead of calling Mixlib::ShellOut.new('foo').run_command.
|
1873
|
+
StyleGuide: 'chef_modernize_shellouthelper'
|
1874
|
+
Enabled: true
|
1875
|
+
VersionAdded: '6.5.0'
|
1876
|
+
Exclude:
|
1877
|
+
- '**/metadata.rb'
|
1878
|
+
- '**/Berksfile'
|
1879
|
+
- '**/libraries/*.rb'
|
1880
|
+
|
1881
|
+
Chef/Modernize/ConditionalUsingTest:
|
1882
|
+
Description: Use ::File.exist?('/foo/bar') instead of the slower 'test -f /foo/bar' which requires shelling out.
|
1883
|
+
StyleGuide: 'chef_modernize_conditionalusingtest'
|
1884
|
+
Enabled: true
|
1885
|
+
VersionAdded: '6.11.0'
|
1886
|
+
Exclude:
|
1887
|
+
- '**/metadata.rb'
|
1888
|
+
- '**/Berksfile'
|
1889
|
+
- '**/attributes/*.rb'
|
1890
|
+
|
1891
|
+
Chef/Modernize/CronDFileOrTemplate:
|
1892
|
+
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
|
1893
|
+
StyleGuide: 'chef_modernize_crondfileortemplate'
|
1894
|
+
Enabled: true
|
1895
|
+
VersionAdded: '6.13.0'
|
1896
|
+
Exclude:
|
1897
|
+
- '**/metadata.rb'
|
1898
|
+
- '**/Berksfile'
|
1899
|
+
- '**/attributes/*.rb'
|
1900
|
+
|
1901
|
+
Chef/Modernize/ActionMethodInResource:
|
1902
|
+
Description: Use the custom resource language's `action :my_action` blocks instead of creating actions with methods.
|
1903
|
+
StyleGuide: 'chef_modernize_actionmethodinresource'
|
1904
|
+
Enabled: true
|
1905
|
+
VersionAdded: '6.13.0'
|
1906
|
+
Include:
|
1907
|
+
- '**/resources/*.rb'
|
1908
|
+
- '**/providers/*.rb'
|
1909
|
+
|
1910
|
+
Chef/Modernize/UnnecessaryDependsChef15:
|
1911
|
+
Description: Don't depend on cookbooks made obsolete by Chef Infra Client 15.0+. These community cookbooks contain resources that are now included in Chef Infra Client itself.
|
1912
|
+
StyleGuide: 'chef_modernize_unnecessarydependschef15'
|
1913
|
+
Enabled: true
|
1914
|
+
VersionAdded: '7.19.0'
|
1915
|
+
Include:
|
1916
|
+
- '**/metadata.rb'
|
1917
|
+
|
1918
|
+
Chef/Modernize/DependsOnLocaleCookbook:
|
1919
|
+
Description: Don't depend on the locale cookbook made obsolete by Chef Infra Client 14.5. The locale resource is now included in Chef Infra Client itself.
|
1920
|
+
StyleGuide: 'chef_modernize_dependsonlocalecookbook'
|
1921
|
+
Enabled: true
|
1922
|
+
VersionAdded: '7.19.0'
|
1923
|
+
Include:
|
1924
|
+
- '**/metadata.rb'
|
1925
|
+
|
1926
|
+
Chef/Modernize/DependsOnTimezoneLwrpCookbook:
|
1927
|
+
Description: Don't depend on the timezone_lwrp cookbook made obsolete by Chef Infra Client 14.6. The timezone resource is now included in Chef Infra Client itself.
|
1928
|
+
StyleGuide: 'chef_modernize_dependsontimezonelwrpcookbook'
|
1929
|
+
Enabled: true
|
1930
|
+
VersionAdded: '7.19.0'
|
1931
|
+
Include:
|
1932
|
+
- '**/metadata.rb'
|
1933
|
+
|
1934
|
+
Chef/Modernize/DependsOnWindowsFirewallCookbook:
|
1935
|
+
Description: Don't depend on the windows_firewall cookbook made obsolete by Chef Infra Client 14.7. The windows_firewall resource is now included in Chef Infra Client itself.
|
1936
|
+
StyleGuide: 'chef_modernize_dependsonwindowsfirewallcookbook'
|
1937
|
+
Enabled: true
|
1938
|
+
VersionAdded: '7.19.0'
|
1939
|
+
Include:
|
1940
|
+
- '**/metadata.rb'
|
1941
|
+
|
1942
|
+
Chef/Modernize/DependsOnKernelModuleCookbook:
|
1943
|
+
Description: Don't depend on the kernel_module cookbook made obsolete by Chef Infra Client 14.3. The kernel_module resource is now included in Chef Infra Client itself.
|
1944
|
+
StyleGuide: 'chef_modernize_dependsonkernelmodulecookbook'
|
1945
|
+
Enabled: true
|
1946
|
+
VersionAdded: '7.19.0'
|
1947
|
+
Include:
|
1948
|
+
- '**/metadata.rb'
|
1949
|
+
|
1950
|
+
Chef/Modernize/DependsOnChefVaultCookbook:
|
1951
|
+
Description: Don't depend on the chef-vault cookbook made obsolete by Chef Infra Client 16.0. The chef-vault gem and helpers are now included in Chef Infra Client itself.
|
1952
|
+
StyleGuide: 'chef_modernize_dependsonchefvaultcookbook'
|
1953
|
+
Enabled: true
|
1954
|
+
VersionAdded: '7.20.0'
|
1955
|
+
Include:
|
1956
|
+
- '**/metadata.rb'
|
1957
|
+
|
1958
|
+
Chef/Modernize/DependsOnChocolateyCookbooks:
|
1959
|
+
Description: Don't depend on the chocolatey_source or chocolatey_config cookbooks made obsolete by Chef Infra Client 14.3. The chocolatey_source and chocolatey_config resources are now included in Chef Infra Client itself.
|
1960
|
+
StyleGuide: 'chef_modernize_dependsonchocolateycookbooks'
|
1961
|
+
Enabled: true
|
1962
|
+
VersionAdded: '7.20.0'
|
1963
|
+
Include:
|
1964
|
+
- '**/metadata.rb'
|
1965
|
+
|
1966
|
+
Chef/Modernize/DependsOnOpensslCookbook:
|
1967
|
+
Description: Don't depend on the `openssl` cookbook which was made obsolete by Chef Infra Client 14.4. All `openssl_*` resources are now included directly in Chef Infra Client.
|
1968
|
+
StyleGuide: 'chef_modernize_dependsonopensslcookbook'
|
1969
|
+
Enabled: true
|
1970
|
+
VersionAdded: '7.20.0'
|
1971
|
+
Include:
|
1972
|
+
- '**/metadata.rb'
|
1973
|
+
|
1974
|
+
Chef/Modernize/UseChefLanguageEnvHelpers:
|
1975
|
+
Description: Chef Infra Client 15.5 and later include a large number of new helpers in the Chef Infra Language to simplify checking the system configuration in recipes and resources. These should be used when possible over more complex attributes or ENV var comparisons.
|
1976
|
+
StyleGuide: 'chef_modernize_usecheflanguageenvhelpers'
|
1977
|
+
Enabled: true
|
1978
|
+
VersionAdded: '7.21.0'
|
1979
|
+
Include:
|
1980
|
+
- '**/resources/*.rb'
|
1981
|
+
- '**/providers/*.rb'
|
1982
|
+
- '**/recipes/*.rb'
|
1983
|
+
|
1984
|
+
Chef/Modernize/UseChefLanguageCloudHelpers:
|
1985
|
+
Description: Chef Infra Client 15.5 and later include cloud helpers to make detecting instances that run on public and private clouds easier.
|
1986
|
+
StyleGuide: 'chef_modernize_usecheflanguagecloudhelpers'
|
1987
|
+
Enabled: true
|
1988
|
+
VersionAdded: '7.22.0'
|
1989
|
+
Include:
|
1990
|
+
- '**/resources/*.rb'
|
1991
|
+
- '**/providers/*.rb'
|
1992
|
+
- '**/recipes/*.rb'
|
1993
|
+
|
1994
|
+
Chef/Modernize/ClassEvalActionClass:
|
1995
|
+
Description: In Chef Infra Client 12.9 and later it is no longer necessary to call the class_eval method on the action class block.
|
1996
|
+
StyleGuide: 'chef_modernize_classevalactionclass'
|
1997
|
+
Enabled: true
|
1998
|
+
VersionAdded: '7.23.0'
|
1999
|
+
Include:
|
2000
|
+
- '**/resources/*.rb'
|
2001
|
+
|
2002
|
+
Chef/Modernize/UseChefLanguageSystemdHelper:
|
2003
|
+
Description: Chef Infra Client 15.5 and later include a `systemd?` helper for checking if a Linux system uses systemd.
|
2004
|
+
StyleGuide: 'chef_modernize_usecheflanguagesystemdhelper'
|
2005
|
+
Enabled: true
|
2006
|
+
VersionAdded: '7.24.0'
|
2007
|
+
Exclude:
|
2008
|
+
- '**/metadata.rb'
|
2009
|
+
- '**/Berksfile'
|
2010
|
+
|
2011
|
+
Chef/Modernize/DeclareActionClass:
|
2012
|
+
Description: In Chef Infra Client 12.9 and later `action_class` can be used instead of `declare_action_class`.
|
2013
|
+
StyleGuide: 'chef_modernize_declareactionclass'
|
2014
|
+
Enabled: true
|
2015
|
+
VersionAdded: '7.26.0'
|
2016
|
+
Include:
|
2017
|
+
- '**/resources/*.rb'
|
2018
|
+
- '**/libraries/*.rb'
|
2019
|
+
|
2020
|
+
###############################
|
2021
|
+
# Chef/RedundantCode: Cleanup unnecessary code in your cookbooks regardless of Chef Infra Client release
|
2022
|
+
###############################
|
2023
|
+
|
2024
|
+
Chef/RedundantCode:
|
2025
|
+
Enabled: true
|
2026
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
2027
|
+
|
2028
|
+
Chef/RedundantCode/ConflictsMetadata:
|
2029
|
+
Description: Don't use the deprecated 'conflicts' metadata value
|
2030
|
+
StyleGuide: 'chef_redundantcode_conflictsmetadata'
|
2031
|
+
Enabled: true
|
2032
|
+
VersionAdded: '5.1.0'
|
2033
|
+
VersionChanged: '5.15.0'
|
2034
|
+
Include:
|
2035
|
+
- '**/metadata.rb'
|
2036
|
+
|
2037
|
+
Chef/RedundantCode/SuggestsMetadata:
|
2038
|
+
Description: The suggests metadata.rb method is not used and is unnecessary in cookbooks.
|
2039
|
+
StyleGuide: 'chef_redundantcode_suggestsmetadata'
|
2040
|
+
Enabled: true
|
2041
|
+
VersionAdded: '5.1.0'
|
2042
|
+
VersionChanged: '5.15.0'
|
2043
|
+
Include:
|
2044
|
+
- '**/metadata.rb'
|
2045
|
+
|
2046
|
+
Chef/RedundantCode/ProvidesMetadata:
|
2047
|
+
Description: The provides metadata.rb method is not used and is unnecessary in cookbooks.
|
2048
|
+
StyleGuide: 'chef_redundantcode_providesmetadata'
|
2049
|
+
Enabled: true
|
2050
|
+
VersionAdded: '5.1.0'
|
2051
|
+
VersionChanged: '5.15.0'
|
2052
|
+
Include:
|
2053
|
+
- '**/metadata.rb'
|
2054
|
+
|
2055
|
+
Chef/RedundantCode/ReplacesMetadata:
|
2056
|
+
Description: The replaces metadata.rb method is not used and is unnecessary in cookbooks.
|
2057
|
+
StyleGuide: 'chef_redundantcode_replacesmetadata'
|
2058
|
+
Enabled: true
|
2059
|
+
VersionAdded: '5.1.0'
|
2060
|
+
VersionChanged: '5.15.0'
|
2061
|
+
Include:
|
2062
|
+
- '**/metadata.rb'
|
2063
|
+
|
2064
|
+
Chef/RedundantCode/AttributeMetadata:
|
2065
|
+
Description: The attribute metadata.rb method is not used and is unnecessary in cookbooks.
|
2066
|
+
StyleGuide: 'chef_redundantcode_attributemetadata'
|
2067
|
+
Enabled: true
|
2068
|
+
VersionAdded: '5.1.0'
|
2069
|
+
VersionChanged: '5.15.0'
|
2070
|
+
Include:
|
2071
|
+
- '**/metadata.rb'
|
2072
|
+
|
2073
|
+
Chef/RedundantCode/LongDescriptionMetadata:
|
2074
|
+
Description: The long_description metadata.rb method is not used and is unnecessary in cookbooks
|
2075
|
+
StyleGuide: 'chef_redundantcode_longdescriptionmetadata'
|
2076
|
+
Enabled: true
|
2077
|
+
VersionAdded: '5.2.0'
|
2078
|
+
VersionChanged: '5.15.0'
|
2079
|
+
Include:
|
2080
|
+
- '**/metadata.rb'
|
2081
|
+
|
2082
|
+
Chef/RedundantCode/RecipeMetadata:
|
2083
|
+
Description: The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the README.md file instead.
|
2084
|
+
StyleGuide: 'chef_redundantcode_recipemetadata'
|
2085
|
+
Enabled: true
|
2086
|
+
VersionAdded: '5.6.0'
|
2087
|
+
VersionChanged: '5.15.0'
|
2088
|
+
Include:
|
2089
|
+
- '**/metadata.rb'
|
2090
|
+
|
2091
|
+
Chef/RedundantCode/ResourceWithNothingAction:
|
2092
|
+
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.
|
2093
|
+
StyleGuide: 'chef_redundantcode_resourcewithnothingaction'
|
2094
|
+
Enabled: true
|
2095
|
+
VersionAdded: '5.12.0'
|
2096
|
+
VersionChanged: '5.15.0'
|
2097
|
+
Include:
|
2098
|
+
- '**/libraries/*.rb'
|
2099
|
+
- '**/resources/*.rb'
|
2100
|
+
- '**/providers/*.rb'
|
2101
|
+
|
2102
|
+
Chef/RedundantCode/UnnecessaryNameProperty:
|
2103
|
+
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.
|
2104
|
+
StyleGuide: 'chef_redundantcode_unnecessarynameproperty'
|
2105
|
+
Enabled: true
|
2106
|
+
VersionAdded: '5.8.0'
|
2107
|
+
VersionChanged: '5.15.0'
|
2108
|
+
Include:
|
2109
|
+
- '**/resources/*.rb'
|
2110
|
+
- '**/libraries/*.rb'
|
2111
|
+
|
2112
|
+
Chef/RedundantCode/PropertyWithRequiredAndDefault:
|
2113
|
+
Description: Resource property should not be both required and have a default value
|
2114
|
+
StyleGuide: 'chef_redundantcode_propertywithrequiredanddefault'
|
2115
|
+
Enabled: true
|
2116
|
+
VersionAdded: '5.1.0'
|
2117
|
+
VersionChanged: '5.15.0'
|
2118
|
+
Include:
|
2119
|
+
- '**/resources/*.rb'
|
2120
|
+
- '**/libraries/*.rb'
|
2121
|
+
|
2122
|
+
Chef/RedundantCode/NamePropertyIsRequired:
|
2123
|
+
Description: Resource properties marked as name properties should not also be required properties
|
2124
|
+
StyleGuide: 'chef_redundantcode_namepropertyisrequired'
|
2125
|
+
Enabled: true
|
2126
|
+
VersionAdded: '5.1.0'
|
2127
|
+
VersionChanged: '5.15.0'
|
2128
|
+
Include:
|
2129
|
+
- '**/resources/*.rb'
|
2130
|
+
- '**/libraries/*.rb'
|
2131
|
+
|
2132
|
+
Chef/RedundantCode/CustomResourceWithAllowedActions:
|
2133
|
+
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.
|
2134
|
+
StyleGuide: 'chef_redundantcode_customresourcewithallowedactions'
|
2135
|
+
Enabled: true
|
2136
|
+
VersionAdded: '5.2.0'
|
2137
|
+
VersionChanged: '5.15.0'
|
2138
|
+
Include:
|
2139
|
+
- '**/resources/*.rb'
|
2140
|
+
|
2141
|
+
Chef/RedundantCode/SensitivePropertyInResource:
|
2142
|
+
Description: Every Chef Infra resources already include a sensitive property with a default value of false.
|
2143
|
+
StyleGuide: 'chef_redundantcode_sensitivepropertyinresource'
|
2144
|
+
Enabled: true
|
2145
|
+
VersionAdded: '5.16.0'
|
2146
|
+
Include:
|
2147
|
+
- '**/resources/*.rb'
|
2148
|
+
- '**/libraries/*.rb'
|
2149
|
+
|
2150
|
+
Chef/RedundantCode/UnnecessaryDesiredState:
|
2151
|
+
Description: 'There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.'
|
2152
|
+
StyleGuide: 'chef_redundantcode_unnecessarydesiredstate'
|
2153
|
+
Enabled: true
|
2154
|
+
VersionAdded: '5.16.0'
|
2155
|
+
Include:
|
2156
|
+
- '**/resources/*.rb'
|
2157
|
+
- '**/libraries/*.rb'
|
2158
|
+
|
2159
|
+
Chef/RedundantCode/AptRepositoryNotifiesAptUpdate:
|
2160
|
+
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.
|
2161
|
+
StyleGuide: 'chef_redundantcode_aptrepositorynotifiesaptupdate'
|
2162
|
+
Enabled: true
|
2163
|
+
VersionAdded: '5.17.0'
|
2164
|
+
Exclude:
|
2165
|
+
- '**/metadata.rb'
|
2166
|
+
- '**/attributes/*.rb'
|
2167
|
+
- '**/Berksfile'
|
2168
|
+
|
2169
|
+
Chef/RedundantCode/AptRepositoryDistributionDefault:
|
2170
|
+
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.
|
2171
|
+
StyleGuide: 'chef_redundantcode_aptrepositorydistributiondefault'
|
2172
|
+
Enabled: true
|
2173
|
+
VersionAdded: '5.17.0'
|
2174
|
+
Exclude:
|
2175
|
+
- '**/metadata.rb'
|
2176
|
+
- '**/attributes/*.rb'
|
2177
|
+
- '**/Berksfile'
|
2178
|
+
|
2179
|
+
Chef/RedundantCode/GroupingMetadata:
|
2180
|
+
Description: The grouping metadata.rb method is not used and is unnecessary in cookbooks.
|
2181
|
+
StyleGuide: 'chef_redundantcode_groupingmetadata'
|
2182
|
+
Enabled: true
|
2183
|
+
VersionAdded: '5.19.0'
|
2184
|
+
Include:
|
2185
|
+
- '**/metadata.rb'
|
2186
|
+
|
2187
|
+
Chef/RedundantCode/StringPropertyWithNilDefault:
|
2188
|
+
Description: Properties have a nil value by default so there is no need to set the default value to nil.
|
2189
|
+
StyleGuide: 'chef_redundantcode_stringpropertywithnildefault'
|
2190
|
+
Enabled: true
|
2191
|
+
VersionAdded: '5.21.0'
|
2192
|
+
Include:
|
2193
|
+
- '**/resources/*.rb'
|
2194
|
+
- '**/libraries/*.rb'
|
2195
|
+
|
2196
|
+
Chef/RedundantCode/PropertySplatRegex:
|
2197
|
+
Description: There is no need to validate the input of properties in resources using a regex value that will always pass.
|
2198
|
+
StyleGuide: 'chef_redundantcode_propertysplatregex'
|
2199
|
+
Enabled: true
|
2200
|
+
VersionAdded: '5.21.0'
|
2201
|
+
Include:
|
2202
|
+
- '**/resources/*.rb'
|
2203
|
+
- '**/libraries/*.rb'
|
2204
|
+
|
2205
|
+
Chef/RedundantCode/UseCreateIfMissing:
|
2206
|
+
Description: Use the :create_if_missing action instead of not_if with a ::File.exist(FOO) check.
|
2207
|
+
StyleGuide: 'chef_redundantcode_usecreateifmissing'
|
2208
|
+
Enabled: true
|
2209
|
+
VersionAdded: '6.2.0'
|
2210
|
+
Exclude:
|
2211
|
+
- '**/metadata.rb'
|
2212
|
+
- '**/attributes/*.rb'
|
2213
|
+
- '**/Berksfile'
|
2214
|
+
|
2215
|
+
Chef/RedundantCode/OhaiAttributeToString:
|
2216
|
+
Description: Many Ohai node attributes are already strings and don't need to be cast to strings again
|
2217
|
+
StyleGuide: 'chef_redundantcode_ohaiattributetostring'
|
2218
|
+
Enabled: true
|
2219
|
+
VersionAdded: '6.10.0'
|
2220
|
+
Exclude:
|
2221
|
+
- '**/metadata.rb'
|
2222
|
+
- '**/Berksfile'
|
2223
|
+
|
2224
|
+
Chef/RedundantCode/MultiplePlatformChecks:
|
2225
|
+
Description: You can pass multiple values to the platform? and platform_family? helpers instead of calling the helpers multiple times.
|
2226
|
+
StyleGuide: 'chef_redundantcode_multipleplatformchecks'
|
2227
|
+
Enabled: true
|
2228
|
+
VersionAdded: '6.10.0'
|
2229
|
+
Exclude:
|
2230
|
+
- '**/metadata.rb'
|
2231
|
+
- '**/Berksfile'
|
2232
|
+
|
2233
|
+
Chef/RedundantCode/DoubleCompileTime:
|
2234
|
+
Description: If a resource includes the `compile_time` property there's no need to also use `.run_action(:some_action)` on the resource block
|
2235
|
+
StyleGuide: 'chef_redundantcode_doublecompiletime'
|
2236
|
+
Enabled: true
|
2237
|
+
VersionAdded: '6.13.0'
|
2238
|
+
Exclude:
|
2239
|
+
- '**/metadata.rb'
|
2240
|
+
- '**/attributes/*.rb'
|
2241
|
+
- '**/Berksfile'
|
2242
|
+
|
2243
|
+
###############################
|
2244
|
+
# Chef/Effortless: Migrating to new patterns
|
2245
|
+
###############################
|
2246
|
+
|
2247
|
+
Chef/Effortless:
|
2248
|
+
Enabled: true
|
2249
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
2250
|
+
|
2251
|
+
Chef/Effortless/CookbookUsesSearch:
|
2252
|
+
Description: Cookbook uses search, which cannot be used in the Effortless Infra pattern
|
2253
|
+
StyleGuide: 'chef_effortless_cookbookusessearch'
|
2254
|
+
Enabled: false
|
2255
|
+
VersionAdded: '5.1.0'
|
2256
|
+
Exclude:
|
2257
|
+
- '**/metadata.rb'
|
2258
|
+
- '**/Berksfile'
|
2259
|
+
|
2260
|
+
Chef/Effortless/CookbookUsesDatabags:
|
2261
|
+
Description: Cookbook uses data bags, which cannot be used in the Effortless Infra pattern
|
2262
|
+
StyleGuide: 'chef_effortless_cookbookusesdatabags'
|
2263
|
+
Enabled: false
|
2264
|
+
VersionAdded: '5.1.0'
|
2265
|
+
Exclude:
|
2266
|
+
- '**/metadata.rb'
|
2267
|
+
- '**/Berksfile'
|
2268
|
+
|
2269
|
+
# https://github.com/chef/cookstyle/issues/346
|
2270
|
+
Chef/Effortless/ChefVaultUsed:
|
2271
|
+
Description: Cookbook uses Chef Vault, which cannot be used in the Effortless Infra pattern
|
2272
|
+
StyleGuide: 'chef_effortless_cookbookuseschefvault'
|
2273
|
+
Enabled: false
|
2274
|
+
VersionAdded: '6.19'
|
2275
|
+
Exclude:
|
2276
|
+
- '**/metadata.rb'
|
2277
|
+
- '**/Berksfile'
|
2278
|
+
|
2279
|
+
# https://github.com/chef/cookstyle/issues/346
|
2280
|
+
Chef/Effortless/DependsChefVault:
|
2281
|
+
Description: Cookbook depends on Chef Vault, which cannot be used in the Effortless Infra pattern
|
2282
|
+
StyleGuide: 'chef_effortless_cookbookdependschefvault'
|
2283
|
+
Enabled: false
|
2284
|
+
VersionAdded: '6.19'
|
2285
|
+
Include:
|
2286
|
+
- '**/metadata.rb'
|
2287
|
+
|
2288
|
+
Chef/Effortless/CookbookUsesEnvironments:
|
2289
|
+
Description: Cookbook uses environments, which cannot be used in the Effortless Infra pattern
|
2290
|
+
StyleGuide: 'chef_effortless_cookbookusesenvironments'
|
2291
|
+
Enabled: false
|
2292
|
+
VersionAdded: '5.10.0'
|
2293
|
+
Exclude:
|
2294
|
+
- '**/metadata.rb'
|
2295
|
+
- '**/Berksfile'
|
2296
|
+
|
2297
|
+
Chef/Effortless/CookbookUsesPolicygroups:
|
2298
|
+
Description: Cookbook uses Policy Groups, which cannot be used in the Effortless Infra pattern
|
2299
|
+
StyleGuide: 'chef_effortless_cookbookusespolicygroups'
|
2300
|
+
Enabled: false
|
2301
|
+
VersionAdded: '5.10.0'
|
2302
|
+
Exclude:
|
2303
|
+
- '**/metadata.rb'
|
2304
|
+
- '**/Berksfile'
|
2305
|
+
|
2306
|
+
Chef/Effortless/CookbookUsesRoles:
|
2307
|
+
Description: Cookbook uses Roles, which cannot be used in the Effortless Infra pattern
|
2308
|
+
StyleGuide: 'chef_effortless_cookbookusesroles'
|
2309
|
+
Enabled: false
|
2310
|
+
VersionAdded: '5.10.0'
|
2311
|
+
Exclude:
|
2312
|
+
- '**/metadata.rb'
|
2313
|
+
- '**/Berksfile'
|
2314
|
+
|
2315
|
+
Chef/Effortless/SearchForEnvironmentsOrRoles:
|
2316
|
+
Description: Cookbook uses search with a node query that looks for a role or environment
|
2317
|
+
StyleGuide: 'chef_effortless_searchforenvironmentsorroles'
|
2318
|
+
Enabled: false
|
2319
|
+
VersionAdded: '5.11.0'
|
2320
|
+
Exclude:
|
2321
|
+
- '**/metadata.rb'
|
2322
|
+
- '**/Berksfile'
|
2323
|
+
|
2324
|
+
Chef/Effortless/Berksfile:
|
2325
|
+
Description: Policyfiles should be used for cookbook dependency solving instead of a Berkshelf Berksfile.
|
2326
|
+
StyleGuide: 'chef_effortless_berksfile'
|
2327
|
+
Enabled: false
|
2328
|
+
VersionAdded: '5.12.0'
|
2329
|
+
Include:
|
2330
|
+
- '**/Berksfile'
|
2331
|
+
|
2332
|
+
#### InSpec cops
|
2333
|
+
|
2334
|
+
InSpec/Deprecations:
|
2335
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
2336
|
+
|
2337
|
+
InSpec/Deprecations/AttributeHelper:
|
2338
|
+
Description: InSpec attributes have been renamed to inputs. Use the `input` method not the deprecation `attribute` method to access these values.
|
2339
|
+
StyleGuide: 'inspec_deprecations_attributehelper'
|
2340
|
+
Enabled: true
|
2341
|
+
VersionAdded: '7.14.0'
|
2342
|
+
Include:
|
2343
|
+
- '**/controls/*.rb'
|
2344
|
+
|
2345
|
+
InSpec/Deprecations/AttributeDefault:
|
2346
|
+
Description: The InSpec inputs `default` option has been replaced with the `value` option.
|
2347
|
+
StyleGuide: 'inspec_deprecations_attributedefaults'
|
2348
|
+
Enabled: true
|
2349
|
+
VersionAdded: '7.14.0'
|
2350
|
+
Include:
|
2351
|
+
- '**/controls/*.rb'
|
2352
|
+
|
2353
|
+
#### Security Cops
|
2354
|
+
|
2355
|
+
Chef/Security:
|
2356
|
+
Enabled: true
|
2357
|
+
StyleGuideBaseURL: https://docs.chef.io/workstation/cookstyle/
|
2358
|
+
|
2359
|
+
Chef/Security/SshPrivateKey:
|
2360
|
+
Description: Do not include plain text SSH private keys in your cookbook code. This sensitive data should be fetched from secrets management systems so that secrets are not uploaded in plain text to the Chef Infra Server or committed to source control systems.
|
2361
|
+
StyleGuide: 'chef_security_sshprivatekey'
|
2362
|
+
Enabled: true
|
2363
|
+
VersionAdded: '7.28'
|
2364
|
+
Include:
|
2365
|
+
- '**/libraries/*.rb'
|
2366
|
+
- '**/resources/*.rb'
|
2367
|
+
- '**/providers/*.rb'
|
2368
|
+
- '**/recipes/*.rb'
|
2369
|
+
- '**/attributes/*.rb'
|
2370
|
+
- '**/definitions/*.rb'
|
2371
|
+
|
2372
|
+
#### The base rubocop 0.37 enabled.yml file we started with before we required backing up each new addition ####
|
2373
|
+
Layout/AccessModifierIndentation:
|
2374
|
+
Enabled: true
|
2375
|
+
Layout/ArrayAlignment:
|
2376
|
+
Enabled: true
|
2377
|
+
Layout/HashAlignment:
|
2378
|
+
Enabled: true
|
2379
|
+
Style/AndOr:
|
2380
|
+
Enabled: true
|
2381
|
+
Style/ArrayJoin:
|
2382
|
+
Enabled: true
|
2383
|
+
Naming/AsciiIdentifiers:
|
2384
|
+
Enabled: true
|
2385
|
+
Style/Attr:
|
2386
|
+
Enabled: true
|
2387
|
+
Style/BeginBlock:
|
2388
|
+
Enabled: true
|
2389
|
+
Style/BarePercentLiterals:
|
2390
|
+
Enabled: true
|
2391
|
+
Style/BlockComments:
|
2392
|
+
Enabled: true
|
2393
|
+
Layout/BlockEndNewline:
|
2394
|
+
Enabled: true
|
2395
|
+
Style/BlockDelimiters:
|
2396
|
+
Enabled: true
|
2397
|
+
Style/CaseEquality:
|
2398
|
+
Enabled: true
|
2399
|
+
Layout/CaseIndentation:
|
2400
|
+
Enabled: true
|
2401
|
+
Style/CharacterLiteral:
|
2402
|
+
Enabled: true
|
2403
|
+
Naming/ClassAndModuleCamelCase:
|
2404
|
+
Enabled: true
|
2405
|
+
Style/ClassCheck:
|
2406
|
+
Enabled: true
|
2407
|
+
Style/ClassMethods:
|
2408
|
+
Enabled: true
|
2409
|
+
Style/ClassVars:
|
2410
|
+
Enabled: true
|
2411
|
+
Layout/ClosingParenthesisIndentation:
|
2412
|
+
Enabled: true
|
2413
|
+
Style/ColonMethodCall:
|
2414
|
+
Enabled: true
|
2415
|
+
Style/CommandLiteral:
|
2416
|
+
Enabled: true
|
2417
|
+
Style/CommentAnnotation:
|
2418
|
+
Enabled: true
|
2419
|
+
Layout/CommentIndentation:
|
2420
|
+
Enabled: true
|
2421
|
+
Style/ConditionalAssignment:
|
2422
|
+
Enabled: true
|
2423
|
+
Naming/ConstantName:
|
2424
|
+
Enabled: true
|
2425
|
+
Style/DefWithParentheses:
|
2426
|
+
Enabled: true
|
2427
|
+
Layout/DotPosition:
|
2428
|
+
Enabled: true
|
2429
|
+
Style/EachWithObject:
|
2430
|
+
Enabled: true
|
2431
|
+
Layout/ElseAlignment:
|
2432
|
+
Enabled: true
|
2433
|
+
Style/EmptyElse:
|
2434
|
+
Enabled: true
|
2435
|
+
Layout/EmptyLineBetweenDefs:
|
2436
|
+
Enabled: true
|
2437
|
+
AllowAdjacentOneLineDefs: true
|
2438
|
+
Layout/EmptyLines:
|
2439
|
+
Enabled: true
|
2440
|
+
Layout/EmptyLinesAroundAccessModifier:
|
2441
|
+
Enabled: true
|
2442
|
+
Layout/EmptyLinesAroundBlockBody:
|
2443
|
+
Enabled: true
|
2444
|
+
Layout/EmptyLinesAroundClassBody:
|
2445
|
+
Enabled: true
|
2446
|
+
Layout/EmptyLinesAroundModuleBody:
|
2447
|
+
Enabled: true
|
2448
|
+
Layout/EmptyLinesAroundMethodBody:
|
2449
|
+
Enabled: true
|
2450
|
+
Style/EmptyLiteral:
|
2451
|
+
Enabled: true
|
2452
|
+
Style/EndBlock:
|
2453
|
+
Enabled: true
|
2454
|
+
Style/EvenOdd:
|
2455
|
+
Enabled: true
|
2456
|
+
Layout/ExtraSpacing:
|
2457
|
+
Enabled: true
|
2458
|
+
Layout/InitialIndentation:
|
2459
|
+
Enabled: true
|
2460
|
+
Layout/FirstParameterIndentation:
|
2461
|
+
Enabled: true
|
2462
|
+
Lint/FlipFlop:
|
2463
|
+
Enabled: true
|
2464
|
+
Style/For:
|
2465
|
+
Enabled: true
|
2466
|
+
Style/FormatString:
|
2467
|
+
Enabled: true
|
2468
|
+
Style/GlobalVars:
|
2469
|
+
Enabled: true
|
2470
|
+
Style/HashSyntax:
|
2471
|
+
Enabled: true
|
2472
|
+
Style/IfInsideElse:
|
2473
|
+
Enabled: true
|
2474
|
+
Style/IfWithSemicolon:
|
2475
|
+
Enabled: true
|
2476
|
+
Layout/IndentationConsistency:
|
2477
|
+
Enabled: true
|
2478
|
+
Layout/IndentationWidth:
|
2479
|
+
Enabled: true
|
2480
|
+
Style/IdenticalConditionalBranches:
|
2481
|
+
Enabled: true
|
2482
|
+
Layout/FirstArrayElementIndentation:
|
2483
|
+
Enabled: true
|
2484
|
+
Layout/AssignmentIndentation:
|
2485
|
+
Enabled: true
|
2486
|
+
Layout/FirstHashElementIndentation:
|
2487
|
+
Enabled: true
|
2488
|
+
Style/InfiniteLoop:
|
2489
|
+
Enabled: true
|
2490
|
+
Style/Lambda:
|
2491
|
+
Enabled: true
|
2492
|
+
Style/LambdaCall:
|
2493
|
+
Enabled: true
|
2494
|
+
Layout/LeadingCommentSpace:
|
2495
|
+
Enabled: true
|
2496
|
+
Style/LineEndConcatenation:
|
2497
|
+
Enabled: true
|
2498
|
+
Style/MethodCallWithoutArgsParentheses:
|
2499
|
+
Enabled: true
|
2500
|
+
Style/MethodDefParentheses:
|
2501
|
+
Enabled: true
|
2502
|
+
Style/MultilineBlockChain:
|
2503
|
+
Enabled: true
|
2504
|
+
Layout/MultilineBlockLayout:
|
2505
|
+
Enabled: true
|
2506
|
+
Style/MultilineIfThen:
|
2507
|
+
Enabled: true
|
2508
|
+
Layout/MultilineMethodCallIndentation:
|
2509
|
+
Enabled: true
|
2510
|
+
Layout/MultilineOperationIndentation:
|
2511
|
+
Enabled: true
|
2512
|
+
Style/MultilineTernaryOperator:
|
2513
|
+
Enabled: true
|
2514
|
+
Style/MutableConstant:
|
2515
|
+
Enabled: true
|
2516
|
+
Style/NegatedIf:
|
2517
|
+
Enabled: true
|
2518
|
+
Style/NegatedWhile:
|
2519
|
+
Enabled: true
|
2520
|
+
Style/NestedModifier:
|
2521
|
+
Enabled: true
|
2522
|
+
Style/NestedParenthesizedCalls:
|
2523
|
+
Enabled: true
|
2524
|
+
Style/NestedTernaryOperator:
|
2525
|
+
Enabled: true
|
2526
|
+
Style/Next:
|
2527
|
+
Enabled: true
|
2528
|
+
Style/NilComparison:
|
2529
|
+
Enabled: true
|
2530
|
+
Style/NonNilCheck:
|
2531
|
+
Enabled: true
|
2532
|
+
Style/Not:
|
2533
|
+
Enabled: true
|
2534
|
+
Style/OneLineConditional:
|
2535
|
+
Enabled: true
|
2536
|
+
Style/OptionalArguments:
|
2537
|
+
Enabled: true
|
2538
|
+
Style/ParallelAssignment:
|
2539
|
+
Enabled: true
|
2540
|
+
Style/ParenthesesAroundCondition:
|
2541
|
+
Enabled: true
|
2542
|
+
Style/PercentQLiterals:
|
2543
|
+
Enabled: true
|
2544
|
+
Style/PerlBackrefs:
|
2545
|
+
Enabled: true
|
2546
|
+
Style/Proc:
|
2547
|
+
Enabled: true
|
2548
|
+
Style/RaiseArgs:
|
2549
|
+
Enabled: true
|
2550
|
+
Style/RedundantException:
|
2551
|
+
Enabled: true
|
2552
|
+
Style/RedundantFreeze:
|
2553
|
+
Enabled: true
|
2554
|
+
Style/RedundantParentheses:
|
2555
|
+
Enabled: true
|
2556
|
+
Style/RedundantReturn:
|
2557
|
+
Enabled: true
|
2558
|
+
Style/RedundantSelf:
|
2559
|
+
Enabled: true
|
2560
|
+
Style/RegexpLiteral:
|
2561
|
+
Enabled: true
|
2562
|
+
Layout/RescueEnsureAlignment:
|
2563
|
+
Enabled: true
|
2564
|
+
Style/RescueModifier:
|
2565
|
+
Enabled: true
|
2566
|
+
Style/SelfAssignment:
|
2567
|
+
Enabled: true
|
2568
|
+
Style/Semicolon:
|
2569
|
+
Enabled: true
|
2570
|
+
Style/SignalException:
|
2571
|
+
Enabled: true
|
2572
|
+
Style/SingleLineBlockParams:
|
2573
|
+
Enabled: true
|
2574
|
+
Style/SingleLineMethods:
|
2575
|
+
Enabled: true
|
2576
|
+
Layout/SpaceAfterColon:
|
2577
|
+
Enabled: true
|
2578
|
+
Layout/SpaceAfterComma:
|
2579
|
+
Enabled: true
|
2580
|
+
Layout/SpaceAfterMethodName:
|
2581
|
+
Enabled: true
|
2582
|
+
Layout/SpaceAfterNot:
|
2583
|
+
Enabled: true
|
2584
|
+
Layout/SpaceAfterSemicolon:
|
2585
|
+
Enabled: true
|
2586
|
+
Layout/SpaceBeforeBlockBraces:
|
2587
|
+
Enabled: true
|
2588
|
+
Layout/SpaceBeforeComma:
|
2589
|
+
Enabled: true
|
2590
|
+
Layout/SpaceBeforeComment:
|
2591
|
+
Enabled: true
|
2592
|
+
Layout/SpaceBeforeSemicolon:
|
2593
|
+
Enabled: true
|
2594
|
+
Layout/SpaceInsideBlockBraces:
|
2595
|
+
Enabled: true
|
2596
|
+
Layout/SpaceAroundBlockParameters:
|
2597
|
+
Enabled: true
|
2598
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
2599
|
+
Enabled: true
|
2600
|
+
Layout/SpaceAroundKeyword:
|
2601
|
+
Enabled: true
|
2602
|
+
Layout/SpaceAroundOperators:
|
2603
|
+
Enabled: true
|
2604
|
+
Layout/SpaceInsideHashLiteralBraces:
|
2605
|
+
Enabled: true
|
2606
|
+
Layout/SpaceInsideParens:
|
2607
|
+
Enabled: true
|
2608
|
+
Layout/SpaceInsideRangeLiteral:
|
2609
|
+
Enabled: true
|
2610
|
+
Layout/SpaceInsideStringInterpolation:
|
2611
|
+
Enabled: true
|
2612
|
+
Style/SpecialGlobalVars:
|
2613
|
+
Enabled: true
|
2614
|
+
Style/StabbyLambdaParentheses:
|
2615
|
+
Enabled: true
|
2616
|
+
Style/StringLiterals:
|
2617
|
+
Enabled: true
|
2618
|
+
Style/StringLiteralsInInterpolation:
|
2619
|
+
Enabled: true
|
2620
|
+
Style/StructInheritance:
|
2621
|
+
Enabled: true
|
2622
|
+
Style/SymbolLiteral:
|
2623
|
+
Enabled: true
|
2624
|
+
Layout/IndentationStyle:
|
2625
|
+
Enabled: true
|
2626
|
+
Layout/TrailingEmptyLines:
|
2627
|
+
Enabled: true
|
2628
|
+
Style/TrailingCommaInArguments:
|
2629
|
+
Enabled: true
|
2630
|
+
Layout/TrailingWhitespace:
|
2631
|
+
Enabled: true
|
2632
|
+
Style/TrivialAccessors:
|
2633
|
+
Enabled: true
|
2634
|
+
Style/UnlessElse:
|
2635
|
+
Enabled: true
|
2636
|
+
Style/RedundantCapitalW:
|
2637
|
+
Enabled: true
|
2638
|
+
Style/RedundantInterpolation:
|
2639
|
+
Enabled: true
|
2640
|
+
Style/RedundantPercentQ:
|
2641
|
+
Enabled: true
|
2642
|
+
Style/TrailingUnderscoreVariable:
|
2643
|
+
Enabled: true
|
2644
|
+
Style/VariableInterpolation:
|
2645
|
+
Enabled: true
|
2646
|
+
Style/WhenThen:
|
2647
|
+
Enabled: true
|
2648
|
+
Style/WhileUntilDo:
|
2649
|
+
Enabled: true
|
2650
|
+
Style/WhileUntilModifier:
|
2651
|
+
Enabled: true
|
2652
|
+
Style/WordArray:
|
2653
|
+
Enabled: true
|
2654
|
+
Style/ZeroLengthPredicate:
|
2655
|
+
Enabled: true
|
2656
|
+
Lint/AmbiguousOperator:
|
2657
|
+
Enabled: true
|
2658
|
+
Lint/AssignmentInCondition:
|
2659
|
+
Enabled: true
|
2660
|
+
Layout/BlockAlignment:
|
2661
|
+
Enabled: true
|
2662
|
+
Lint/CircularArgumentReference:
|
2663
|
+
Enabled: true
|
2664
|
+
Layout/ConditionPosition:
|
2665
|
+
Enabled: true
|
2666
|
+
Lint/Debugger:
|
2667
|
+
Enabled: true
|
2668
|
+
Layout/DefEndAlignment:
|
2669
|
+
AutoCorrect: true
|
2670
|
+
Enabled: true
|
2671
|
+
Lint/DeprecatedClassMethods:
|
2672
|
+
Enabled: true
|
2673
|
+
Lint/DuplicateMethods:
|
2674
|
+
Enabled: true
|
2675
|
+
Lint/DuplicateHashKey:
|
2676
|
+
Enabled: true
|
2677
|
+
Lint/EachWithObjectArgument:
|
2678
|
+
Enabled: true
|
2679
|
+
Lint/ElseLayout:
|
2680
|
+
Enabled: true
|
2681
|
+
Lint/EmptyEnsure:
|
2682
|
+
Enabled: true
|
2683
|
+
Lint/EmptyInterpolation:
|
2684
|
+
Enabled: true
|
2685
|
+
Layout/EndAlignment:
|
2686
|
+
Enabled: true
|
2687
|
+
AutoCorrect: true
|
2688
|
+
Lint/EnsureReturn:
|
2689
|
+
Enabled: true
|
2690
|
+
Security/Eval:
|
2691
|
+
Enabled: true
|
2692
|
+
Lint/FloatOutOfRange:
|
2693
|
+
Enabled: true
|
2694
|
+
Lint/FormatParameterMismatch:
|
2695
|
+
Enabled: true
|
2696
|
+
Lint/SuppressedException:
|
2697
|
+
Enabled: true
|
2698
|
+
Lint/ImplicitStringConcatenation:
|
2699
|
+
Enabled: true
|
2700
|
+
Exclude:
|
2701
|
+
- '**/metadata.rb' # this prevents conflicts with Chef/Correctness/MetadataMalformedDepends
|
2702
|
+
Lint/IneffectiveAccessModifier:
|
2703
|
+
Enabled: true
|
2704
|
+
Lint/LiteralAsCondition:
|
2705
|
+
Enabled: true
|
2706
|
+
Lint/LiteralInInterpolation:
|
2707
|
+
Enabled: true
|
2708
|
+
Lint/Loop:
|
2709
|
+
Enabled: true
|
2710
|
+
Lint/NestedMethodDefinition:
|
2711
|
+
Enabled: true
|
2712
|
+
Lint/NextWithoutAccumulator:
|
2713
|
+
Enabled: true
|
2714
|
+
Lint/NonLocalExitFromIterator:
|
2715
|
+
Enabled: true
|
2716
|
+
Lint/ParenthesesAsGroupedExpression:
|
2717
|
+
Enabled: true
|
2718
|
+
Lint/RandOne:
|
2719
|
+
Enabled: true
|
2720
|
+
Lint/RequireParentheses:
|
2721
|
+
Enabled: true
|
2722
|
+
Lint/RescueException:
|
2723
|
+
Enabled: true
|
2724
|
+
Lint/ShadowingOuterLocalVariable:
|
2725
|
+
Enabled: true
|
2726
|
+
Lint/RedundantStringCoercion:
|
2727
|
+
Enabled: true
|
2728
|
+
Lint/UnderscorePrefixedVariableName:
|
2729
|
+
Enabled: true
|
2730
|
+
Lint/RedundantCopDisableDirective:
|
2731
|
+
Enabled: true
|
2732
|
+
Lint/UnusedBlockArgument:
|
2733
|
+
Enabled: true
|
2734
|
+
Lint/UnusedMethodArgument:
|
2735
|
+
Enabled: true
|
2736
|
+
Lint/UnreachableCode:
|
2737
|
+
Enabled: true
|
2738
|
+
Lint/UselessAccessModifier:
|
2739
|
+
Enabled: true
|
2740
|
+
Lint/UselessAssignment:
|
2741
|
+
Enabled: true
|
2742
|
+
Lint/UselessElseWithoutRescue:
|
2743
|
+
Enabled: true
|
2744
|
+
Lint/UselessSetterCall:
|
2745
|
+
Enabled: true
|
2746
|
+
Lint/Void:
|
2747
|
+
Enabled: true
|
2748
|
+
|
2749
|
+
# disabled as this breaks ruby_block resources
|
2750
|
+
Style/RedundantBegin:
|
2751
|
+
Enabled: false
|
2752
|
+
|
2753
|
+
# file names don't matter in cookbooks
|
2754
|
+
Naming/FileName:
|
2755
|
+
Enabled: false
|
2756
|
+
|
2757
|
+
# disable all the length cops as they're not appropriate for cookbooks
|
2758
|
+
Layout/LineLength:
|
2759
|
+
Enabled: false
|
2760
|
+
Metrics/MethodLength:
|
2761
|
+
Enabled: false
|
2762
|
+
Metrics/BlockLength:
|
2763
|
+
Enabled: false
|
2764
|
+
Metrics/AbcSize:
|
2765
|
+
Enabled: false
|
2766
|
+
Metrics/ModuleLength:
|
2767
|
+
Enabled: false
|
2768
|
+
Metrics/ClassLength:
|
2769
|
+
Enabled: false
|
2770
|
+
Metrics/CyclomaticComplexity:
|
2771
|
+
Enabled: false
|
2772
|
+
Metrics/PerceivedComplexity:
|
2773
|
+
Enabled: false
|
2774
|
+
Metrics/BlockNesting:
|
2775
|
+
Enabled: false
|
2776
|
+
Metrics/ParameterLists:
|
2777
|
+
Enabled: false
|
2778
|
+
|
2779
|
+
# The warning message from this is misleading and can lead to wrong but syntactically valid code.
|
2780
|
+
Lint/SendWithMixinArgument:
|
2781
|
+
Enabled: false
|
2782
|
+
|
2783
|
+
# this migrates old # rubocop: comments to use the latest namespaces, which prevents a ton of spam during cookstyle runs
|
2784
|
+
Migration/DepartmentName:
|
2785
|
+
Enabled: true
|
2786
|
+
|
2787
|
+
# https://github.com/chef/cookstyle/pull/5
|
2788
|
+
Style/TrailingCommaInHashLiteral:
|
2789
|
+
Enabled: true
|
2790
|
+
EnforcedStyleForMultiline: comma
|
2791
|
+
|
2792
|
+
# https://github.com/chef/cookstyle/pull/5
|
2793
|
+
Style/TrailingCommaInArrayLiteral:
|
2794
|
+
Enabled: true
|
2795
|
+
EnforcedStyleForMultiline: comma
|
2796
|
+
|
2797
|
+
# Underscores in numbers are unnecessary, especially for port numbers where they are unexpected
|
2798
|
+
Style/NumericLiterals:
|
2799
|
+
Enabled: false
|
2800
|
+
|
2801
|
+
# This often triggers no matter what you do with inspec/serverspec matchers
|
2802
|
+
Lint/AmbiguousRegexpLiteral:
|
2803
|
+
Enabled: false
|
2804
|
+
|
2805
|
+
# some names are not ascii and this prevents copyright comments
|
2806
|
+
Style/AsciiComments:
|
2807
|
+
Enabled: false
|
2808
|
+
|
2809
|
+
# avoid case statements where the 2nd 'when' would never fire
|
2810
|
+
Lint/DuplicateCaseCondition:
|
2811
|
+
Enabled: true
|
2812
|
+
|
2813
|
+
# empty expressions serve no purpose
|
2814
|
+
Lint/EmptyExpression:
|
2815
|
+
Enabled: true
|
2816
|
+
|
2817
|
+
# when in a case statement should always do something
|
2818
|
+
Lint/EmptyWhen:
|
2819
|
+
Enabled: true
|
2820
|
+
|
2821
|
+
# %w('something') is almost always a typo
|
2822
|
+
Lint/PercentStringArray:
|
2823
|
+
Enabled: true
|
2824
|
+
|
2825
|
+
# %w(:something) should be a string not a symbol
|
2826
|
+
Lint/PercentSymbolArray:
|
2827
|
+
Enabled: true
|
2828
|
+
|
2829
|
+
# if you rescue Exception, then rescue say StandardError you're gonna have a bad time
|
2830
|
+
Lint/ShadowedException:
|
2831
|
+
Enabled: true
|
2832
|
+
|
2833
|
+
# We're on modern ruby so let's assume Integer everywhere
|
2834
|
+
Lint/UnifiedInteger:
|
2835
|
+
Enabled: true
|
2836
|
+
|
2837
|
+
# consistent hash key/value checks
|
2838
|
+
Style/PreferredHashMethods:
|
2839
|
+
Enabled: true
|
2840
|
+
|
2841
|
+
# when iterating a fixed number of times this is much easier to read
|
2842
|
+
Style/EachForSimpleLoop:
|
2843
|
+
Enabled: true
|
2844
|
+
|
2845
|
+
# a case statement without a condition is just an if statement
|
2846
|
+
Style/EmptyCaseCondition:
|
2847
|
+
Enabled: true
|
2848
|
+
|
2849
|
+
# It doesn't matter if people use the friendly helpers or not for overall readability
|
2850
|
+
Style/NumericPredicate:
|
2851
|
+
Enabled: false
|
2852
|
+
|
2853
|
+
# this is bad %w(something another_thing one_more)
|
2854
|
+
Layout/SpaceInsideArrayPercentLiteral:
|
2855
|
+
Enabled: true
|
2856
|
+
|
2857
|
+
# There's no reason to have a gem listed twice
|
2858
|
+
Bundler/DuplicatedGem:
|
2859
|
+
Enabled: true
|
2860
|
+
|
2861
|
+
# This comes with changing the ruby target to 2.3+
|
2862
|
+
Style/FrozenStringLiteralComment:
|
2863
|
+
Enabled: false
|
2864
|
+
|
2865
|
+
# maintain the previous array behavior in previous cookstyle releases
|
2866
|
+
Style/PercentLiteralDelimiters:
|
2867
|
+
Enabled: true
|
2868
|
+
PreferredDelimiters:
|
2869
|
+
'%': ()
|
2870
|
+
'%i': ()
|
2871
|
+
'%I': ()
|
2872
|
+
'%q': ()
|
2873
|
+
'%Q': ()
|
2874
|
+
'%r': '{}'
|
2875
|
+
'%s': ()
|
2876
|
+
'%w': ()
|
2877
|
+
'%W': ()
|
2878
|
+
'%x': ()
|
2879
|
+
|
2880
|
+
# backwards conditions are hard to read
|
2881
|
+
Style/YodaCondition:
|
2882
|
+
Enabled: true
|
2883
|
+
|
2884
|
+
Layout/EmptyLinesAroundExceptionHandlingKeywords:
|
2885
|
+
Enabled: true
|
2886
|
+
|
2887
|
+
# enforce lf to avoid failures on Windows systems
|
2888
|
+
Layout/EndOfLine:
|
2889
|
+
Enabled: true
|
2890
|
+
EnforcedStyle: lf
|
2891
|
+
|
2892
|
+
# guardclause sacrifices ease of readability for consistency at times
|
2893
|
+
Style/GuardClause:
|
2894
|
+
Enabled: false
|
2895
|
+
|
2896
|
+
# Users really shouldn't have a gem, but if they do they should do it securely
|
2897
|
+
Bundler/InsecureProtocolSource:
|
2898
|
+
Enabled: true
|
2899
|
+
AllowHttpProtocol: false
|
2900
|
+
|
2901
|
+
# It's easier to read a simple .each and they're faster
|
2902
|
+
Lint/RedundantWithIndex:
|
2903
|
+
Enabled: true
|
2904
|
+
|
2905
|
+
# Catches when a user single quotes a string with interpolation
|
2906
|
+
Lint/InterpolationCheck:
|
2907
|
+
Enabled: true
|
2908
|
+
|
2909
|
+
# Bad: `bar = [foo.min, foo.max]`. Good: bar = foo.minmax
|
2910
|
+
Style/MinMax:
|
2911
|
+
Enabled: true
|
2912
|
+
|
2913
|
+
# Avoid ruby deprecation warnings
|
2914
|
+
Lint/UriRegexp:
|
2915
|
+
Enabled: true
|
2916
|
+
|
2917
|
+
# :true or :false seems like a horrible idea
|
2918
|
+
Lint/BooleanSymbol:
|
2919
|
+
Enabled: true
|
2920
|
+
|
2921
|
+
# this avoids very verbose code for no reason
|
2922
|
+
Style/RedundantConditional:
|
2923
|
+
Enabled: true
|
2924
|
+
|
2925
|
+
# catches people writing a regex check wrong
|
2926
|
+
Lint/RegexpAsCondition:
|
2927
|
+
Enabled: true
|
2928
|
+
|
2929
|
+
# Avoids pointless / complex code
|
2930
|
+
Lint/RedundantWithObject:
|
2931
|
+
Enabled: true
|
2932
|
+
|
2933
|
+
# avoid requiring things that come for free
|
2934
|
+
Lint/RedundantRequireStatement:
|
2935
|
+
Enabled: true
|
2936
|
+
|
2937
|
+
# Avoid poorly formatted methods
|
2938
|
+
Style/TrailingBodyOnMethodDefinition:
|
2939
|
+
Enabled: true
|
2940
|
+
|
2941
|
+
# Avoid weird empty lines in an argument
|
2942
|
+
Layout/EmptyLinesAroundArguments:
|
2943
|
+
Enabled: true
|
2944
|
+
|
2945
|
+
# don't shadow arguments
|
2946
|
+
Lint/ShadowedArgument:
|
2947
|
+
Enabled: true
|
2948
|
+
|
2949
|
+
# find orphaned empty comments
|
2950
|
+
Layout/EmptyComment:
|
2951
|
+
Enabled: true
|
2952
|
+
|
2953
|
+
# warn on deprecated functionality
|
2954
|
+
Lint/BigDecimalNew:
|
2955
|
+
Enabled: true
|
2956
|
+
|
2957
|
+
# remove bogus rubocop comments. We already enabled Disable directives
|
2958
|
+
Lint/RedundantCopEnableDirective:
|
2959
|
+
Enabled: true
|
2960
|
+
|
2961
|
+
# get people on a much simpler ruby 2.4+ way of doing things
|
2962
|
+
Style/UnpackFirst:
|
2963
|
+
Enabled: true
|
2964
|
+
|
2965
|
+
Style/SymbolProc:
|
2966
|
+
Enabled: true
|
2967
|
+
# A list of method names to be ignored by the check.
|
2968
|
+
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
|
2969
|
+
AllowedMethods:
|
2970
|
+
- lazy
|
2971
|
+
|
2972
|
+
# as much as I wish everyone would document things it's just not going to happen
|
2973
|
+
Style/Documentation:
|
2974
|
+
Enabled: false
|
2975
|
+
|
2976
|
+
# compact code is nice, but this is actually harder to read for new users
|
2977
|
+
Style/IfUnlessModifier:
|
2978
|
+
Enabled: false
|
2979
|
+
|
2980
|
+
# in general cookbooks shouldn't include a gemfile, but if they do they can do with it as they wish
|
2981
|
+
Bundler/OrderedGems:
|
2982
|
+
Enabled: false
|
2983
|
+
|
2984
|
+
# extend self and module_function are not the same. module_function makes all the methods private
|
2985
|
+
# and this rule will break any library that worked with extend self.
|
2986
|
+
Style/ModuleFunction:
|
2987
|
+
Enabled: false
|
2988
|
+
|
2989
|
+
# Avoid using extra then statements in a multiline case
|
2990
|
+
Style/MultilineWhenThen:
|
2991
|
+
Enabled: true
|
2992
|
+
|
2993
|
+
# .each_key is a lot more clear that .keys.each
|
2994
|
+
Style/HashEachMethods:
|
2995
|
+
Enabled: true
|
2996
|
+
|
2997
|
+
# We want to catch this deprecation in cookbooks
|
2998
|
+
Lint/DeprecatedOpenSSLConstant:
|
2999
|
+
Enabled: true
|
3000
|
+
|
3001
|
+
# This just isn't a big deal in the context of a cookbook
|
3002
|
+
Naming/AccessorMethodName:
|
3003
|
+
Enabled: false
|
3004
|
+
|
3005
|
+
# Rescuing a particular exception twice isn't going to work
|
3006
|
+
Lint/DuplicateRescueException:
|
3007
|
+
Enabled: true
|
3008
|
+
|
3009
|
+
# if b == 0 && b == 0 is invalid and we should flag it
|
3010
|
+
Lint/BinaryOperatorWithIdenticalOperands:
|
3011
|
+
Enabled: true
|
3012
|
+
|
3013
|
+
# returning at the top level with an arg is invalid
|
3014
|
+
# @TODO we can enable this once this is fixed: https://github.com/rubocop-hq/rubocop/issues/8462
|
3015
|
+
# Lint/TopLevelReturnWithArgument:
|
3016
|
+
# Enabled: true
|
3017
|
+
|
3018
|
+
# simplify hash access that doesn't actually need .dig
|
3019
|
+
Style/SingleArgumentDig:
|
3020
|
+
Enabled: true
|
3021
|
+
|
3022
|
+
# trying to access $2 when there is no $2 will always return nil
|
3023
|
+
Lint/OutOfRangeRegexpRef:
|
3024
|
+
Enabled: true
|
3025
|
+
|
3026
|
+
# simplify how people coerce arrays
|
3027
|
+
Style/ArrayCoercion:
|
3028
|
+
Enabled: true
|
3029
|
+
|
3030
|
+
# if your elseif is the same as your if you're gonna have a bad day
|
3031
|
+
Lint/DuplicateElsifCondition:
|
3032
|
+
Enabled: true
|
3033
|
+
|
3034
|
+
# simplify attr_reader and attr_write into attr_accessor
|
3035
|
+
Style/BisectedAttrAccessor:
|
3036
|
+
Enabled: true
|
3037
|
+
|
3038
|
+
# avoid assignments that aren't needed
|
3039
|
+
Style/RedundantAssignment:
|
3040
|
+
Enabled: true
|
3041
|
+
|
3042
|
+
# alert on invalid ruby
|
3043
|
+
Lint/Syntax:
|
3044
|
+
Enabled: true
|
3045
|
+
|
3046
|
+
# simplify stripping strings
|
3047
|
+
Style/Strip:
|
3048
|
+
Enabled: true
|
3049
|
+
|
3050
|
+
# simplify how you warn
|
3051
|
+
Style/StderrPuts:
|
3052
|
+
Enabled: true
|
3053
|
+
|
3054
|
+
# more code simplification
|
3055
|
+
Style/Sample:
|
3056
|
+
Enabled: true
|
3057
|
+
|
3058
|
+
# simpler returns
|
3059
|
+
Style/ReturnNil:
|
3060
|
+
Enabled: true
|
3061
|
+
|
3062
|
+
# use .sort when .sort_by isn't needed
|
3063
|
+
Style/RedundantSortBy:
|
3064
|
+
Enabled: true
|
3065
|
+
|
3066
|
+
# simplify getting min/max
|
3067
|
+
Style/RedundantSort:
|
3068
|
+
Enabled: true
|
3069
|
+
|
3070
|
+
# no need for .rb in requires
|
3071
|
+
Style/RedundantFileExtensionInRequire:
|
3072
|
+
Enabled: true
|
3073
|
+
|
3074
|
+
# more code you don't need
|
3075
|
+
Style/RedundantCondition:
|
3076
|
+
Enabled: true
|
3077
|
+
|
3078
|
+
# Ruby 2 makes these pointless
|
3079
|
+
Style/Encoding:
|
3080
|
+
Enabled: true
|
3081
|
+
|
3082
|
+
# Use __dir__ to simplify things
|
3083
|
+
Style/Dir:
|
3084
|
+
Enabled: true
|
3085
|
+
|
3086
|
+
# Use __FILE__ or __dir__ to simplify expand_paths
|
3087
|
+
Style/ExpandPathArguments:
|
3088
|
+
Enabled: true
|
3089
|
+
|
3090
|
+
# Avoid a safe navigation operator if we don't need it
|
3091
|
+
Lint/RedundantSafeNavigation:
|
3092
|
+
Enabled: true
|
3093
|
+
|
3094
|
+
# Avoid using blocks to remove nils from a Hash/Array
|
3095
|
+
Style/CollectionCompact:
|
3096
|
+
Enabled: true
|
3097
|
+
|
3098
|
+
# eventually these constants are going to break code so fix them
|
3099
|
+
Lint/DeprecatedConstants:
|
3100
|
+
Enabled: true
|
3101
|
+
|
3102
|
+
# always turn on deprecation cops from rubocop
|
3103
|
+
Lint/ErbNewArguments:
|
3104
|
+
Enabled: true
|
3105
|
+
|
3106
|
+
# reduce file read complexity
|
3107
|
+
Style/FileRead:
|
3108
|
+
Enabled: true
|
3109
|
+
|
3110
|
+
# reduce file write complexity
|
3111
|
+
Style/FileWrite:
|
3112
|
+
Enabled: true
|
3113
|
+
|
3114
|
+
# Simplify duplicate file path access with Ruby 3.2+
|
3115
|
+
Style/NestedFileDirname:
|
3116
|
+
Enabled: true
|
3117
|
+
|
3118
|
+
# Use modern ENV fetching methods
|
3119
|
+
Style/FetchEnvVar:
|
3120
|
+
Enabled: true
|
3121
|
+
|
3122
|
+
# use object.next instead of object.yield_self
|
3123
|
+
Style/ObjectThen:
|
3124
|
+
Enabled: true
|
3125
|
+
|
3126
|
+
# use .select instead of .map and then .compact
|
3127
|
+
Style/MapCompactWithConditionalBlock:
|
3128
|
+
Enabled: true
|
3129
|
+
|
3130
|
+
# use trailing spaces when there's multi-line text string
|
3131
|
+
Layout/LineContinuationLeadingSpace:
|
3132
|
+
Enabled: true
|
3133
|
+
|
3134
|
+
# format how multi-line strings are defined
|
3135
|
+
Layout/LineContinuationSpacing:
|
3136
|
+
Enabled: true
|
3137
|
+
|
3138
|
+
# don't typo your way into overwriting the error class
|
3139
|
+
Lint/ConstantOverwrittenInRescue:
|
3140
|
+
Enabled: true
|
3141
|
+
|
3142
|
+
# avoid potential race conditions with FileUtils
|
3143
|
+
Lint/NonAtomicFileOperation:
|
3144
|
+
Enabled: true
|
3145
|
+
|
3146
|
+
# make it easier to read multiple params passed into methods
|
3147
|
+
Layout/MultilineMethodParameterLineBreaks:
|
3148
|
+
Enabled: true
|
3149
|
+
|
3150
|
+
# be really clear what kind of range you're defining
|
3151
|
+
Lint/RequireRangeParentheses:
|
3152
|
+
Enabled: true
|
3153
|
+
|
3154
|
+
# Use a simple string and not an empty heredoc
|
3155
|
+
Style/EmptyHeredoc:
|
3156
|
+
Enabled: true
|
3157
|
+
|
3158
|
+
# reduce duplicate boilerplate content
|
3159
|
+
Lint/DuplicateMagicComment:
|
3160
|
+
Enabled: true
|
3161
|
+
|
3162
|
+
# eliminate some very un-ruby method calling
|
3163
|
+
Style/OperatorMethodCall:
|
3164
|
+
Enabled: true
|
3165
|
+
|
3166
|
+
# eliminiate hard to ready and redundant string escaping
|
3167
|
+
Style/RedundantStringEscape:
|
3168
|
+
Enabled: true
|
3169
|
+
|
3170
|
+
# remove redundant .each calls
|
3171
|
+
Style/RedundantEach:
|
3172
|
+
Enabled: true
|
3173
|
+
|
3174
|
+
# simplify consts
|
3175
|
+
Style/RedundantConstantBase:
|
3176
|
+
Enabled: true
|
3177
|
+
|
3178
|
+
# remove more redundancy
|
3179
|
+
Style/RedundantDoubleSplatHashBraces:
|
3180
|
+
Enabled: true
|
3181
|
+
|
3182
|
+
# .push into an array instead of concatting 2 arrays
|
3183
|
+
Style/ConcatArrayLiterals:
|
3184
|
+
Enabled: true
|
3185
|
+
|
3186
|
+
# simplify .map/.collect and .to_set to just .to_set
|
3187
|
+
Style/MapToSet:
|
3188
|
+
Enabled: true
|
3189
|
+
|
3190
|
+
# use .max and .min when you can
|
3191
|
+
Style/MinMaxComparison:
|
3192
|
+
Enabled: true
|
3193
|
+
|
3194
|
+
# don't quote a HEREDOC if you don't need to
|
3195
|
+
Style/RedundantHeredocDelimiterQuotes:
|
3196
|
+
Enabled: true
|
3197
|
+
|
3198
|
+
# use Dir.empty? if we can
|
3199
|
+
Style/DirEmpty:
|
3200
|
+
Enabled: true
|
3201
|
+
|
3202
|
+
# use File.empty? if we can
|
3203
|
+
Style/FileEmpty:
|
3204
|
+
Enabled: true
|
3205
|
+
|
3206
|
+
# don't use line continuations if we don't have to
|
3207
|
+
Style/RedundantLineContinuation:
|
3208
|
+
Enabled: true
|
3209
|
+
|
3210
|
+
# don't allow case statements with the same condition twice
|
3211
|
+
Lint/DuplicateMatchPattern:
|
3212
|
+
Enabled: true
|
3213
|
+
|
3214
|
+
# don't use exact string checks in a regex
|
3215
|
+
Style/ExactRegexpMatch:
|
3216
|
+
Enabled: true
|
3217
|
+
|
3218
|
+
# simplify creating a new array
|
3219
|
+
Style/RedundantArrayConstructor:
|
3220
|
+
Enabled: true
|
3221
|
+
|
3222
|
+
# remove redundant escapes in regex literals
|
3223
|
+
Style/RedundantRegexpConstructor:
|
3224
|
+
Enabled: true
|
3225
|
+
|
3226
|
+
# simplify .select and then .empty?/.none/.any? into just those methods
|
3227
|
+
Style/RedundantFilterChain:
|
3228
|
+
Enabled: true
|
3229
|
+
|
3230
|
+
# Reduce redundancy in regexes
|
3231
|
+
Lint/RedundantRegexpQuantifiers:
|
3232
|
+
Enabled: true
|
3233
|
+
|
3234
|
+
# Simplify require_relative calls
|
3235
|
+
Style/RedundantCurrentDirectoryInPath:
|
3236
|
+
Enabled: true
|
3237
|
+
|
3238
|
+
# Simplify some method calls
|
3239
|
+
Style/RedundantRegexpArgument:
|
3240
|
+
Enabled: true
|
3241
|
+
|
3242
|
+
# don't use the same group twice in a Gemfile
|
3243
|
+
Bundler/DuplicatedGroup:
|
3244
|
+
Enabled: true
|
3245
|
+
|
3246
|
+
# don't try to singleline a do/end block
|
3247
|
+
Style/SingleLineDoEndBlock:
|
3248
|
+
Enabled: true
|