cookstyle 6.7.3 → 6.12.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -0
- data/bin/cookstyle +1 -0
- data/bin/cookstyle-profile +31 -0
- data/config/cookstyle.yml +79 -4
- data/config/disable_all.yml +22 -0
- data/config/upstream.yml +132 -11
- data/cookstyle.gemspec +1 -0
- data/lib/cookstyle.rb +2 -0
- data/lib/cookstyle/version.rb +3 -2
- data/lib/rubocop/chef.rb +1 -0
- data/lib/rubocop/chef/autocorrect_helpers.rb +1 -0
- data/lib/rubocop/chef/cookbook_helpers.rb +1 -0
- data/lib/rubocop/chef/platform_helpers.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/cb_depends_on_self.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +12 -1
- data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +3 -2
- data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/node_normal.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/node_save.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/service_resource.rb +2 -1
- data/lib/rubocop/cop/chef/correctness/tmp_path.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb +52 -0
- data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +55 -0
- data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +60 -0
- data/lib/rubocop/cop/chef/deprecation/cheffile.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/easy_install.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/erl_call.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb +142 -0
- data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +3 -2
- data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +8 -21
- data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/node_set.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +23 -13
- data/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +2 -1
- data/lib/rubocop/cop/chef/effortless/berksfile.rb +2 -1
- data/lib/rubocop/cop/chef/effortless/data_bags.rb +2 -1
- data/lib/rubocop/cop/chef/effortless/node_environment.rb +2 -1
- data/lib/rubocop/cop/chef/effortless/node_policygroup.rb +2 -1
- data/lib/rubocop/cop/chef/effortless/node_roles.rb +2 -1
- data/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +2 -1
- data/lib/rubocop/cop/chef/effortless/search_used.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/build_essential.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +57 -0
- data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/definitions.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +3 -2
- data/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/execute_sleep.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/execute_sysctl.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/node_init_package.rb +18 -9
- data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/systctl_param_resource.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +61 -0
- data/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +69 -0
- data/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/provides_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +2 -1
- data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +2 -1
- data/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +2 -1
- data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +2 -1
- data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +2 -1
- data/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +60 -0
- data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +2 -1
- data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +3 -2
- data/lib/rubocop/cop/chef/style/attribute_keys.rb +2 -1
- data/lib/rubocop/cop/chef/style/chef_whaaat.rb +2 -1
- data/lib/rubocop/cop/chef/style/comment_sentence_spacing.rb +2 -1
- data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +2 -1
- data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +2 -1
- data/lib/rubocop/cop/chef/style/comments_format.rb +2 -1
- data/lib/rubocop/cop/chef/style/file_mode.rb +2 -1
- data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +2 -1
- data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +58 -0
- data/lib/rubocop/cop/chef/style/negating_only_if.rb +2 -1
- data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +2 -1
- data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +2 -1
- data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +2 -1
- data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +3 -3
- data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +2 -1
- data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +3 -3
- data/lib/rubocop/monkey_patches/comment_config.rb +1 -0
- data/lib/rubocop/monkey_patches/cop.rb +1 -0
- data/lib/rubocop/monkey_patches/registry_cop.rb +15 -0
- metadata +15 -5
- data/lib/rubocop/cop/chef/deprecation/resource_without_name_or_provides.rb +0 -81
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module RuboCop
|
3
|
+
module Cop
|
4
|
+
class Registry
|
5
|
+
# we monkeypatch this warning to replace rubocop with cookstyle
|
6
|
+
def print_warning(name, path)
|
7
|
+
message = "#{path}: Warning: no department given for #{name}."
|
8
|
+
if path.end_with?('.rb')
|
9
|
+
message += ' Run `cookstyle -a --only Migration/DepartmentName` to fix.'
|
10
|
+
end
|
11
|
+
warn message
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cookstyle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.12.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thom May
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubocop
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.
|
20
|
+
version: 0.88.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.
|
27
|
+
version: 0.88.0
|
28
28
|
description:
|
29
29
|
email:
|
30
30
|
- thom@chef.io
|
@@ -37,6 +37,7 @@ files:
|
|
37
37
|
- Gemfile
|
38
38
|
- LICENSE
|
39
39
|
- bin/cookstyle
|
40
|
+
- bin/cookstyle-profile
|
40
41
|
- config/cookstyle.yml
|
41
42
|
- config/default.yml
|
42
43
|
- config/disable_all.yml
|
@@ -79,10 +80,13 @@ files:
|
|
79
80
|
- lib/rubocop/cop/chef/correctness/scoped_file_exist.rb
|
80
81
|
- lib/rubocop/cop/chef/correctness/service_resource.rb
|
81
82
|
- lib/rubocop/cop/chef/correctness/tmp_path.rb
|
83
|
+
- lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb
|
84
|
+
- lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb
|
82
85
|
- lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb
|
83
86
|
- lib/rubocop/cop/chef/deprecation/chef_rest.rb
|
84
87
|
- lib/rubocop/cop/chef/deprecation/chef_rewind.rb
|
85
88
|
- lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb
|
89
|
+
- lib/rubocop/cop/chef/deprecation/chefdk_generators.rb
|
86
90
|
- lib/rubocop/cop/chef/deprecation/cheffile.rb
|
87
91
|
- lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb
|
88
92
|
- lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb
|
@@ -100,6 +104,7 @@ files:
|
|
100
104
|
- lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb
|
101
105
|
- lib/rubocop/cop/chef/deprecation/epic_fail.rb
|
102
106
|
- lib/rubocop/cop/chef/deprecation/erl_call.rb
|
107
|
+
- lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb
|
103
108
|
- lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb
|
104
109
|
- lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb
|
105
110
|
- lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb
|
@@ -122,7 +127,6 @@ files:
|
|
122
127
|
- lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb
|
123
128
|
- lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb
|
124
129
|
- lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb
|
125
|
-
- lib/rubocop/cop/chef/deprecation/resource_without_name_or_provides.rb
|
126
130
|
- lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb
|
127
131
|
- lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb
|
128
132
|
- lib/rubocop/cop/chef/deprecation/run_command_helper.rb
|
@@ -149,6 +153,7 @@ files:
|
|
149
153
|
- lib/rubocop/cop/chef/modernize/chef_14_resources.rb
|
150
154
|
- lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb
|
151
155
|
- lib/rubocop/cop/chef/modernize/compile_time_resources.rb
|
156
|
+
- lib/rubocop/cop/chef/modernize/conditional_using_test.rb
|
152
157
|
- lib/rubocop/cop/chef/modernize/cron_manage_resource.rb
|
153
158
|
- lib/rubocop/cop/chef/modernize/databag_helpers.rb
|
154
159
|
- lib/rubocop/cop/chef/modernize/default_action_initializer.rb
|
@@ -209,7 +214,9 @@ files:
|
|
209
214
|
- lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb
|
210
215
|
- lib/rubocop/cop/chef/redundant/grouping_metadata.rb
|
211
216
|
- lib/rubocop/cop/chef/redundant/long_description_metadata.rb
|
217
|
+
- lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb
|
212
218
|
- lib/rubocop/cop/chef/redundant/name_property_and_required.rb
|
219
|
+
- lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb
|
213
220
|
- lib/rubocop/cop/chef/redundant/property_splat_regex.rb
|
214
221
|
- lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb
|
215
222
|
- lib/rubocop/cop/chef/redundant/provides_metadata.rb
|
@@ -226,6 +233,7 @@ files:
|
|
226
233
|
- lib/rubocop/cop/chef/sharing/empty_metadata_field.rb
|
227
234
|
- lib/rubocop/cop/chef/sharing/include_property_descriptions.rb
|
228
235
|
- lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb
|
236
|
+
- lib/rubocop/cop/chef/sharing/include_resource_examples.rb
|
229
237
|
- lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb
|
230
238
|
- lib/rubocop/cop/chef/sharing/invalid_license_string.rb
|
231
239
|
- lib/rubocop/cop/chef/style/attribute_keys.rb
|
@@ -236,6 +244,7 @@ files:
|
|
236
244
|
- lib/rubocop/cop/chef/style/comments_format.rb
|
237
245
|
- lib/rubocop/cop/chef/style/file_mode.rb
|
238
246
|
- lib/rubocop/cop/chef/style/immediate_notification_timing.rb
|
247
|
+
- lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb
|
239
248
|
- lib/rubocop/cop/chef/style/negating_only_if.rb
|
240
249
|
- lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb
|
241
250
|
- lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb
|
@@ -247,6 +256,7 @@ files:
|
|
247
256
|
- lib/rubocop/monkey_patches/comment_config.rb
|
248
257
|
- lib/rubocop/monkey_patches/config.rb
|
249
258
|
- lib/rubocop/monkey_patches/cop.rb
|
259
|
+
- lib/rubocop/monkey_patches/registry_cop.rb
|
250
260
|
- lib/rubocop/monkey_patches/team.rb
|
251
261
|
homepage:
|
252
262
|
licenses:
|
@@ -1,81 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright:: 2020, Chef Software Inc.
|
3
|
-
# Author:: Tim Smith (<tsmith@chef.io>)
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
module RuboCop
|
19
|
-
module Cop
|
20
|
-
module Chef
|
21
|
-
module ChefDeprecations
|
22
|
-
# In Chef Infra Client 16 and later a legacy HWRP resource must use either `resource_name` or `provides` to define the resource name.
|
23
|
-
#
|
24
|
-
# @example
|
25
|
-
#
|
26
|
-
# # bad
|
27
|
-
# class Chef
|
28
|
-
# class Resource
|
29
|
-
# class UlimitRule < Chef::Resource
|
30
|
-
# property :type, [Symbol, String], required: true
|
31
|
-
# property :item, [Symbol, String], required: true
|
32
|
-
#
|
33
|
-
# # additional resource code
|
34
|
-
# end
|
35
|
-
# end
|
36
|
-
# end
|
37
|
-
#
|
38
|
-
# # good
|
39
|
-
# class Chef
|
40
|
-
# class Resource
|
41
|
-
# class UlimitRule < Chef::Resource
|
42
|
-
# resource_name :ulimit_rule
|
43
|
-
#
|
44
|
-
# property :type, [Symbol, String], required: true
|
45
|
-
# property :item, [Symbol, String], required: true
|
46
|
-
#
|
47
|
-
# # additional resource code
|
48
|
-
# end
|
49
|
-
# end
|
50
|
-
# end
|
51
|
-
#
|
52
|
-
# # better
|
53
|
-
# Convert your legacy HWRPs to custom resources
|
54
|
-
#
|
55
|
-
class ResourceWithoutNameOrProvides < Cop
|
56
|
-
MSG = 'In Chef Infra Client 16 and later legacy HWRP resources must use either `resource_name` or `provides` to define the resource name.'.freeze
|
57
|
-
|
58
|
-
def_node_matcher :HWRP?, <<-PATTERN
|
59
|
-
(class
|
60
|
-
(const nil? :Chef) nil?
|
61
|
-
(class
|
62
|
-
(const nil? :Resource) nil?
|
63
|
-
$(class
|
64
|
-
(const nil? ... )
|
65
|
-
(const
|
66
|
-
(const nil? :Chef) :Resource)
|
67
|
-
(begin ... ))))
|
68
|
-
PATTERN
|
69
|
-
|
70
|
-
def_node_search :provides_or_resource_name?, '(send nil? {:provides :resource_name} ...)'
|
71
|
-
|
72
|
-
def on_class(node)
|
73
|
-
HWRP?(node) do |inherit|
|
74
|
-
add_offense(inherit, location: :expression, message: MSG, severity: :warning) if provides_or_resource_name?(processed_source.ast).nil?
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|