cookstyle 6.16.4 → 6.17.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cookstyle +1 -1
- data/config/cookstyle.yml +47 -2
- data/config/upstream.yml +0 -1
- data/lib/cookstyle.rb +2 -2
- data/lib/cookstyle/version.rb +1 -1
- data/lib/rubocop/cop/chef/correctness/incorrect_library_injection.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/invalid_default_action.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/invalid_notification_timing.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/invalid_platform_family_helper.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/invalid_platform_helper.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/invalid_platform_metadata.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_family_helper.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/invalid_value_for_platform_helper.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/malformed_value_for_platform.rb +2 -2
- data/lib/rubocop/cop/chef/correctness/service_resource.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/supports_must_be_float.rb +1 -0
- data/lib/rubocop/cop/chef/correctness/tmp_path.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/ use_automatic_resource_name.rb +1 -2
- data/lib/rubocop/cop/chef/deprecation/cb_depends_on_self.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/chef_handler_recipe.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/chef_rest.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/chef_rewind.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/chef_shellout.rb +86 -0
- data/lib/rubocop/cop/chef/deprecation/depends_compat_resource.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/depends_partial_search.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/depends_poise.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_mixins.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/deprecated_platform_methods.rb +8 -4
- data/lib/rubocop/cop/chef/deprecation/deprecated_shellout_methods.rb +10 -11
- data/lib/rubocop/cop/chef/deprecation/deprecated_windows_version_check.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/easy_install.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/epic_fail.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/erl_call.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/execute_path_property.rb +51 -0
- data/lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb +67 -0
- data/lib/rubocop/cop/chef/deprecation/legacy_notify_syntax.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/legacy_yum_cookbook_recipes.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/name_property_and_default.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/partial_search_helper_usage.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/poise_archive.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/require_recipe.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/resource_overrides_provides_method.rb +3 -3
- 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 +1 -0
- data/lib/rubocop/cop/chef/deprecation/resource_uses_provider_base_method.rb +2 -1
- data/lib/rubocop/cop/chef/deprecation/ruby_27_keyword_argument_warnings.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/run_command_helper.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/search_uses_positional_parameters.rb +5 -2
- data/lib/rubocop/cop/chef/deprecation/use_inline_resources.rb +10 -11
- data/lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb +1 -1
- data/lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb +61 -0
- data/lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb +1 -0
- data/lib/rubocop/cop/chef/deprecation/yum_dnf_compat_recipe.rb +1 -0
- data/lib/rubocop/cop/chef/effortless/data_bags.rb +2 -1
- data/lib/rubocop/cop/chef/effortless/node_environment.rb +2 -2
- data/lib/rubocop/cop/chef/effortless/node_policygroup.rb +2 -2
- data/lib/rubocop/cop/chef/effortless/node_roles.rb +2 -2
- data/lib/rubocop/cop/chef/effortless/search_for_environments_or_roles.rb +2 -2
- data/lib/rubocop/cop/chef/effortless/search_used.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/apt_default_recipe.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/berksfile_source.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/build_essential.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/chef_14_resources.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/chef_gem_nokogiri.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/conditional_using_test.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/cron_manage_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/depends_zypper_cookbook.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/dsl_include_in_resource.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/execute_apt_update.rb +1 -0
- 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 +1 -0
- data/lib/rubocop/cop/chef/modernize/includes_mixin_shellout.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/libarchive_file.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/macos_user_defaults.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/minitest_handler_usage.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/ohai_default_recipe.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/openssl_rsa_key_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/openssl_x509_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/osx_config_profile_resource.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/property_with_name_attribute.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/resource_set_or_return.rb +1 -1
- data/lib/rubocop/cop/chef/modernize/resource_with_attributes.rb +1 -0
- 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/{systctl_param_resource.rb → sysctl_param_resource.rb} +1 -1
- data/lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/use_require_relative.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/windows_default_recipe.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/windows_registry_uac.rb +2 -2
- data/lib/rubocop/cop/chef/modernize/windows_zipfile.rb +2 -1
- data/lib/rubocop/cop/chef/modernize/zipfile_resource.rb +1 -0
- data/lib/rubocop/cop/chef/modernize/zypper_repo.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/attribute_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/conflicts_metadata.rb +1 -1
- data/lib/rubocop/cop/chef/redundant/custom_resource_with_allowed_actions.rb +7 -9
- data/lib/rubocop/cop/chef/redundant/grouping_metadata.rb +1 -2
- data/lib/rubocop/cop/chef/redundant/long_description_metadata.rb +1 -2
- data/lib/rubocop/cop/chef/redundant/property_with_default_and_required.rb +1 -0
- data/lib/rubocop/cop/chef/redundant/provides_metadata.rb +1 -2
- data/lib/rubocop/cop/chef/redundant/recipe_metadata.rb +1 -2
- data/lib/rubocop/cop/chef/redundant/replaces_metadata.rb +1 -2
- data/lib/rubocop/cop/chef/redundant/sensitive_property_in_resource.rb +1 -0
- data/lib/rubocop/cop/chef/redundant/string_property_with_nil_default.rb +1 -0
- data/lib/rubocop/cop/chef/redundant/suggests_metadata.rb +1 -2
- data/lib/rubocop/cop/chef/redundant/unnecessary_desired_state.rb +1 -0
- data/lib/rubocop/cop/chef/redundant/unnecessary_name_property.rb +1 -0
- data/lib/rubocop/cop/chef/sharing/default_maintainer_metadata.rb +1 -0
- data/lib/rubocop/cop/chef/sharing/include_property_descriptions.rb +1 -0
- data/lib/rubocop/cop/chef/sharing/insecure_cookbook_url.rb +1 -0
- data/lib/rubocop/cop/chef/sharing/invalid_license_string.rb +1 -0
- data/lib/rubocop/cop/chef/style/file_mode.rb +1 -0
- data/lib/rubocop/cop/chef/style/immediate_notification_timing.rb +1 -0
- data/lib/rubocop/cop/chef/style/include_recipe_with_parentheses.rb +1 -0
- data/lib/rubocop/cop/chef/style/true_false_resource_properties.rb +2 -0
- metadata +7 -3
@@ -36,6 +36,7 @@ module RuboCop
|
|
36
36
|
minimum_target_chef_version '15.0'
|
37
37
|
|
38
38
|
MSG = 'Use the archive_file resource built into Chef Infra Client 15+ instead of the zipfile resource from the zipfile cookbook.'
|
39
|
+
RESTRICT_ON_SEND = [:depends].freeze
|
39
40
|
|
40
41
|
def_node_matcher :depends_zipfile?, <<-PATTERN
|
41
42
|
(send nil? :depends (str "zipfile"))
|
@@ -46,9 +46,9 @@ module RuboCop
|
|
46
46
|
minimum_target_chef_version '13.3'
|
47
47
|
|
48
48
|
MSG = 'The zypper_repo resource was renamed zypper_repository when it was added to Chef Infra Client 13.3.'
|
49
|
+
RESTRICT_ON_SEND = [:zypper_repo].freeze
|
49
50
|
|
50
51
|
def on_send(node)
|
51
|
-
return unless node.method_name == :zypper_repo
|
52
52
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
53
53
|
corrector.replace(node.loc.expression, node.source.gsub(/^zypper_repo/, 'zypper_repository'))
|
54
54
|
end
|
@@ -39,9 +39,9 @@ module RuboCop
|
|
39
39
|
extend AutoCorrector
|
40
40
|
|
41
41
|
MSG = 'The attribute metadata.rb method is not used and is unnecessary in cookbooks.'
|
42
|
+
RESTRICT_ON_SEND = [:attribute].freeze
|
42
43
|
|
43
44
|
def on_send(node)
|
44
|
-
return unless node.method_name == :attribute
|
45
45
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
46
46
|
corrector.remove(range_with_surrounding_space(range: expression_including_heredocs(node), side: :left))
|
47
47
|
end
|
@@ -33,9 +33,9 @@ module RuboCop
|
|
33
33
|
extend AutoCorrector
|
34
34
|
|
35
35
|
MSG = 'The conflicts metadata.rb method is not used and is unnecessary in cookbooks.'
|
36
|
+
RESTRICT_ON_SEND = [:conflicts].freeze
|
36
37
|
|
37
38
|
def on_send(node)
|
38
|
-
return unless node.method_name == :conflicts
|
39
39
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
40
40
|
corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :right))
|
41
41
|
end
|
@@ -35,10 +35,7 @@ module RuboCop
|
|
35
35
|
extend AutoCorrector
|
36
36
|
|
37
37
|
MSG = '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'
|
38
|
-
|
39
|
-
def_node_matcher :allowed_actions?, <<-PATTERN
|
40
|
-
(send nil? {:allowed_actions :actions} ... )
|
41
|
-
PATTERN
|
38
|
+
RESTRICT_ON_SEND = [:allowed_actions, :actions].freeze
|
42
39
|
|
43
40
|
def_node_search :poise_require, '(send nil? :require (str "poise"))'
|
44
41
|
|
@@ -47,13 +44,14 @@ module RuboCop
|
|
47
44
|
PATTERN
|
48
45
|
|
49
46
|
def on_send(node)
|
47
|
+
# avoid triggering on things like new_resource.actions
|
48
|
+
return unless node.receiver.nil?
|
49
|
+
|
50
50
|
# if the resource requires poise then bail out since we're in a poise resource where @allowed_actions is legit
|
51
|
-
return if poise_require(processed_source.ast).any?
|
51
|
+
return if poise_require(processed_source.ast).any? || !resource_actions?(processed_source.ast)
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
|
56
|
-
end
|
53
|
+
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
54
|
+
corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
|
57
55
|
end
|
58
56
|
end
|
59
57
|
end
|
@@ -33,10 +33,9 @@ module RuboCop
|
|
33
33
|
extend AutoCorrector
|
34
34
|
|
35
35
|
MSG = 'The grouping metadata.rb method is not used and is unnecessary in cookbooks.'
|
36
|
+
RESTRICT_ON_SEND = [:grouping].freeze
|
36
37
|
|
37
38
|
def on_send(node)
|
38
|
-
return unless node.method_name == :grouping
|
39
|
-
|
40
39
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
41
40
|
corrector.remove(range_with_surrounding_space(range: expression_including_heredocs(node), side: :left))
|
42
41
|
end
|
@@ -33,10 +33,9 @@ module RuboCop
|
|
33
33
|
extend AutoCorrector
|
34
34
|
|
35
35
|
MSG = 'The long_description metadata.rb method is not used and is unnecessary in cookbooks.'
|
36
|
+
RESTRICT_ON_SEND = [:long_description].freeze
|
36
37
|
|
37
38
|
def on_send(node)
|
38
|
-
return unless node.method_name == :long_description
|
39
|
-
|
40
39
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
41
40
|
corrector.remove(range_with_surrounding_space(range: expression_including_heredocs(node), side: :left))
|
42
41
|
end
|
@@ -37,6 +37,7 @@ module RuboCop
|
|
37
37
|
extend AutoCorrector
|
38
38
|
|
39
39
|
MSG = 'Resource properties should not be both required and have a default value. This will fail on Chef Infra Client 13+'
|
40
|
+
RESTRICT_ON_SEND = [:property, :attribute].freeze
|
40
41
|
|
41
42
|
# match on a property or attribute that has any name and any type and a hash that
|
42
43
|
# contains default: true and required: true. These are wrapped in <> which means
|
@@ -33,10 +33,9 @@ module RuboCop
|
|
33
33
|
extend AutoCorrector
|
34
34
|
|
35
35
|
MSG = 'The provides metadata.rb method is not used and is unnecessary in cookbooks.'
|
36
|
+
RESTRICT_ON_SEND = [:provides].freeze
|
36
37
|
|
37
38
|
def on_send(node)
|
38
|
-
return unless node.method_name == :provides
|
39
|
-
|
40
39
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
41
40
|
corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
|
42
41
|
end
|
@@ -34,10 +34,9 @@ module RuboCop
|
|
34
34
|
extend AutoCorrector
|
35
35
|
|
36
36
|
MSG = "The recipe metadata.rb method is not used and is unnecessary in cookbooks. Recipes should be documented in the cookbook's README.md file instead."
|
37
|
+
RESTRICT_ON_SEND = [:recipe].freeze
|
37
38
|
|
38
39
|
def on_send(node)
|
39
|
-
return unless node.method_name == :recipe
|
40
|
-
|
41
40
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
42
41
|
corrector.remove(range_with_surrounding_space(range: expression_including_heredocs(node), side: :left))
|
43
42
|
end
|
@@ -33,10 +33,9 @@ module RuboCop
|
|
33
33
|
extend AutoCorrector
|
34
34
|
|
35
35
|
MSG = 'The replaces metadata.rb method is not used and is unnecessary in cookbooks.'
|
36
|
+
RESTRICT_ON_SEND = [:replaces].freeze
|
36
37
|
|
37
38
|
def on_send(node)
|
38
|
-
return unless node.method_name == :replaces
|
39
|
-
|
40
39
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
41
40
|
corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
|
42
41
|
end
|
@@ -28,6 +28,7 @@ module RuboCop
|
|
28
28
|
extend AutoCorrector
|
29
29
|
|
30
30
|
MSG = 'Every Chef Infra resource already includes a sensitive property with a default value of false.'
|
31
|
+
RESTRICT_ON_SEND = [:property, :attribute].freeze
|
31
32
|
|
32
33
|
def_node_matcher :sensitive_property?, <<-PATTERN
|
33
34
|
(send nil? {:property :attribute} (sym :sensitive) ... (hash (pair (sym :default) (false))))
|
@@ -36,6 +36,7 @@ module RuboCop
|
|
36
36
|
extend AutoCorrector
|
37
37
|
|
38
38
|
MSG = 'Properties have a nil value by default so there is no need to set the default value to nil.'
|
39
|
+
RESTRICT_ON_SEND = [:property].freeze
|
39
40
|
|
40
41
|
def_node_matcher :string_property_with_nil_default?, <<-PATTERN
|
41
42
|
(send nil? :property (sym _)
|
@@ -33,10 +33,9 @@ module RuboCop
|
|
33
33
|
extend AutoCorrector
|
34
34
|
|
35
35
|
MSG = 'The suggests metadata.rb method is not used and is unnecessary in cookbooks.'
|
36
|
+
RESTRICT_ON_SEND = [:suggests].freeze
|
36
37
|
|
37
38
|
def on_send(node)
|
38
|
-
return unless node.method_name == :suggests
|
39
|
-
|
40
39
|
add_offense(node, message: MSG, severity: :refactor) do |corrector|
|
41
40
|
corrector.remove(range_with_surrounding_space(range: node.loc.expression, side: :left))
|
42
41
|
end
|
@@ -30,6 +30,7 @@ module RuboCop
|
|
30
30
|
include RangeHelp
|
31
31
|
|
32
32
|
MSG = 'There is no need to set a property to desired_state: true as all properties have a desired_state of true by default.'
|
33
|
+
RESTRICT_ON_SEND = [:property, :attribute].freeze
|
33
34
|
|
34
35
|
def_node_matcher :property?, <<-PATTERN
|
35
36
|
(send nil? {:property :attribute} (sym _) ... $(hash ...))
|
@@ -33,6 +33,7 @@ module RuboCop
|
|
33
33
|
extend AutoCorrector
|
34
34
|
|
35
35
|
MSG = 'There is no need to define a property or attribute named :name in a resource as Chef Infra defines this on all resources by default.'
|
36
|
+
RESTRICT_ON_SEND = [:property, :attribute].freeze
|
36
37
|
|
37
38
|
def_node_matcher :name_attribute?, <<-PATTERN
|
38
39
|
(send nil? :attribute
|
@@ -35,6 +35,7 @@ module RuboCop
|
|
35
35
|
#
|
36
36
|
class DefaultMetadataMaintainer < Base
|
37
37
|
MSG = 'Metadata contains default maintainer information from the cookbook generator. Add actual cookbook maintainer information to the metadata.rb.'
|
38
|
+
RESTRICT_ON_SEND = [:maintainer, :maintainer_email].freeze
|
38
39
|
|
39
40
|
def_node_matcher :default_metadata?, '(send nil? {:maintainer :maintainer_email} (str {"YOUR_COMPANY_NAME" "The Authors" "YOUR_EMAIL" "you@example.com"}))'
|
40
41
|
|
@@ -35,6 +35,7 @@ module RuboCop
|
|
35
35
|
minimum_target_chef_version '13.9'
|
36
36
|
|
37
37
|
MSG = 'Resource properties should include description fields to allow automated documentation. Requires Chef Infra Client 13.9 or later.'
|
38
|
+
RESTRICT_ON_SEND = [:property].freeze
|
38
39
|
|
39
40
|
# any method named property being called with a symbol argument and anything else
|
40
41
|
def_node_matcher :property?, '(send nil? :property (sym _) ...)'
|
@@ -37,6 +37,7 @@ module RuboCop
|
|
37
37
|
extend AutoCorrector
|
38
38
|
|
39
39
|
MSG = 'Insecure http Github or Gitlab URLs for metadata source_url/issues_url fields'
|
40
|
+
RESTRICT_ON_SEND = [:source_url, :issues_url].freeze
|
40
41
|
|
41
42
|
def_node_matcher :insecure_cb_url?, <<-PATTERN
|
42
43
|
(send nil? {:source_url :issues_url} (str #insecure_url?))
|
@@ -458,6 +458,7 @@ module RuboCop
|
|
458
458
|
}.freeze
|
459
459
|
|
460
460
|
MSG = 'Cookbook metadata.rb does not use a SPDX compliant license string or "all rights reserved". See https://spdx.org/licenses/ for a complete list of license identifiers.'
|
461
|
+
RESTRICT_ON_SEND = [:license].freeze
|
461
462
|
|
462
463
|
def_node_matcher :license?, '(send nil? :license $str ...)'
|
463
464
|
|
@@ -55,6 +55,7 @@ module RuboCop
|
|
55
55
|
extend RuboCop::Cop::AutoCorrector
|
56
56
|
|
57
57
|
MSG = 'Use strings to represent file modes to avoid confusion between octal and base 10 integer formats'
|
58
|
+
RESTRICT_ON_SEND = [:mode, :files_mode].freeze
|
58
59
|
|
59
60
|
def_node_matcher :resource_mode?, <<-PATTERN
|
60
61
|
(send nil? {:mode :files_mode} $int)
|
@@ -39,6 +39,7 @@ module RuboCop
|
|
39
39
|
extend AutoCorrector
|
40
40
|
|
41
41
|
MSG = 'Use :immediately instead of :immediate for resource notification timing'
|
42
|
+
RESTRICT_ON_SEND = [:notifies].freeze
|
42
43
|
|
43
44
|
def_node_matcher :immediate_notify?, <<-PATTERN
|
44
45
|
(send nil? :notifies (sym _) (...) $(sym :immediate))
|
@@ -34,6 +34,7 @@ module RuboCop
|
|
34
34
|
extend RuboCop::Cop::AutoCorrector
|
35
35
|
|
36
36
|
MSG = 'There is no need to wrap the recipe in parentheses when using the include_recipe helper'
|
37
|
+
RESTRICT_ON_SEND = [:include_recipe].freeze
|
37
38
|
|
38
39
|
def_node_matcher :include_recipe?, <<-PATTERN
|
39
40
|
(send nil? :include_recipe $(str _))
|
@@ -31,7 +31,9 @@ module RuboCop
|
|
31
31
|
#
|
32
32
|
class TrueClassFalseClassResourceProperties < Base
|
33
33
|
extend AutoCorrector
|
34
|
+
|
34
35
|
MSG = "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."
|
36
|
+
RESTRICT_ON_SEND = [:property, :attribute].freeze
|
35
37
|
|
36
38
|
def_node_matcher :trueclass_falseclass_property?, <<-PATTERN
|
37
39
|
(send nil? {:property :attribute} (sym _) $(array (const nil? :TrueClass) (const nil? :FalseClass)) ... )
|
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.17.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-09-
|
12
|
+
date: 2020-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rubocop
|
@@ -88,6 +88,7 @@ files:
|
|
88
88
|
- lib/rubocop/cop/chef/deprecation/chef_handler_supports.rb
|
89
89
|
- lib/rubocop/cop/chef/deprecation/chef_rest.rb
|
90
90
|
- lib/rubocop/cop/chef/deprecation/chef_rewind.rb
|
91
|
+
- lib/rubocop/cop/chef/deprecation/chef_shellout.rb
|
91
92
|
- lib/rubocop/cop/chef/deprecation/chef_windows_platform_helper.rb
|
92
93
|
- lib/rubocop/cop/chef/deprecation/chefdk_generators.rb
|
93
94
|
- lib/rubocop/cop/chef/deprecation/cheffile.rb
|
@@ -107,6 +108,8 @@ files:
|
|
107
108
|
- lib/rubocop/cop/chef/deprecation/eol_audit_mode.rb
|
108
109
|
- lib/rubocop/cop/chef/deprecation/epic_fail.rb
|
109
110
|
- lib/rubocop/cop/chef/deprecation/erl_call.rb
|
111
|
+
- lib/rubocop/cop/chef/deprecation/execute_path_property.rb
|
112
|
+
- lib/rubocop/cop/chef/deprecation/execute_relative_creates_without_cwd.rb
|
110
113
|
- lib/rubocop/cop/chef/deprecation/hwrp_without_provides.rb
|
111
114
|
- lib/rubocop/cop/chef/deprecation/inherits_compat_resource.rb
|
112
115
|
- lib/rubocop/cop/chef/deprecation/launchd_deprecated_hash_property.rb
|
@@ -139,6 +142,7 @@ files:
|
|
139
142
|
- lib/rubocop/cop/chef/deprecation/user_supports_property.rb
|
140
143
|
- lib/rubocop/cop/chef/deprecation/verify_property_file_expansion.rb
|
141
144
|
- lib/rubocop/cop/chef/deprecation/windows_feature_servermanagercmd.rb
|
145
|
+
- lib/rubocop/cop/chef/deprecation/windows_package_installer_type_string.rb
|
142
146
|
- lib/rubocop/cop/chef/deprecation/windows_task_change_action.rb
|
143
147
|
- lib/rubocop/cop/chef/deprecation/windows_version_helpers.rb
|
144
148
|
- lib/rubocop/cop/chef/deprecation/xml_ruby_recipe.rb
|
@@ -203,7 +207,7 @@ files:
|
|
203
207
|
- lib/rubocop/cop/chef/modernize/shell_out_helper.rb
|
204
208
|
- lib/rubocop/cop/chef/modernize/shellouts_to_chocolatey.rb
|
205
209
|
- lib/rubocop/cop/chef/modernize/simplify_apt_ppa_setup.rb
|
206
|
-
- lib/rubocop/cop/chef/modernize/
|
210
|
+
- lib/rubocop/cop/chef/modernize/sysctl_param_resource.rb
|
207
211
|
- lib/rubocop/cop/chef/modernize/unnecessary_mixlib_shellout_require.rb
|
208
212
|
- lib/rubocop/cop/chef/modernize/use_multipackage_installs.rb
|
209
213
|
- lib/rubocop/cop/chef/modernize/use_require_relative.rb
|