mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Make some of the bundle
commands Sorbet typed: true
- The last remaining one is `exec` but that's a bit more involved (https://github.com/Homebrew/brew/pull/20128#discussion_r2156781591).
This commit is contained in:
parent
09eaf1495a
commit
68596ec720
@ -1,4 +1,4 @@
|
|||||||
# typed: false # rubocop:todo Sorbet/TrueSigil
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "json"
|
require "json"
|
||||||
@ -189,7 +189,12 @@ module Homebrew
|
|||||||
|
|
||||||
class Topo < Hash
|
class Topo < Hash
|
||||||
include TSort
|
include TSort
|
||||||
|
|
||||||
|
def each_key(&block)
|
||||||
|
keys.each(&block)
|
||||||
|
end
|
||||||
alias tsort_each_node each_key
|
alias tsort_each_node each_key
|
||||||
|
|
||||||
def tsort_each_child(node, &block)
|
def tsort_each_child(node, &block)
|
||||||
fetch(node.downcase).sort.each(&block)
|
fetch(node.downcase).sort.each(&block)
|
||||||
end
|
end
|
||||||
@ -230,8 +235,8 @@ module Homebrew
|
|||||||
|
|
||||||
odie <<~EOS
|
odie <<~EOS
|
||||||
Formulae dependency graph sorting failed (likely due to a circular dependency):
|
Formulae dependency graph sorting failed (likely due to a circular dependency):
|
||||||
#{cycle_first}: #{topo[cycle_first]}
|
#{cycle_first}: #{topo[cycle_first] if topo}
|
||||||
#{cycle_last}: #{topo[cycle_last]}
|
#{cycle_last}: #{topo[cycle_last] if topo}
|
||||||
Please run the following commands and try again:
|
Please run the following commands and try again:
|
||||||
brew update
|
brew update
|
||||||
brew uninstall --ignore-dependencies --force #{cycle_first} #{cycle_last}
|
brew uninstall --ignore-dependencies --force #{cycle_first} #{cycle_last}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# typed: false # rubocop:todo Sorbet/TrueSigil
|
# typed: true
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
@ -23,7 +23,7 @@ module Homebrew
|
|||||||
else
|
else
|
||||||
"needs to be installed or updated."
|
"needs to be installed or updated."
|
||||||
end
|
end
|
||||||
"#{self.class::PACKAGE_TYPE_NAME} #{name} #{reason}"
|
"#{self.class.const_get(:PACKAGE_TYPE_NAME)} #{name} #{reason}"
|
||||||
end
|
end
|
||||||
|
|
||||||
def full_check(packages, no_upgrade:)
|
def full_check(packages, no_upgrade:)
|
||||||
@ -33,7 +33,7 @@ module Homebrew
|
|||||||
|
|
||||||
def checkable_entries(all_entries)
|
def checkable_entries(all_entries)
|
||||||
require "bundle/skipper"
|
require "bundle/skipper"
|
||||||
all_entries.select { |e| e.type == self.class::PACKAGE_TYPE }
|
all_entries.select { |e| e.type == self.class.const_get(:PACKAGE_TYPE) }
|
||||||
.reject(&Bundle::Skipper.method(:skip?))
|
.reject(&Bundle::Skipper.method(:skip?))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
# typed: true
|
||||||
|
|
||||||
|
module Homebrew::Bundle::BrewDumper
|
||||||
|
include Kernel
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user