cookstyle 7.5.2 → 7.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/bin/cookstyle +7 -2
- data/config/cookstyle.yml +240 -231
- data/config/disable_all.yml +22 -0
- data/config/upstream.yml +137 -31
- data/lib/cookstyle/version.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/block_guard_clause_string_only.rb +4 -4
- data/lib/rubocop/cop/chef/correctness/chef_application_fatal.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/conditional_ruby_shellout.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/dnf_package_allow_downgrades.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_default_action.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_values_in_case.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_platform_values_in_case.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_version_metadata.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/lazy_eval_node_attribute_defaults.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/lazy_in_resource_guard.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/macos_userdefaults_invalid_type.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/metadata_missing_name.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/node_normal.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/node_normal_unless.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/node_save.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/notifies_action_not_symbol.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/octal_mode_as_string.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/openssl_password_helpers.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/powershell_delete_file.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/property_without_type.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/resource_sets_internal_properties.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/resource_sets_name_property.rb +3 -4
- data/lib/rubocop/cop/chef/correctness/resource_with_none_action.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/scoped_file_exist.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/service_resource.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/tmp_path.rb +2 -3
- data/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/cb_depends_on_self.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/chef_sugar_helpers.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/chefdk_generators.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/chefspec_coverage_report.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/chefspec_legacy_runner.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/chocolatey_package_uninstall_action.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_chefspec_platform.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_actions.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/deprecated_yum_repository_properties.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/easy_install.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/erl_call.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/execute_path_property.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/foodcritic_testing.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb +4 -4
- data/lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/librarian_chefspec.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/locale_lc_all_property.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/log_resource_notifications.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/macos_userdefaults_global_property.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/node_deep_fetch.rb +4 -4
- data/lib/rubocop/cop/chef/deprecation/node_methods_not_attributes.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/node_set.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/node_set_unless.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/node_set_without_level.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/partial_search_class_usage.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/powershell_cookbook_helpers.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/resource_uses_dsl_name_method.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/resource_uses_only_resource_name.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb +3 -3
- data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/ruby_block_create_action.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/use_yaml_dump.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/user_supports_property.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb +2 -2
- data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/chef_vault_used.rb +6 -6
- data/lib/rubocop/cop/chef/effortless/data_bags.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/depends_chef_vault.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_environment.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_policygroup.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/node_roles.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +1 -1
- data/lib/rubocop/cop/chef/effortless/search_used.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/action_method_in_resource.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/allowed_actions_initializer.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +3 -5
- data/lib/rubocop/cop/chef/modernize/build_essential.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/compile_time_resources.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/cron_d_file_or_template.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +5 -5
- data/lib/rubocop/cop/chef/modernize/databag_helpers.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/default_action_initializer.rb +3 -3
- data/lib/rubocop/cop/chef/modernize/defines_chefspec_matchers.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +3 -1
- data/lib/rubocop/cop/chef/modernize/empty_resource_initialize.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +5 -4
- data/lib/rubocop/cop/chef/modernize/execute_sc_exe.rb +6 -4
- data/lib/rubocop/cop/chef/modernize/execute_sleep.rb +4 -2
- data/lib/rubocop/cop/chef/modernize/execute_sysctl.rb +4 -2
- data/lib/rubocop/cop/chef/modernize/execute_tzutil.rb +5 -4
- data/lib/rubocop/cop/chef/modernize/foodcritic_comments.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/if_provides_default_action.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +5 -4
- data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/node_init_package.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/node_roles_include.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +2 -4
- data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +5 -4
- data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +5 -4
- data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +5 -4
- data/lib/rubocop/cop/chef/modernize/powershell_expand_archive.rb +2 -3
- data/lib/rubocop/cop/chef/modernize/powershell_guard_interpreter.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/powershell_install_package.rb +3 -4
- data/lib/rubocop/cop/chef/modernize/powershell_install_windowsfeature.rb +3 -4
- data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/provides_initializer.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/resource_name_initializer.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +3 -5
- data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +3 -5
- data/lib/rubocop/cop/chef/modernize/respond_to_compile_time.rb +4 -2
- data/lib/rubocop/cop/chef/modernize/respond_to_metadata.rb +3 -4
- data/lib/rubocop/cop/chef/modernize/respond_to_provides.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/respond_to_resource_name.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/sc_windows_resource.rb +6 -4
- data/lib/rubocop/cop/chef/modernize/seven_zip_archive.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/shell_out_helper.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/sysctl_param_resource.rb +4 -2
- data/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/whyrun_supported_true.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +4 -2
- data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/apt_repository_distribution_default.rb +4 -2
- data/lib/rubocop/cop/chef/redundant/apt_repository_notifies_apt_update.rb +4 -2
- data/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/double_compile_time.rb +4 -2
- data/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/multiple_platform_checks.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/name_property_and_required.rb +2 -3
- data/lib/rubocop/cop/chef/redundant/ohai_attribute_to_string.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/property_splat_regex.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/provides_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/resource_with_nothing_action.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +3 -1
- data/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +2 -2
- data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/use_create_if_missing.rb +2 -2
- data/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +2 -2
- data/lib/rubocop/cop/chef/sharing/empty_metadata_field.rb +2 -2
- data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +2 -2
- data/lib/rubocop/cop/chef/sharing/include_resource_descriptions.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/include_resource_examples.rb +1 -1
- data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +2 -2
- data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +57 -3
- data/lib/rubocop/cop/chef/style/attribute_keys.rb +4 -4
- data/lib/rubocop/cop/chef/style/chef_whaaat.rb +2 -2
- data/lib/rubocop/cop/chef/style/comments_copyright_format.rb +9 -9
- data/lib/rubocop/cop/chef/style/comments_default_copyright.rb +2 -2
- data/lib/rubocop/cop/chef/style/comments_format.rb +2 -2
- data/lib/rubocop/cop/chef/style/file_mode.rb +2 -2
- data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +2 -2
- data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +2 -2
- data/lib/rubocop/cop/chef/style/negating_only_if.rb +2 -2
- data/lib/rubocop/cop/chef/style/overly_complex_supports_depends_metadata.rb +2 -2
- data/lib/rubocop/cop/chef/style/simplify_platform_major_version_check.rb +2 -2
- data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +2 -2
- data/lib/rubocop/cop/chef/style/unnecessary_os_check.rb +2 -2
- data/lib/rubocop/cop/chef/style/unnecessary_platform_case_statement.rb +2 -2
- data/lib/rubocop/cop/chef/style/use_platform_helpers.rb +2 -2
- metadata +5 -5
@@ -21,13 +21,15 @@ module RuboCop
|
|
21
21
|
module RedundantCode
|
22
22
|
# If a resource includes the `compile_time` property there's no need to also use `.run_action(:some_action)` on the resource block
|
23
23
|
#
|
24
|
-
#
|
24
|
+
# @example
|
25
|
+
#
|
26
|
+
# #### incorrect
|
25
27
|
# chef_gem 'deep_merge' do
|
26
28
|
# action :nothing
|
27
29
|
# compile_time true
|
28
30
|
# end.run_action(:install)
|
29
31
|
#
|
30
|
-
#
|
32
|
+
# #### correct
|
31
33
|
# chef_gem 'deep_merge' do
|
32
34
|
# action :install
|
33
35
|
# compile_time true
|
@@ -24,11 +24,11 @@ module RuboCop
|
|
24
24
|
#
|
25
25
|
# @example
|
26
26
|
#
|
27
|
-
#
|
27
|
+
# #### incorrect
|
28
28
|
# platform?('redhat') || platform?('ubuntu')
|
29
29
|
# platform_family?('debian') || platform_family?('rhel')
|
30
30
|
#
|
31
|
-
#
|
31
|
+
# #### correct
|
32
32
|
# platform?('redhat', 'ubuntu')
|
33
33
|
# platform_family?('debian', 'rhel')
|
34
34
|
#
|
@@ -51,12 +51,11 @@ module RuboCop
|
|
51
51
|
#
|
52
52
|
# @example
|
53
53
|
#
|
54
|
-
#
|
55
|
-
# # bad
|
54
|
+
# #### incorrect
|
56
55
|
# property :config_file, String, required: true, name_property: true
|
57
56
|
# attribute :config_file, String, required: true, name_attribute: true
|
58
57
|
#
|
59
|
-
#
|
58
|
+
# #### correct
|
60
59
|
# property :config_file, String, required: true
|
61
60
|
#
|
62
61
|
class NamePropertyIsRequired < Base
|
@@ -24,7 +24,7 @@ module RuboCop
|
|
24
24
|
#
|
25
25
|
# @example
|
26
26
|
#
|
27
|
-
#
|
27
|
+
# #### incorrect
|
28
28
|
# node['platform'].to_s
|
29
29
|
# node['platform_family'].to_s
|
30
30
|
# node['platform_version'].to_s
|
@@ -33,7 +33,7 @@ module RuboCop
|
|
33
33
|
# node['os'].to_s
|
34
34
|
# node['name'].to_s
|
35
35
|
#
|
36
|
-
#
|
36
|
+
# #### correct
|
37
37
|
# node['platform']
|
38
38
|
# node['platform_family']
|
39
39
|
# node['platform_version']
|
@@ -23,11 +23,11 @@ module RuboCop
|
|
23
23
|
#
|
24
24
|
# @example
|
25
25
|
#
|
26
|
-
#
|
26
|
+
# #### incorrect
|
27
27
|
# property :config_file, String, regex: /.*/
|
28
28
|
# attribute :config_file, String, regex: /.*/
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# #### correct
|
31
31
|
# property :config_file, String
|
32
32
|
# attribute :config_file, String
|
33
33
|
#
|
@@ -26,10 +26,10 @@ module RuboCop
|
|
26
26
|
#
|
27
27
|
# @example
|
28
28
|
#
|
29
|
-
#
|
29
|
+
# #### incorrect
|
30
30
|
# property :bob, String, required: true, default: 'foo'
|
31
31
|
#
|
32
|
-
#
|
32
|
+
# #### correct
|
33
33
|
# property :bob, String, required: true
|
34
34
|
#
|
35
35
|
class PropertyWithRequiredAndDefault < Base
|
@@ -21,7 +21,9 @@ module RuboCop
|
|
21
21
|
module RedundantCode
|
22
22
|
# Every Chef Infra resource already includes a sensitive property with a default value of false.
|
23
23
|
#
|
24
|
-
#
|
24
|
+
# @example
|
25
|
+
#
|
26
|
+
# #### incorrect
|
25
27
|
# property :sensitive, [true, false], default: false
|
26
28
|
#
|
27
29
|
class SensitivePropertyInResource < Base
|
@@ -23,11 +23,11 @@ module RuboCop
|
|
23
23
|
#
|
24
24
|
# @example
|
25
25
|
#
|
26
|
-
#
|
26
|
+
# #### incorrect
|
27
27
|
# property :config_file, String, default: nil
|
28
28
|
# property :config_file, [String, NilClass], default: nil
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# #### correct
|
31
31
|
# property :config_file, String
|
32
32
|
# property :config_file, [String, NilClass]
|
33
33
|
#
|
@@ -23,11 +23,11 @@ module RuboCop
|
|
23
23
|
#
|
24
24
|
# @example
|
25
25
|
#
|
26
|
-
#
|
26
|
+
# #### incorrect
|
27
27
|
# property :foo, String, desired_state: true
|
28
28
|
# attribute :foo, String, desired_state: true
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# #### correct
|
31
31
|
# property :foo, String
|
32
32
|
# attribute :foo, String
|
33
33
|
#
|
@@ -23,7 +23,7 @@ module RuboCop
|
|
23
23
|
#
|
24
24
|
# @example
|
25
25
|
#
|
26
|
-
#
|
26
|
+
# #### incorrect
|
27
27
|
# cookbook_file '/logs/foo/error.log' do
|
28
28
|
# source 'error.log'
|
29
29
|
# owner 'root'
|
@@ -32,7 +32,7 @@ module RuboCop
|
|
32
32
|
# not_if { ::File.exists?('/logs/foo/error.log') }
|
33
33
|
# end
|
34
34
|
#
|
35
|
-
#
|
35
|
+
# #### correct
|
36
36
|
# cookbook_file '/logs/foo/error.log' do
|
37
37
|
# source 'error.log'
|
38
38
|
# owner 'root'
|
@@ -24,12 +24,12 @@ module RuboCop
|
|
24
24
|
#
|
25
25
|
# @example
|
26
26
|
#
|
27
|
-
#
|
27
|
+
# #### incorrect
|
28
28
|
# maintainer 'YOUR_COMPANY_NAME'
|
29
29
|
# maintainer_email 'YOUR_EMAIL'
|
30
30
|
# maintainer 'The Authors'
|
31
31
|
# maintainer_email 'you@example.com'
|
32
|
-
#
|
32
|
+
# #### correct
|
33
33
|
# maintainer 'Bob Bobberson'
|
34
34
|
# maintainer_email 'bob@bobberson.com'
|
35
35
|
#
|
@@ -23,10 +23,10 @@ module RuboCop
|
|
23
23
|
#
|
24
24
|
# @example
|
25
25
|
#
|
26
|
-
#
|
26
|
+
# #### incorrect
|
27
27
|
# property :foo, String
|
28
28
|
#
|
29
|
-
#
|
29
|
+
# #### correct
|
30
30
|
# property :foo, String, description: "Set the important thing to..."
|
31
31
|
#
|
32
32
|
class IncludePropertyDescriptions < Base
|
@@ -23,13 +23,13 @@ module RuboCop
|
|
23
23
|
#
|
24
24
|
# @example
|
25
25
|
#
|
26
|
-
#
|
26
|
+
# #### incorrect
|
27
27
|
# source_url 'http://github.com/something/something'
|
28
28
|
# source_url 'http://www.github.com/something/something'
|
29
29
|
# source_url 'http://www.gitlab.com/something/something'
|
30
30
|
# source_url 'http://gitlab.com/something/something'
|
31
31
|
#
|
32
|
-
#
|
32
|
+
# #### correct
|
33
33
|
# source_url 'http://github.com/something/something'
|
34
34
|
# source_url 'http://gitlab.com/something/something'
|
35
35
|
#
|
@@ -24,18 +24,20 @@ module RuboCop
|
|
24
24
|
#
|
25
25
|
# @example
|
26
26
|
#
|
27
|
-
#
|
27
|
+
# #### incorrect
|
28
28
|
# license 'Apache 2.0'
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# #### correct
|
31
31
|
# license 'Apache-2.0'
|
32
32
|
# license 'all rights reserved'
|
33
33
|
#
|
34
|
-
# list of valid SPDX.org license strings. To build an array run this:
|
34
|
+
# list of valid SPDX.org license strings. To build an array run this ruby:
|
35
|
+
# ```ruby
|
35
36
|
# require 'json'
|
36
37
|
# require 'net/http'
|
37
38
|
# json_data = JSON.parse(Net::HTTP.get(URI('https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json')))
|
38
39
|
# licenses = json_data['licenses'].map {|l| l['licenseId'] }.sort
|
40
|
+
# ```
|
39
41
|
#
|
40
42
|
class InvalidLicenseString < Base
|
41
43
|
extend AutoCorrector
|
@@ -59,6 +61,7 @@ module RuboCop
|
|
59
61
|
AML
|
60
62
|
AMPAS
|
61
63
|
ANTLR-PD
|
64
|
+
ANTLR-PD-fallback
|
62
65
|
APAFML
|
63
66
|
APL-1.0
|
64
67
|
APSL-1.0
|
@@ -82,6 +85,7 @@ module RuboCop
|
|
82
85
|
BSD-2-Clause-FreeBSD
|
83
86
|
BSD-2-Clause-NetBSD
|
84
87
|
BSD-2-Clause-Patent
|
88
|
+
BSD-2-Clause-Views
|
85
89
|
BSD-3-Clause
|
86
90
|
BSD-3-Clause-Attribution
|
87
91
|
BSD-3-Clause-Clear
|
@@ -95,6 +99,7 @@ module RuboCop
|
|
95
99
|
BSD-Protection
|
96
100
|
BSD-Source-Code
|
97
101
|
BSL-1.0
|
102
|
+
BUSL-1.1
|
98
103
|
Bahyph
|
99
104
|
Barr
|
100
105
|
Beerware
|
@@ -102,11 +107,15 @@ module RuboCop
|
|
102
107
|
BitTorrent-1.1
|
103
108
|
BlueOak-1.0.0
|
104
109
|
Borceux
|
110
|
+
CAL-1.0
|
111
|
+
CAL-1.0-Combined-Work-Exception
|
105
112
|
CATOSL-1.1
|
106
113
|
CC-BY-1.0
|
107
114
|
CC-BY-2.0
|
108
115
|
CC-BY-2.5
|
109
116
|
CC-BY-3.0
|
117
|
+
CC-BY-3.0-AT
|
118
|
+
CC-BY-3.0-US
|
110
119
|
CC-BY-4.0
|
111
120
|
CC-BY-NC-1.0
|
112
121
|
CC-BY-NC-2.0
|
@@ -117,6 +126,7 @@ module RuboCop
|
|
117
126
|
CC-BY-NC-ND-2.0
|
118
127
|
CC-BY-NC-ND-2.5
|
119
128
|
CC-BY-NC-ND-3.0
|
129
|
+
CC-BY-NC-ND-3.0-IGO
|
120
130
|
CC-BY-NC-ND-4.0
|
121
131
|
CC-BY-NC-SA-1.0
|
122
132
|
CC-BY-NC-SA-2.0
|
@@ -130,8 +140,10 @@ module RuboCop
|
|
130
140
|
CC-BY-ND-4.0
|
131
141
|
CC-BY-SA-1.0
|
132
142
|
CC-BY-SA-2.0
|
143
|
+
CC-BY-SA-2.0-UK
|
133
144
|
CC-BY-SA-2.5
|
134
145
|
CC-BY-SA-3.0
|
146
|
+
CC-BY-SA-3.0-AT
|
135
147
|
CC-BY-SA-4.0
|
136
148
|
CC-PDDC
|
137
149
|
CC0-1.0
|
@@ -147,6 +159,9 @@ module RuboCop
|
|
147
159
|
CECILL-C
|
148
160
|
CERN-OHL-1.1
|
149
161
|
CERN-OHL-1.2
|
162
|
+
CERN-OHL-P-2.0
|
163
|
+
CERN-OHL-S-2.0
|
164
|
+
CERN-OHL-W-2.0
|
150
165
|
CNRI-Jython
|
151
166
|
CNRI-Python
|
152
167
|
CNRI-Python-GPL-Compatible
|
@@ -168,6 +183,7 @@ module RuboCop
|
|
168
183
|
ECL-2.0
|
169
184
|
EFL-1.0
|
170
185
|
EFL-2.0
|
186
|
+
EPICS
|
171
187
|
EPL-1.0
|
172
188
|
EPL-2.0
|
173
189
|
EUDatagrid
|
@@ -185,15 +201,28 @@ module RuboCop
|
|
185
201
|
Frameworx-1.0
|
186
202
|
FreeImage
|
187
203
|
GFDL-1.1
|
204
|
+
GFDL-1.1-invariants-only
|
205
|
+
GFDL-1.1-invariants-or-later
|
206
|
+
GFDL-1.1-no-invariants-only
|
207
|
+
GFDL-1.1-no-invariants-or-later
|
188
208
|
GFDL-1.1-only
|
189
209
|
GFDL-1.1-or-later
|
190
210
|
GFDL-1.2
|
211
|
+
GFDL-1.2-invariants-only
|
212
|
+
GFDL-1.2-invariants-or-later
|
213
|
+
GFDL-1.2-no-invariants-only
|
214
|
+
GFDL-1.2-no-invariants-or-later
|
191
215
|
GFDL-1.2-only
|
192
216
|
GFDL-1.2-or-later
|
193
217
|
GFDL-1.3
|
218
|
+
GFDL-1.3-invariants-only
|
219
|
+
GFDL-1.3-invariants-or-later
|
220
|
+
GFDL-1.3-no-invariants-only
|
221
|
+
GFDL-1.3-no-invariants-or-later
|
194
222
|
GFDL-1.3-only
|
195
223
|
GFDL-1.3-or-later
|
196
224
|
GL2PS
|
225
|
+
GLWTPL
|
197
226
|
GPL-1.0
|
198
227
|
GPL-1.0+
|
199
228
|
GPL-1.0-only
|
@@ -218,7 +247,9 @@ module RuboCop
|
|
218
247
|
Glulxe
|
219
248
|
HPND
|
220
249
|
HPND-sell-variant
|
250
|
+
HTMLTIDY
|
221
251
|
HaskellReport
|
252
|
+
Hippocratic-2.1
|
222
253
|
IBM-pibs
|
223
254
|
ICU
|
224
255
|
IJG
|
@@ -269,6 +300,7 @@ module RuboCop
|
|
269
300
|
MIT-advertising
|
270
301
|
MIT-enna
|
271
302
|
MIT-feh
|
303
|
+
MIT-open-group
|
272
304
|
MITNFA
|
273
305
|
MPL-1.0
|
274
306
|
MPL-1.1
|
@@ -280,12 +312,17 @@ module RuboCop
|
|
280
312
|
MakeIndex
|
281
313
|
MirOS
|
282
314
|
Motosoto
|
315
|
+
MulanPSL-1.0
|
316
|
+
MulanPSL-2.0
|
283
317
|
Multics
|
284
318
|
Mup
|
285
319
|
NASA-1.3
|
286
320
|
NBPL-1.0
|
321
|
+
NCGL-UK-2.0
|
287
322
|
NCSA
|
288
323
|
NGPL
|
324
|
+
NIST-PD
|
325
|
+
NIST-PD-fallback
|
289
326
|
NLOD-1.0
|
290
327
|
NLPL
|
291
328
|
NOSL
|
@@ -294,6 +331,7 @@ module RuboCop
|
|
294
331
|
NPOSL-3.0
|
295
332
|
NRL
|
296
333
|
NTP
|
334
|
+
NTP-0
|
297
335
|
Naumen
|
298
336
|
Net-SNMP
|
299
337
|
NetCDF
|
@@ -301,12 +339,19 @@ module RuboCop
|
|
301
339
|
Nokia
|
302
340
|
Noweb
|
303
341
|
Nunit
|
342
|
+
O-UDA-1.0
|
304
343
|
OCCT-PL
|
305
344
|
OCLC-2.0
|
306
345
|
ODC-By-1.0
|
307
346
|
ODbL-1.0
|
308
347
|
OFL-1.0
|
348
|
+
OFL-1.0-RFN
|
349
|
+
OFL-1.0-no-RFN
|
309
350
|
OFL-1.1
|
351
|
+
OFL-1.1-RFN
|
352
|
+
OFL-1.1-no-RFN
|
353
|
+
OGC-1.0
|
354
|
+
OGL-Canada-2.0
|
310
355
|
OGL-UK-1.0
|
311
356
|
OGL-UK-2.0
|
312
357
|
OGL-UK-3.0
|
@@ -339,8 +384,12 @@ module RuboCop
|
|
339
384
|
PDDL-1.0
|
340
385
|
PHP-3.0
|
341
386
|
PHP-3.01
|
387
|
+
PSF-2.0
|
342
388
|
Parity-6.0.0
|
389
|
+
Parity-7.0.0
|
343
390
|
Plexus
|
391
|
+
PolyForm-Noncommercial-1.0.0
|
392
|
+
PolyForm-Small-Business-1.0.0
|
344
393
|
PostgreSQL
|
345
394
|
Python-2.0
|
346
395
|
QPL-1.0
|
@@ -366,6 +415,8 @@ module RuboCop
|
|
366
415
|
SMPPL
|
367
416
|
SNIA
|
368
417
|
SPL-1.0
|
418
|
+
SSH-OpenSSH
|
419
|
+
SSH-short
|
369
420
|
SSPL-1.0
|
370
421
|
SWL
|
371
422
|
Saxpath
|
@@ -386,6 +437,7 @@ module RuboCop
|
|
386
437
|
TOSL
|
387
438
|
TU-Berlin-1.0
|
388
439
|
TU-Berlin-2.0
|
440
|
+
UCL-1.0
|
389
441
|
UPL-1.0
|
390
442
|
Unicode-DFS-2015
|
391
443
|
Unicode-DFS-2016
|
@@ -425,10 +477,12 @@ module RuboCop
|
|
425
477
|
dvipdfm
|
426
478
|
eCos-2.0
|
427
479
|
eGenix
|
480
|
+
etalab-2.0
|
428
481
|
gSOAP-1.3b
|
429
482
|
gnuplot
|
430
483
|
iMatix
|
431
484
|
libpng-2.0
|
485
|
+
libselinux-1.0
|
432
486
|
libtiff
|
433
487
|
mpich2
|
434
488
|
psfrag
|