mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #18984 from Homebrew/livecheck-skip-autobumped-formulae
dev-cmd/livecheck: Skip autobumped formulae
This commit is contained in:
commit
683f85f4b0
@ -38,6 +38,8 @@ module Homebrew
|
||||
description: "Only check casks."
|
||||
switch "--extract-plist",
|
||||
description: "Enable checking multiple casks with ExtractPlist strategy."
|
||||
switch "--autobump",
|
||||
description: "Include packages that are autobumped by BrewTestBot. By default these are skipped."
|
||||
|
||||
conflicts "--debug", "--json"
|
||||
conflicts "--tap=", "--eval-all", "--installed"
|
||||
@ -90,6 +92,26 @@ module Homebrew
|
||||
end
|
||||
end
|
||||
|
||||
if skip_autobump?
|
||||
autobump_lists = {}
|
||||
|
||||
formulae_and_casks_to_check = formulae_and_casks_to_check.reject do |formula_or_cask|
|
||||
tap = formula_or_cask.tap
|
||||
next false if tap.nil?
|
||||
|
||||
autobump_lists[tap] ||= begin
|
||||
autobump_path = tap.path/".github/autobump.txt"
|
||||
autobump_path.exist? ? autobump_path.readlines.map(&:strip) : []
|
||||
end
|
||||
|
||||
name = formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name
|
||||
if autobump_lists[tap].include?(name)
|
||||
odebug "Skipping #{name} as it is autobumped in #{tap}."
|
||||
true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
formulae_and_casks_to_check = formulae_and_casks_to_check.sort_by do |formula_or_cask|
|
||||
formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name
|
||||
end
|
||||
@ -117,6 +139,11 @@ module Homebrew
|
||||
def watchlist_path
|
||||
@watchlist_path ||= T.let(File.expand_path(Homebrew::EnvConfig.livecheck_watchlist), T.nilable(String))
|
||||
end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def skip_autobump?
|
||||
!(args.autobump? || Homebrew::EnvConfig.livecheck_autobump?)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -296,6 +296,10 @@ module Homebrew
|
||||
default_text: 'The "Beer Mug" emoji.',
|
||||
default: "🍺",
|
||||
},
|
||||
HOMEBREW_LIVECHECK_AUTOBUMP: {
|
||||
description: "If set, `brew livecheck` will include data for packages that are autobumped by BrewTestBot.",
|
||||
boolean: true,
|
||||
},
|
||||
HOMEBREW_LIVECHECK_WATCHLIST: {
|
||||
description: "Consult this file for the list of formulae to check by default when no formula argument " \
|
||||
"is passed to `brew livecheck`.",
|
||||
|
@ -4,13 +4,15 @@
|
||||
# This is an autogenerated file for dynamic methods in `Homebrew::DevCmd::LivecheckCmd`.
|
||||
# Please instead update this file by running `bin/tapioca dsl Homebrew::DevCmd::LivecheckCmd`.
|
||||
|
||||
|
||||
class Homebrew::DevCmd::LivecheckCmd
|
||||
sig { returns(Homebrew::DevCmd::LivecheckCmd::Args) }
|
||||
def args; end
|
||||
end
|
||||
|
||||
class Homebrew::DevCmd::LivecheckCmd::Args < Homebrew::CLI::Args
|
||||
sig { returns(T::Boolean) }
|
||||
def autobump?; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def cask?; end
|
||||
|
||||
|
@ -196,6 +196,9 @@ module Homebrew::EnvConfig
|
||||
sig { returns(String) }
|
||||
def livecheck_watchlist; end
|
||||
|
||||
sig { returns(T::Boolean) }
|
||||
def livecheck_autobump?; end
|
||||
|
||||
sig { returns(T.nilable(::String)) }
|
||||
def lock_context; end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user