diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index 7f0d0f2cac..1d012384ac 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -330,6 +330,8 @@ module Cask # @api internal def to_s = token + # @!visibility private + sig { returns(String) } def inspect "#" end diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 9133c6fa8f..e13fc42647 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -68,6 +68,8 @@ class CompilerFailure type == compiler.type && version_matched end + # @!visibility private + sig { returns(String) } def inspect "#<#{self.class.name}: #{type} #{version}>" end diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb index a87523c472..1745e51c0e 100644 --- a/Library/Homebrew/cxxstdlib.rb +++ b/Library/Homebrew/cxxstdlib.rb @@ -22,6 +22,7 @@ class CxxStdlib type.to_s.gsub(/cxx$/, "c++") end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{compiler} #{type}>" diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index 1e69bfecdf..d59dde9a90 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -37,6 +37,7 @@ class Dependencies < SimpleDelegator self.class.new(*__getobj__.reject { |dep| dep.uses_from_macos? && dep.use_macos_install? }) end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{__getobj__}>" @@ -65,6 +66,7 @@ class Requirements < SimpleDelegator self end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: {#{__getobj__.to_a.join(", ")}}>" diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb index b11d2cff0a..95cf6747fb 100644 --- a/Library/Homebrew/dependency.rb +++ b/Library/Homebrew/dependency.rb @@ -96,6 +96,7 @@ class Dependency false end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{name.inspect} #{tags.inspect}>" @@ -279,6 +280,7 @@ class UsesFromMacOSDependency < Dependency self.class.new(formula.full_name.to_s, tags, bounds:) end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{name.inspect} #{tags.inspect} #{bounds.inspect}>" diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 0f087c7a48..fbf97f2640 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1735,7 +1735,7 @@ class Formula name end - # @private + # @!visibility private sig { returns(String) } def inspect "#" diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 5c77bb8a96..f89b9a7efa 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -177,6 +177,7 @@ class Keg alias to_path to_s + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}:#{path}>" diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb index 17ff40168d..0cd7b69c22 100644 --- a/Library/Homebrew/options.rb +++ b/Library/Homebrew/options.rb @@ -32,6 +32,7 @@ class Option name.hash end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{flag.inspect}>" @@ -144,6 +145,7 @@ class Options @options.map(&:to_s).join(" ") end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{to_a.inspect}>" diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index 971f6c6dca..8b5afc10f9 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -55,6 +55,7 @@ class EmbeddedPatch Utils.safe_popen_write("patch", *args) { |p| p.write(data) } end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{strip.inspect}>" @@ -160,6 +161,7 @@ class ExternalPatch raise BuildError.new(f, cmd, args, ENV.to_hash) end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{strip.inspect} #{url.inspect}>" diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index 3e0c5ffff3..7a5413826b 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -142,6 +142,7 @@ class Requirement [self.class, name, tags].hash end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: #{tags.inspect}>" diff --git a/Library/Homebrew/requirements/arch_requirement.rb b/Library/Homebrew/requirements/arch_requirement.rb index 17ce1c2701..3b2fc1f2d6 100644 --- a/Library/Homebrew/requirements/arch_requirement.rb +++ b/Library/Homebrew/requirements/arch_requirement.rb @@ -29,6 +29,8 @@ class ArchRequirement < Requirement "The #{@arch} architecture is required for this software." end + # @!visibility private + sig { returns(String) } def inspect "#<#{self.class.name}: arch=#{@arch.to_s.inspect} #{tags.inspect}>" end diff --git a/Library/Homebrew/requirements/macos_requirement.rb b/Library/Homebrew/requirements/macos_requirement.rb index b58a3ce50d..9a55b79362 100644 --- a/Library/Homebrew/requirements/macos_requirement.rb +++ b/Library/Homebrew/requirements/macos_requirement.rb @@ -98,6 +98,7 @@ class MacOSRequirement < Requirement [super, comparator, version].hash end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: version#{@comparator}#{@version.to_s.inspect} #{tags.inspect}>" diff --git a/Library/Homebrew/requirements/xcode_requirement.rb b/Library/Homebrew/requirements/xcode_requirement.rb index 097d0d3e07..abc74e088c 100644 --- a/Library/Homebrew/requirements/xcode_requirement.rb +++ b/Library/Homebrew/requirements/xcode_requirement.rb @@ -50,6 +50,7 @@ class XcodeRequirement < Requirement end end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name}: version>=#{@version.inspect} #{tags.inspect}>" diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index d1b531b9ad..79c678345a 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -59,6 +59,7 @@ class Version sig { abstract.params(other: T.untyped).returns(T.nilable(Integer)) } def <=>(other); end + # @!visibility private sig { returns(String) } def inspect "#<#{self.class.name} #{value.inspect}>" @@ -133,7 +134,8 @@ class Version sig { returns(T::Boolean) } def blank? = true - sig { override.returns(String) } + # @!visibility private + sig { returns(String) } def inspect "#<#{self.class.name}>" end @@ -726,6 +728,7 @@ class Version super end + # @!visibility private sig { returns(String) } def inspect return "#" if null?