Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Library/Homebrew/dev-cmd/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class VersionBumpInfo < T::Struct
switch "--auto",
description: "Read the list of formulae/casks from the tap autobump list.",
hidden: true
switch "--no-auto",
description: "Ignore formulae/casks in autobump list (official repositories only)."
Comment thread
botantony marked this conversation as resolved.
Outdated
switch "--formula", "--formulae",
description: "Check only formulae."
switch "--cask", "--casks",
Expand All @@ -54,6 +56,7 @@ class VersionBumpInfo < T::Struct

conflicts "--cask", "--formula"
conflicts "--tap=", "--installed"
conflicts "--tap=", "--no-auto"
conflicts "--eval-all", "--installed"
conflicts "--installed", "--auto"
conflicts "--no-pull-requests", "--open-pr"
Expand All @@ -68,6 +71,16 @@ def run
Homebrew.with_no_api_env do
eval_all = args.eval_all? || Homebrew::EnvConfig.eval_all?

excluded_autobump = []
if args.no_auto?
if eval_all || args.formula?
excluded_autobump.concat autobumped_formulae_or_casks Tap.fetch("homebrew/core")
Comment thread
botantony marked this conversation as resolved.
Outdated
end
if eval_all || args.cask?
excluded_autobump.concat autobumped_formulae_or_casks Tap.fetch("homebrew/cask"), casks: true
Comment thread
botantony marked this conversation as resolved.
Outdated
end
end

formulae_and_casks = if args.auto?
raise UsageError, "`--formula` or `--cask` must be passed with `--auto`." if !args.formula? && !args.cask?

Expand Down Expand Up @@ -119,6 +132,8 @@ def run
formula_or_cask.respond_to?(:token) ? formula_or_cask.token : formula_or_cask.name
end

formulae_and_casks.delete_if { |f_or_c| excluded_autobump.include?(f_or_c) }
Comment thread
botantony marked this conversation as resolved.
Outdated

if args.repology? && !Utils::Curl.curl_supports_tls13?
begin
ensure_formula_installed!("curl", reason: "Repology queries") unless HOMEBREW_BREWED_CURL_PATH.exist?
Expand Down Expand Up @@ -541,6 +556,17 @@ def synced_with(formula, new_version)

synced_with
end

sig { params(tap: Tap, casks: T::Boolean).returns(T::Array[T.any(Formula, Cask::Cask)]) }
def autobumped_formulae_or_casks(tap, casks: false)
autobump_list = tap.autobump
autobump_list.map do |name|
qualified_name = "#{tap.name}/#{name}"
next Cask::CaskLoader.load(qualified_name) if casks

Formulary.factory(qualified_name)
end
Comment thread
botantony marked this conversation as resolved.
end
end
end
end
6 changes: 6 additions & 0 deletions Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/bump.rbi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.