diff --git a/Library/Homebrew/unpack_strategy/air.rb b/Library/Homebrew/unpack_strategy/air.rb index 1aeaa830dacc7b..64159954192959 100644 --- a/Library/Homebrew/unpack_strategy/air.rb +++ b/Library/Homebrew/unpack_strategy/air.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,13 +11,15 @@ def self.extensions [".air"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) mime_type = "application/vnd.adobe.air-application-installer-package+zip" path.magic_number.match?(/.{59}#{Regexp.escape(mime_type)}/) end + sig { returns(T.nilable(T::Array[Cask::Cask])) } def dependencies - @dependencies ||= [Cask::CaskLoader.load("adobe-air")] + @dependencies ||= T.let([Cask::CaskLoader.load("adobe-air")], T.nilable(T::Array[Cask::Cask])) end AIR_APPLICATION_INSTALLER = diff --git a/Library/Homebrew/unpack_strategy/bazaar.rb b/Library/Homebrew/unpack_strategy/bazaar.rb index b952ba206d06f8..770cca92aad864 100644 --- a/Library/Homebrew/unpack_strategy/bazaar.rb +++ b/Library/Homebrew/unpack_strategy/bazaar.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "directory" @@ -6,8 +6,9 @@ module UnpackStrategy # Strategy for unpacking Bazaar archives. class Bazaar < Directory + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) - super && (path/".bzr").directory? + !!(super && (path/".bzr").directory?) end private diff --git a/Library/Homebrew/unpack_strategy/bzip2.rb b/Library/Homebrew/unpack_strategy/bzip2.rb index 6225b9338816cc..12190c6a6995df 100644 --- a/Library/Homebrew/unpack_strategy/bzip2.rb +++ b/Library/Homebrew/unpack_strategy/bzip2.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,6 +11,7 @@ def self.extensions [".bz2"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\ABZh/n) end diff --git a/Library/Homebrew/unpack_strategy/cab.rb b/Library/Homebrew/unpack_strategy/cab.rb index 388ceb425cc193..a4cc7993a6c06f 100644 --- a/Library/Homebrew/unpack_strategy/cab.rb +++ b/Library/Homebrew/unpack_strategy/cab.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,6 +11,7 @@ def self.extensions [".cab"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\AMSCF/n) end @@ -23,8 +24,9 @@ def extract_to_dir(unpack_dir, basename:, verbose:) verbose: end + sig { returns(T.nilable(T::Array[Formula])) } def dependencies - @dependencies ||= [Formula["cabextract"]] + @dependencies ||= T.let([Formula["cabextract"]], T.nilable(T::Array[Formula])) end end end diff --git a/Library/Homebrew/unpack_strategy/compress.rb b/Library/Homebrew/unpack_strategy/compress.rb index e2d6ce37f80526..504f31390bb0cf 100644 --- a/Library/Homebrew/unpack_strategy/compress.rb +++ b/Library/Homebrew/unpack_strategy/compress.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "tar" @@ -11,6 +11,7 @@ def self.extensions [".Z"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\A\037\235/n) end diff --git a/Library/Homebrew/unpack_strategy/cvs.rb b/Library/Homebrew/unpack_strategy/cvs.rb index af6f0a3a7755be..7e3c5b018b178c 100644 --- a/Library/Homebrew/unpack_strategy/cvs.rb +++ b/Library/Homebrew/unpack_strategy/cvs.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "directory" @@ -6,8 +6,9 @@ module UnpackStrategy # Strategy for unpacking CVS repositories. class Cvs < Directory + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) - super && (path/"CVS").directory? + !!(super && (path/"CVS").directory?) end end end diff --git a/Library/Homebrew/unpack_strategy/directory.rb b/Library/Homebrew/unpack_strategy/directory.rb index 50127031dadab9..62c76284bd0146 100644 --- a/Library/Homebrew/unpack_strategy/directory.rb +++ b/Library/Homebrew/unpack_strategy/directory.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,6 +11,7 @@ def self.extensions [] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.directory? end diff --git a/Library/Homebrew/unpack_strategy/executable.rb b/Library/Homebrew/unpack_strategy/executable.rb index 86c381ef1399f1..51cf812786e55c 100644 --- a/Library/Homebrew/unpack_strategy/executable.rb +++ b/Library/Homebrew/unpack_strategy/executable.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "uncompressed" @@ -11,6 +11,7 @@ def self.extensions [".sh", ".bash"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\A#!\s*\S+/n) || path.magic_number.match?(/\AMZ/n) diff --git a/Library/Homebrew/unpack_strategy/fossil.rb b/Library/Homebrew/unpack_strategy/fossil.rb index 8517d064f27edc..8914c05aa8a7fe 100644 --- a/Library/Homebrew/unpack_strategy/fossil.rb +++ b/Library/Homebrew/unpack_strategy/fossil.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require "system_command" @@ -14,6 +14,7 @@ def self.extensions [] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) return false unless path.magic_number.match?(/\ASQLite format 3\000/n) diff --git a/Library/Homebrew/unpack_strategy/generic_unar.rb b/Library/Homebrew/unpack_strategy/generic_unar.rb index 1e3075e9479457..45a036e6ff9c24 100644 --- a/Library/Homebrew/unpack_strategy/generic_unar.rb +++ b/Library/Homebrew/unpack_strategy/generic_unar.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,12 +11,14 @@ def self.extensions [] end + sig { override.params(_path: Pathname).returns(T::Boolean) } def self.can_extract?(_path) false end + sig { returns(T.nilable(T::Array[Formula]))} def dependencies - @dependencies ||= [Formula["unar"]] + @dependencies ||= T.let([Formula["unar"]], T.nilable(T::Array[Formula])) end private diff --git a/Library/Homebrew/unpack_strategy/git.rb b/Library/Homebrew/unpack_strategy/git.rb index ab39f3c4e0cc54..42b906f125d6b0 100644 --- a/Library/Homebrew/unpack_strategy/git.rb +++ b/Library/Homebrew/unpack_strategy/git.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "directory" @@ -6,8 +6,9 @@ module UnpackStrategy # Strategy for unpacking Git repositories. class Git < Directory + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) - super && (path/".git").directory? + !!(super && (path/".git").directory?) end end end diff --git a/Library/Homebrew/unpack_strategy/gzip.rb b/Library/Homebrew/unpack_strategy/gzip.rb index 70ff74c56eff88..b525cc6d0b1f08 100644 --- a/Library/Homebrew/unpack_strategy/gzip.rb +++ b/Library/Homebrew/unpack_strategy/gzip.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,6 +11,7 @@ def self.extensions [".gz"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\A\037\213/n) end diff --git a/Library/Homebrew/unpack_strategy/jar.rb b/Library/Homebrew/unpack_strategy/jar.rb index 8082d8602ccc3f..0be166bbaaebe8 100644 --- a/Library/Homebrew/unpack_strategy/jar.rb +++ b/Library/Homebrew/unpack_strategy/jar.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "uncompressed" @@ -11,6 +11,7 @@ def self.extensions [".apk", ".jar"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) return false unless Zip.can_extract?(path) diff --git a/Library/Homebrew/unpack_strategy/lha.rb b/Library/Homebrew/unpack_strategy/lha.rb index ece0b4b8cca853..0fdb49ed55a5ae 100644 --- a/Library/Homebrew/unpack_strategy/lha.rb +++ b/Library/Homebrew/unpack_strategy/lha.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,12 +11,14 @@ def self.extensions [".lha", ".lzh"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) 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])) } def dependencies - @dependencies ||= [Formula["lha"]] + @dependencies ||= T.let([Formula["lha"]], T.nilable(T::Array[Formula])) end private diff --git a/Library/Homebrew/unpack_strategy/lua_rock.rb b/Library/Homebrew/unpack_strategy/lua_rock.rb index b054b9f810270f..f806364a0f0461 100644 --- a/Library/Homebrew/unpack_strategy/lua_rock.rb +++ b/Library/Homebrew/unpack_strategy/lua_rock.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "uncompressed" @@ -11,6 +11,7 @@ def self.extensions [".rock"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) return false unless Zip.can_extract?(path) diff --git a/Library/Homebrew/unpack_strategy/lzip.rb b/Library/Homebrew/unpack_strategy/lzip.rb index 90150a40c6abe9..710f3684db1d59 100644 --- a/Library/Homebrew/unpack_strategy/lzip.rb +++ b/Library/Homebrew/unpack_strategy/lzip.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,12 +11,14 @@ def self.extensions [".lz"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\ALZIP/n) end + sig { returns(T.nilable(T::Array[Formula])) } def dependencies - @dependencies ||= [Formula["lzip"]] + @dependencies ||= T.let([Formula["lzip"]], T.nilable(T::Array[Formula])) end private diff --git a/Library/Homebrew/unpack_strategy/lzma.rb b/Library/Homebrew/unpack_strategy/lzma.rb index 5b6ed1c4e8496a..d1b6710c42e54d 100644 --- a/Library/Homebrew/unpack_strategy/lzma.rb +++ b/Library/Homebrew/unpack_strategy/lzma.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,12 +11,14 @@ def self.extensions [".lzma"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\A\]\000\000\200\000/n) end + sig { returns(T.nilable(T::Array[Formula])) } def dependencies - @dependencies ||= [Formula["xz"]] + @dependencies ||= T.let([Formula["xz"]], T.nilable(T::Array[Formula])) end private diff --git a/Library/Homebrew/unpack_strategy/mercurial.rb b/Library/Homebrew/unpack_strategy/mercurial.rb index c4a77d4d0df0fc..146f686c9c0a63 100644 --- a/Library/Homebrew/unpack_strategy/mercurial.rb +++ b/Library/Homebrew/unpack_strategy/mercurial.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "directory" @@ -6,12 +6,14 @@ module UnpackStrategy # Strategy for unpacking Mercurial repositories. class Mercurial < Directory + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) - super && (path/".hg").directory? + !!(super && (path/".hg").directory?) end private + sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void } def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "hg", args: ["--cwd", path, "archive", "--subrepos", "-y", "-t", "files", unpack_dir], diff --git a/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb b/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb index dfc4c084f40cb9..cb54b9b1f7235f 100644 --- a/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb +++ b/Library/Homebrew/unpack_strategy/microsoft_office_xml.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "uncompressed" @@ -15,6 +15,7 @@ def self.extensions ] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) return false unless Zip.can_extract?(path) diff --git a/Library/Homebrew/unpack_strategy/otf.rb b/Library/Homebrew/unpack_strategy/otf.rb index b4839b2a616fed..da593812a56394 100644 --- a/Library/Homebrew/unpack_strategy/otf.rb +++ b/Library/Homebrew/unpack_strategy/otf.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "uncompressed" @@ -11,6 +11,7 @@ def self.extensions [".otf"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\AOTTO/n) end diff --git a/Library/Homebrew/unpack_strategy/p7zip.rb b/Library/Homebrew/unpack_strategy/p7zip.rb index 69e2c9deab50c5..44a8c4b9865446 100644 --- a/Library/Homebrew/unpack_strategy/p7zip.rb +++ b/Library/Homebrew/unpack_strategy/p7zip.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,12 +11,14 @@ def self.extensions [".7z"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\A7z\xBC\xAF\x27\x1C/n) end + sig { returns(T.nilable(T::Array[Formula])) } def dependencies - @dependencies ||= [Formula["p7zip"]] + @dependencies ||= T.let([Formula["p7zip"]], T.nilable(T::Array[Formula])) end private diff --git a/Library/Homebrew/unpack_strategy/pax.rb b/Library/Homebrew/unpack_strategy/pax.rb index bc5f89c15a1005..9cbc799c23f649 100644 --- a/Library/Homebrew/unpack_strategy/pax.rb +++ b/Library/Homebrew/unpack_strategy/pax.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,6 +11,7 @@ def self.extensions [".pax"] end + sig { override.params(_path: Pathname).returns(T::Boolean) } def self.can_extract?(_path) false end diff --git a/Library/Homebrew/unpack_strategy/pkg.rb b/Library/Homebrew/unpack_strategy/pkg.rb index e4b288b827dbb5..585edfbea95fde 100644 --- a/Library/Homebrew/unpack_strategy/pkg.rb +++ b/Library/Homebrew/unpack_strategy/pkg.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "uncompressed" @@ -11,6 +11,7 @@ def self.extensions [".pkg", ".mkpg"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.extname.match?(/\A.m?pkg\Z/) && (path.directory? || path.magic_number.match?(/\Axar!/n)) diff --git a/Library/Homebrew/unpack_strategy/rar.rb b/Library/Homebrew/unpack_strategy/rar.rb index 06394dbdf4ca9d..7d8109d654caea 100644 --- a/Library/Homebrew/unpack_strategy/rar.rb +++ b/Library/Homebrew/unpack_strategy/rar.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,12 +11,14 @@ def self.extensions [".rar"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\ARar!/n) end + sig { returns(T.nilable(T::Array[Formula])) } def dependencies - @dependencies ||= [Formula["libarchive"]] + @dependencies ||= T.let([Formula["libarchive"]], T.nilable(T::Array[Formula])) end private diff --git a/Library/Homebrew/unpack_strategy/self_extracting_executable.rb b/Library/Homebrew/unpack_strategy/self_extracting_executable.rb index 078ce77365c39f..58bad3be740575 100644 --- a/Library/Homebrew/unpack_strategy/self_extracting_executable.rb +++ b/Library/Homebrew/unpack_strategy/self_extracting_executable.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "generic_unar" @@ -11,6 +11,7 @@ def self.extensions [] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\AMZ/n) && path.file_type.include?("self-extracting archive") diff --git a/Library/Homebrew/unpack_strategy/sit.rb b/Library/Homebrew/unpack_strategy/sit.rb index 631c446297c28c..82c48e6d19ba25 100644 --- a/Library/Homebrew/unpack_strategy/sit.rb +++ b/Library/Homebrew/unpack_strategy/sit.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "generic_unar" @@ -11,6 +11,7 @@ def self.extensions [".sit"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\AStuffIt/n) end diff --git a/Library/Homebrew/unpack_strategy/subversion.rb b/Library/Homebrew/unpack_strategy/subversion.rb index 7ba74fa5e0f0bd..81c037d73e81d8 100644 --- a/Library/Homebrew/unpack_strategy/subversion.rb +++ b/Library/Homebrew/unpack_strategy/subversion.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "directory" @@ -6,12 +6,14 @@ module UnpackStrategy # Strategy for unpacking Subversion repositories. class Subversion < Directory + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) - super && (path/".svn").directory? + !!(super && (path/".svn").directory?) end private + sig { override.params(unpack_dir: Pathname, basename: Pathname, verbose: T::Boolean).void } def extract_to_dir(unpack_dir, basename:, verbose:) system_command! "svn", args: ["export", "--force", ".", unpack_dir], diff --git a/Library/Homebrew/unpack_strategy/tar.rb b/Library/Homebrew/unpack_strategy/tar.rb index adbf59def59d6c..ae3ff08cd233b1 100644 --- a/Library/Homebrew/unpack_strategy/tar.rb +++ b/Library/Homebrew/unpack_strategy/tar.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require "system_command" @@ -22,6 +22,7 @@ def self.extensions ] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) return true if path.magic_number.match?(/\A.{257}ustar/n) diff --git a/Library/Homebrew/unpack_strategy/ttf.rb b/Library/Homebrew/unpack_strategy/ttf.rb index 3c73a6801e5b70..c240f936792b66 100644 --- a/Library/Homebrew/unpack_strategy/ttf.rb +++ b/Library/Homebrew/unpack_strategy/ttf.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true require_relative "uncompressed" @@ -11,6 +11,7 @@ def self.extensions [".ttc", ".ttf"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) # TrueType Font path.magic_number.match?(/\A\000\001\000\000\000/n) || diff --git a/Library/Homebrew/unpack_strategy/xar.rb b/Library/Homebrew/unpack_strategy/xar.rb index 0d571fa5aceb9a..d6562f8d22f5f1 100644 --- a/Library/Homebrew/unpack_strategy/xar.rb +++ b/Library/Homebrew/unpack_strategy/xar.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,6 +11,7 @@ def self.extensions [".xar"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\Axar!/n) end diff --git a/Library/Homebrew/unpack_strategy/xz.rb b/Library/Homebrew/unpack_strategy/xz.rb index a9ffc96a659d34..2e155c687b114c 100644 --- a/Library/Homebrew/unpack_strategy/xz.rb +++ b/Library/Homebrew/unpack_strategy/xz.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,12 +11,14 @@ def self.extensions [".xz"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\A\xFD7zXZ\x00/n) end + sig { returns(T.nilable(T::Array[Formula])) } def dependencies - @dependencies ||= [Formula["xz"]] + @dependencies ||= T.let([Formula["xz"]], T.nilable(T::Array[Formula])) end private diff --git a/Library/Homebrew/unpack_strategy/zip.rb b/Library/Homebrew/unpack_strategy/zip.rb index 59da683f35621d..28e413e00adad8 100644 --- a/Library/Homebrew/unpack_strategy/zip.rb +++ b/Library/Homebrew/unpack_strategy/zip.rb @@ -23,6 +23,7 @@ def self.can_extract?(path) .returns(SystemCommand::Result) } def extract_to_dir(unpack_dir, basename:, verbose:) + odebug "in unpack_strategy, zip, extract_to_dir, verbose: #{verbose.inspect}" unzip = if which("unzip").blank? begin Formula["unzip"] diff --git a/Library/Homebrew/unpack_strategy/zstd.rb b/Library/Homebrew/unpack_strategy/zstd.rb index 3dfa808f3478d1..475b0ca518e490 100644 --- a/Library/Homebrew/unpack_strategy/zstd.rb +++ b/Library/Homebrew/unpack_strategy/zstd.rb @@ -1,4 +1,4 @@ -# typed: true +# typed: strict # frozen_string_literal: true module UnpackStrategy @@ -11,12 +11,14 @@ def self.extensions [".zst"] end + sig { override.params(path: Pathname).returns(T::Boolean) } def self.can_extract?(path) path.magic_number.match?(/\x28\xB5\x2F\xFD/n) end + sig { returns(T.nilable(T::Array[Formula])) } def dependencies - @dependencies ||= [Formula["zstd"]] + @dependencies ||= T.let([Formula["zstd"]], T.nilable(T::Array[Formula])) end private