bump: respect livecheck skipped status

`brew bump` understands that some formulae/casks are skipped by
livecheck but it doesn't use this information to avoid doing
unnecessary or inappropriate work. This modifies related logic to not
fetch PR information or try to open a version bump PR if livecheck is
skipped. livecheck is our only source of version information these
days, so we can't try to version bump a package if we don't have
upstream version information.

This has been leading to an "Invalid usage: `--version` must not be
empty" error and this _should_ fix the issue under these particular
circumstances. There's still plenty of room for improvement in how
all of this is handled in bump but this is just a quick bug fix.
This commit is contained in:
Sam Ford 2025-08-25 10:07:17 -04:00
parent dd7e3e0142
commit 1d47038b12
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -382,6 +382,7 @@ module Homebrew
if !args.no_pull_requests? && if !args.no_pull_requests? &&
(new_version.general != "unable to get versions") && (new_version.general != "unable to get versions") &&
(new_version.general != "skipped") &&
(new_version != current_version) (new_version != current_version)
# We use the ARM version for the pull request version. This is # We use the ARM version for the pull request version. This is
# consistent with the behavior of bump-cask-pr. # consistent with the behavior of bump-cask-pr.
@ -480,6 +481,7 @@ module Homebrew
end end
if !args.no_pull_requests? && if !args.no_pull_requests? &&
(new_version.general != "unable to get versions") && (new_version.general != "unable to get versions") &&
(new_version.general != "skipped") &&
!versions_equal !versions_equal
if duplicate_pull_requests if duplicate_pull_requests
duplicate_pull_requests_text = duplicate_pull_requests duplicate_pull_requests_text = duplicate_pull_requests
@ -497,7 +499,11 @@ module Homebrew
end end
end end
return unless args.open_pr? if !args.open_pr? ||
(new_version.general == "unable to get versions") ||
(new_version.general == "skipped")
return
end
if GitHub.too_many_open_prs?(formula_or_cask.tap) if GitHub.too_many_open_prs?(formula_or_cask.tap)
odie "You have too many PRs open: close or merge some first!" odie "You have too many PRs open: close or merge some first!"