Add the remaining ones

This commit is contained in:
Douglas Eichelberger 2025-09-07 18:32:01 -07:00
parent 78bb0d7942
commit 556f71d7bb
No known key found for this signature in database
GPG Key ID: F90193CBD547EB81
6 changed files with 61 additions and 25 deletions

View File

@ -410,7 +410,7 @@ module Homebrew
bottle_tag, rebuild = if local_bottle_json
_, tag_string, rebuild_string = Utils::Bottles.extname_tag_rebuild(formula.local_bottle_path.to_s)
[T.must(tag_string).to_sym, rebuild_string.to_i]
[tag_string.to_sym, rebuild_string.to_i]
end
bottle_tag = if bottle_tag
@ -506,7 +506,7 @@ module Homebrew
tab.time = nil
tab.changed_files = changed_files.dup
if args.only_json_tab?
tab.changed_files.delete(Pathname.new(AbstractTab::FILENAME))
tab.changed_files&.delete(Pathname.new(AbstractTab::FILENAME))
tab.tabfile.unlink
else
tab.write
@ -861,7 +861,8 @@ module Homebrew
end
sig {
params(formula: Formula, formula_ast: Utils::AST::FormulaAST, bottle_hash: T::Hash[String, T.untyped])
params(formula: Formula, formula_ast: Utils::AST::FormulaAST,
bottle_hash: T::Hash[String, T.untyped])
.returns(T.nilable(T::Array[T::Hash[Symbol, T.any(String, Symbol)]]))
}
def old_checksums(formula, formula_ast, bottle_hash)

View File

@ -15,7 +15,7 @@ module OS
appdir: "~/.config/apps",
}.freeze, T::Hash[Symbol, String])
sig { returns(T::Hash[Symbol, String]) }
sig { returns(T::Hash[Symbol, T.any(LazyObject, String)]) }
def defaults
{
languages: LazyObject.new { Linux.languages },

View File

@ -1593,7 +1593,7 @@ on_request: installed_on_request?, options:)
keg = Keg.new(formula.prefix)
skip_linkage = formula.bottle_specification.skip_relocation?
keg.replace_placeholders_with_locations(tab.changed_files, skip_linkage:)
keg.replace_placeholders_with_locations(tab.changed_files&.map { Pathname(_1) }, skip_linkage:)
cellar = formula.bottle_specification.tag_to_cellar(Utils::Bottles.tag)
return if [:any, :any_skip_relocation].include?(cellar)

View File

@ -50,6 +50,24 @@ end
module T
module Types
class FixedArray < Base
def valid?(obj)
recursively_valid?(obj)
end
end
class FixedHash < Base
def valid?(obj)
recursively_valid?(obj)
end
end
class Intersection < Base
def valid?(obj)
recursively_valid?(obj)
end
end
class TypedArray < TypedEnumerable
# overrides Base
def valid?(obj)
@ -57,11 +75,47 @@ module T
end
end
class TypedEnumerable < Base
def valid?(obj)
recursively_valid?(obj)
end
end
class TypedEnumeratorChain < TypedEnumerable
def valid?(obj)
recursively_valid?(obj)
end
end
class TypedEnumeratorLazy < TypedEnumerable
def valid?(obj)
recursively_valid?(obj)
end
end
class TypedHash < TypedEnumerable
# overrides Base
def valid?(obj)
recursively_valid?(obj)
end
end
class TypedRange < TypedEnumerable
def valid?(obj)
recursively_valid?(obj)
end
end
class TypedSet < TypedEnumerable
def valid?(obj)
recursively_valid?(obj)
end
end
class Union < Base
def valid?(obj)
recursively_valid?(obj)
end
end
end
end

View File

@ -169,8 +169,7 @@ RSpec.describe Cask::Info, :cask do
cask = Cask::CaskLoader.load("local-transmission")
time = 1_720_189_863
tab = Cask::Tab.new("loaded_from_api" => true, "tabfile" => TEST_FIXTURE_DIR/"cask_receipt.json",
"time" => time)
tab = Cask::Tab.new(loaded_from_api: true, tabfile: TEST_FIXTURE_DIR/"cask_receipt.json", time:)
expect(cask).to receive(:installed?).and_return(true)
expect(cask).to receive(:caskroom_path).and_return(caskroom)
expect(cask).to receive(:installed_version).and_return("2.61")

View File

@ -25,24 +25,6 @@ end
require_relative "../standalone"
require_relative "../warnings"
module T
module Types
class TypedArray < TypedEnumerable
# overrides Base
def valid?(obj)
recursively_valid?(obj)
end
end
class TypedHash < TypedEnumerable
# overrides Base
def valid?(obj)
recursively_valid?(obj)
end
end
end
end
Warnings.ignore :parser_syntax do
require "rubocop"
end