From 6235a7f1af84c87985c7940a6567091111be3bb4 Mon Sep 17 00:00:00 2001 From: Eric Knibbe Date: Wed, 13 Sep 2023 17:59:11 -0400 Subject: [PATCH 1/2] dev-cmd/bump: omit PR lines with --no-pull-requests --- Library/Homebrew/dev-cmd/bump.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index 84b01affc4770..8aefe39f1b454 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -436,6 +436,8 @@ def retrieve_and_display_info_and_open_pr(formula_or_cask, name, repositories, a Current #{version_label} #{current_versions} Latest livecheck version: #{new_versions} Latest Repology version: #{repology_latest} + EOS + puts <<~EOS unless args.no_pull_requests? Open pull requests: #{open_pull_requests || "none"} Closed pull requests: #{closed_pull_requests || "none"} EOS From 7c707216a23de3e2be5e0ad0927e9b0c183a7da4 Mon Sep 17 00:00:00 2001 From: Eric Knibbe Date: Wed, 13 Sep 2023 18:02:12 -0400 Subject: [PATCH 2/2] dev-cmd/bump: skip head-only & disabled formulae --- Library/Homebrew/dev-cmd/bump.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/dev-cmd/bump.rb b/Library/Homebrew/dev-cmd/bump.rb index 8aefe39f1b454..736f163441c02 100644 --- a/Library/Homebrew/dev-cmd/bump.rb +++ b/Library/Homebrew/dev-cmd/bump.rb @@ -126,10 +126,7 @@ def handle_formula_and_casks(formulae_and_casks, args) use_full_name = args.full_name? || ambiguous_names.include?(formula_or_cask) name = Livecheck.package_or_resource_name(formula_or_cask, full_name: use_full_name) repository = if formula_or_cask.is_a?(Formula) - if formula_or_cask.head_only? - puts "Formula is HEAD-only." - next - end + next if skip_ineligible_formulae(formula_or_cask) Repology::HOMEBREW_CORE else @@ -201,6 +198,8 @@ def handle_api_response(args) end puts if i.positive? + next if formula_or_cask.is_a?(Formula) && skip_ineligible_formulae(formula_or_cask) + retrieve_and_display_info_and_open_pr( formula_or_cask, name, @@ -212,6 +211,17 @@ def handle_api_response(args) end end + sig { + params(formula: Formula).returns(T::Boolean) + } + def skip_ineligible_formulae(formula) + return false if !formula.disabled? && !formula.head_only? + + ohai formula.name + puts "Formula is #{formula.disabled? ? "disabled" : "HEAD-only"}.\n" + true + end + sig { params(formula_or_cask: T.any(Formula, Cask::Cask)).returns(T.any(Version, String)) }