From 683065136a17da8c9c5cada986edb0f67402bee4 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 4 Jun 2025 14:53:56 +0200 Subject: [PATCH] Rename Naming/PredicateName to PreficatePrefix RuboCop 1.76 changed the name of this cop and it needs to be reflected. --- .rubocop.yml | 2 +- lib/puppet/feature/base.rb | 2 +- lib/puppet/functions/defined.rb | 2 +- lib/puppet/parameter.rb | 4 ++-- lib/puppet/property.rb | 2 +- lib/puppet/property/keyvalue.rb | 2 +- lib/puppet/property/list.rb | 2 +- lib/puppet/provider.rb | 6 +++--- lib/puppet/type/file/group.rb | 2 +- lib/puppet/type/file/mode.rb | 2 +- lib/puppet/type/file/owner.rb | 2 +- lib/puppet/type/group.rb | 2 +- lib/puppet/type/package.rb | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 365df776fa..ef2df87b4c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -161,7 +161,7 @@ Naming/MethodName: Naming/MethodParameterName: Enabled: false -Naming/PredicateName: +Naming/PredicatePrefix: ForbiddenPrefixes: [] Naming/RescuedExceptionsVariableName: diff --git a/lib/puppet/feature/base.rb b/lib/puppet/feature/base.rb index b7efedb291..9dbb8d0395 100644 --- a/lib/puppet/feature/base.rb +++ b/lib/puppet/feature/base.rb @@ -58,7 +58,7 @@ module WindowsSymlink require 'ffi' extend FFI::Library - def self.is_implemented # rubocop:disable Naming/PredicateName + def self.is_implemented # rubocop:disable Naming/PredicatePrefix ffi_lib :kernel32 attach_function :CreateSymbolicLinkW, [:lpwstr, :lpwstr, :dword], :boolean diff --git a/lib/puppet/functions/defined.rb b/lib/puppet/functions/defined.rb index a06ed50b71..05b7e1dec8 100644 --- a/lib/puppet/functions/defined.rb +++ b/lib/puppet/functions/defined.rb @@ -107,7 +107,7 @@ required_repeated_param 'Variant[String, Type[CatalogEntry], Type[Type[CatalogEntry]]]', :vals end - def is_defined(scope, *vals) # rubocop:disable Naming/PredicateName + def is_defined(scope, *vals) # rubocop:disable Naming/PredicatePrefix vals.any? do |val| case val when String diff --git a/lib/puppet/parameter.rb b/lib/puppet/parameter.rb index be72e8024a..32ed1477be 100644 --- a/lib/puppet/parameter.rb +++ b/lib/puppet/parameter.rb @@ -93,7 +93,7 @@ def defaultto(value = nil, &block) end end - # rubocop:disable Naming/PredicateName + # rubocop:disable Naming/PredicatePrefix def sensitive(value = nil, &block) if block define_method(:is_sensitive, &block) @@ -101,7 +101,7 @@ def sensitive(value = nil, &block) define_method(:is_sensitive) do value end end end - # rubocop:enable Naming/PredicateName + # rubocop:enable Naming/PredicatePrefix # Produces a documentation string. # If an enumeration of _valid values_ has been defined, it is appended to the documentation diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb index 29bd3cbd9a..757fffa5ff 100644 --- a/lib/puppet/property.rb +++ b/lib/puppet/property.rb @@ -403,7 +403,7 @@ def property_matches?(current, desired) # are not already in suitable form. # @param value [Object] the value to format as a string # @return [String] a pretty printing string - def is_to_s(value) # rubocop:disable Naming/PredicateName + def is_to_s(value) # rubocop:disable Naming/PredicatePrefix self.class.format_value_for_display(value) end diff --git a/lib/puppet/property/keyvalue.rb b/lib/puppet/property/keyvalue.rb index 28933aae67..d3a20a9fe9 100644 --- a/lib/puppet/property/keyvalue.rb +++ b/lib/puppet/property/keyvalue.rb @@ -34,7 +34,7 @@ def should_to_s(should_value) hash_to_key_value_s(should_value) end - def is_to_s(current_value) # rubocop:disable Naming/PredicateName + def is_to_s(current_value) # rubocop:disable Naming/PredicatePrefix hash_to_key_value_s(current_value) end diff --git a/lib/puppet/property/list.rb b/lib/puppet/property/list.rb index ded51d0bb0..031f2d47df 100644 --- a/lib/puppet/property/list.rb +++ b/lib/puppet/property/list.rb @@ -8,7 +8,7 @@ class Property # For an ordered list see {Puppet::Property::OrderedList}. # class List < Property - def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName + def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix currentvalue == :absent ? super(currentvalue) : currentvalue.join(delimiter) end diff --git a/lib/puppet/provider.rb b/lib/puppet/provider.rb index a0996576f5..b4aedb02ce 100644 --- a/lib/puppet/provider.rb +++ b/lib/puppet/provider.rb @@ -199,7 +199,7 @@ def self.optional_commands(hash) # @note the name ´has_command´ looks odd in an API context, but makes more sense when seen in the internal # DSL context where a Provider is declaratively defined. # @api public - # rubocop:disable Naming/PredicateName + # rubocop:disable Naming/PredicatePrefix def self.has_command(name, path, &block) name = name.intern command = CommandDefiner.define(name, path, self, &block) @@ -211,7 +211,7 @@ def self.has_command(name, path, &block) return command.execute(*args) end end - # rubocop:enable Naming/PredicateName + # rubocop:enable Naming/PredicatePrefix # Internal helper class when creating commands - undocumented. # @api private @@ -232,7 +232,7 @@ def initialize(name, path, confiner) @custom_environment = {} end - def is_optional # rubocop:disable Naming/PredicateName + def is_optional # rubocop:disable Naming/PredicatePrefix @optional = true end diff --git a/lib/puppet/type/file/group.rb b/lib/puppet/type/file/group.rb index 1c67d9bcb7..7462d32f3d 100644 --- a/lib/puppet/type/file/group.rb +++ b/lib/puppet/type/file/group.rb @@ -39,7 +39,7 @@ def insync?(current) end # We want to print names, not numbers - def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName + def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix super(provider.gid2name(currentvalue) || currentvalue) end diff --git a/lib/puppet/type/file/mode.rb b/lib/puppet/type/file/mode.rb index d2283c2476..f29eb8eb4e 100644 --- a/lib/puppet/type/file/mode.rb +++ b/lib/puppet/type/file/mode.rb @@ -179,7 +179,7 @@ def should_to_s(should_value) "'#{should_value.rjust(4, '0')}'" end - def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName + def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix if currentvalue == :absent # This can occur during audits---if a file is transitioning from # present to absent the mode will have a value of `:absent`. diff --git a/lib/puppet/type/file/owner.rb b/lib/puppet/type/file/owner.rb index b186d22e8f..ed0ef0ab1b 100644 --- a/lib/puppet/type/file/owner.rb +++ b/lib/puppet/type/file/owner.rb @@ -41,7 +41,7 @@ def insync?(current) end # We want to print names, not numbers - def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName + def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix super(provider.uid2name(currentvalue) || currentvalue) end diff --git a/lib/puppet/type/group.rb b/lib/puppet/type/group.rb index f5bc369633..c354b306c5 100644 --- a/lib/puppet/type/group.rb +++ b/lib/puppet/type/group.rb @@ -102,7 +102,7 @@ def insync?(current) super(current) end - def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName + def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix if provider.respond_to?(:members_to_s) currentvalue = '' if currentvalue.nil? currentvalue = currentvalue.is_a?(Array) ? currentvalue : currentvalue.split(',') diff --git a/lib/puppet/type/package.rb b/lib/puppet/type/package.rb index 4cc6c73034..0b3773a2e2 100644 --- a/lib/puppet/type/package.rb +++ b/lib/puppet/type/package.rb @@ -396,7 +396,7 @@ def should_to_s(newvalue) end end - def is_to_s(currentvalue) # rubocop:disable Naming/PredicateName + def is_to_s(currentvalue) # rubocop:disable Naming/PredicatePrefix if provider.respond_to?(:package_settings_is_to_s) provider.package_settings_is_to_s(should, currentvalue) else