From 3f976ec0c2f6c69e16e9b3429a4164a2b3b789ea Mon Sep 17 00:00:00 2001 From: Issy Long Date: Sun, 22 Dec 2024 00:14:28 +0000 Subject: [PATCH] dev-cmd/livecheck: Skip autobumped formulae - Skip formulae that are autobumped by BrewTestBot, to avoid useless effort spent by contributors who are checking for formulae to bump and then we close their PRs. --- Library/Homebrew/dev-cmd/livecheck.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index b811ad4fe6..3670c00602 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -14,7 +14,7 @@ module Homebrew Check for newer versions of formulae and/or casks from upstream. If no formula or cask argument is passed, the list of formulae and casks to check is taken from `HOMEBREW_LIVECHECK_WATCHLIST` or - `~/.homebrew/livecheck_watchlist.txt`. + `~/.homebrew/livecheck_watchlist.txt`, excluding autobumped formulae. EOS switch "--full-name", description: "Print formulae and casks with fully-qualified names." @@ -90,6 +90,19 @@ module Homebrew end end + # Skip formulae that are autobumped by BrewTestBot. + formulae_and_casks_to_check = formulae_and_casks_to_check.reject do |formula_or_cask| + next false if formula_or_cask.respond_to?(:token) # Only formulae are autobumped. + + autobump_file = formula_or_cask.tap.path/".github/autobump.txt" + next false unless File.exist?(autobump_file) + + if File.read(autobump_file).include?(formula_or_cask.name) + odebug "Skipping #{formula_or_cask.name} as it is autobumped." + true + 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