From 6918160fd944f89c4c19ff63329c3a15c6e5dead Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Sun, 28 Jul 2024 10:12:18 -0400 Subject: [PATCH] UnpackStrategy: Make #dependencies non-nilable `T.nilable` was removed from the `P7Zip#dependencies` type signature in a previous commit, as `UnpackStrategy#dependencies` doesn't allow for a nilable return type. This updates the type signature for the other `#dependencies` methods to also remove `T.nilable`, as they would produce a runtime error otherwise. --- Library/Homebrew/unpack_strategy/air.rb | 2 +- Library/Homebrew/unpack_strategy/cab.rb | 2 +- Library/Homebrew/unpack_strategy/generic_unar.rb | 2 +- Library/Homebrew/unpack_strategy/lha.rb | 2 +- Library/Homebrew/unpack_strategy/lzip.rb | 2 +- Library/Homebrew/unpack_strategy/lzma.rb | 2 +- Library/Homebrew/unpack_strategy/rar.rb | 2 +- Library/Homebrew/unpack_strategy/xz.rb | 2 +- Library/Homebrew/unpack_strategy/zstd.rb | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/unpack_strategy/air.rb b/Library/Homebrew/unpack_strategy/air.rb index 6415995419..371fc29ae8 100644 --- a/Library/Homebrew/unpack_strategy/air.rb +++ b/Library/Homebrew/unpack_strategy/air.rb @@ -17,7 +17,7 @@ module UnpackStrategy path.magic_number.match?(/.{59}#{Regexp.escape(mime_type)}/) end - sig { returns(T.nilable(T::Array[Cask::Cask])) } + sig { returns(T::Array[Cask::Cask]) } def dependencies @dependencies ||= T.let([Cask::CaskLoader.load("adobe-air")], T.nilable(T::Array[Cask::Cask])) end diff --git a/Library/Homebrew/unpack_strategy/cab.rb b/Library/Homebrew/unpack_strategy/cab.rb index a4cc7993a6..c9427f86fc 100644 --- a/Library/Homebrew/unpack_strategy/cab.rb +++ b/Library/Homebrew/unpack_strategy/cab.rb @@ -24,7 +24,7 @@ module UnpackStrategy verbose: end - sig { returns(T.nilable(T::Array[Formula])) } + sig { returns(T::Array[Formula]) } def dependencies @dependencies ||= T.let([Formula["cabextract"]], T.nilable(T::Array[Formula])) end diff --git a/Library/Homebrew/unpack_strategy/generic_unar.rb b/Library/Homebrew/unpack_strategy/generic_unar.rb index ecc6e2c256..d5ef55bf61 100644 --- a/Library/Homebrew/unpack_strategy/generic_unar.rb +++ b/Library/Homebrew/unpack_strategy/generic_unar.rb @@ -16,7 +16,7 @@ module UnpackStrategy false end - sig { returns(T.nilable(T::Array[Formula])) } + sig { returns(T::Array[Formula]) } def dependencies @dependencies ||= T.let([Formula["unar"]], T.nilable(T::Array[Formula])) end diff --git a/Library/Homebrew/unpack_strategy/lha.rb b/Library/Homebrew/unpack_strategy/lha.rb index 0fdb49ed55..c20f7e6521 100644 --- a/Library/Homebrew/unpack_strategy/lha.rb +++ b/Library/Homebrew/unpack_strategy/lha.rb @@ -16,7 +16,7 @@ module UnpackStrategy path.magic_number.match?(/\A..-(lh0|lh1|lz4|lz5|lzs|lh\\40|lhd|lh2|lh3|lh4|lh5)-/n) end - sig { returns(T.nilable(T::Array[Formula])) } + sig { returns(T::Array[Formula]) } def dependencies @dependencies ||= T.let([Formula["lha"]], T.nilable(T::Array[Formula])) end diff --git a/Library/Homebrew/unpack_strategy/lzip.rb b/Library/Homebrew/unpack_strategy/lzip.rb index 710f3684db..732897a922 100644 --- a/Library/Homebrew/unpack_strategy/lzip.rb +++ b/Library/Homebrew/unpack_strategy/lzip.rb @@ -16,7 +16,7 @@ module UnpackStrategy path.magic_number.match?(/\ALZIP/n) end - sig { returns(T.nilable(T::Array[Formula])) } + sig { returns(T::Array[Formula]) } def dependencies @dependencies ||= T.let([Formula["lzip"]], T.nilable(T::Array[Formula])) end diff --git a/Library/Homebrew/unpack_strategy/lzma.rb b/Library/Homebrew/unpack_strategy/lzma.rb index d1b6710c42..a4ff75ac0b 100644 --- a/Library/Homebrew/unpack_strategy/lzma.rb +++ b/Library/Homebrew/unpack_strategy/lzma.rb @@ -16,7 +16,7 @@ module UnpackStrategy path.magic_number.match?(/\A\]\000\000\200\000/n) end - sig { returns(T.nilable(T::Array[Formula])) } + sig { returns(T::Array[Formula]) } def dependencies @dependencies ||= T.let([Formula["xz"]], T.nilable(T::Array[Formula])) end diff --git a/Library/Homebrew/unpack_strategy/rar.rb b/Library/Homebrew/unpack_strategy/rar.rb index 7d8109d654..8336d99b08 100644 --- a/Library/Homebrew/unpack_strategy/rar.rb +++ b/Library/Homebrew/unpack_strategy/rar.rb @@ -16,7 +16,7 @@ module UnpackStrategy path.magic_number.match?(/\ARar!/n) end - sig { returns(T.nilable(T::Array[Formula])) } + sig { returns(T::Array[Formula]) } def dependencies @dependencies ||= T.let([Formula["libarchive"]], T.nilable(T::Array[Formula])) end diff --git a/Library/Homebrew/unpack_strategy/xz.rb b/Library/Homebrew/unpack_strategy/xz.rb index 2e155c687b..55b6d289de 100644 --- a/Library/Homebrew/unpack_strategy/xz.rb +++ b/Library/Homebrew/unpack_strategy/xz.rb @@ -16,7 +16,7 @@ module UnpackStrategy path.magic_number.match?(/\A\xFD7zXZ\x00/n) end - sig { returns(T.nilable(T::Array[Formula])) } + sig { returns(T::Array[Formula]) } def dependencies @dependencies ||= T.let([Formula["xz"]], T.nilable(T::Array[Formula])) end diff --git a/Library/Homebrew/unpack_strategy/zstd.rb b/Library/Homebrew/unpack_strategy/zstd.rb index 475b0ca518..38a3328f32 100644 --- a/Library/Homebrew/unpack_strategy/zstd.rb +++ b/Library/Homebrew/unpack_strategy/zstd.rb @@ -16,7 +16,7 @@ module UnpackStrategy path.magic_number.match?(/\x28\xB5\x2F\xFD/n) end - sig { returns(T.nilable(T::Array[Formula])) } + sig { returns(T::Array[Formula]) } def dependencies @dependencies ||= T.let([Formula["zstd"]], T.nilable(T::Array[Formula])) end