Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev-cmd/bump: reduce unnecessary output #16004

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 16 additions & 4 deletions Library/Homebrew/dev-cmd/bump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@
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
Expand Down Expand Up @@ -201,6 +198,8 @@
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,
Expand All @@ -212,6 +211,17 @@
end
end

sig {
params(formula: Formula).returns(T::Boolean)

Check warning on line 215 in Library/Homebrew/dev-cmd/bump.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/bump.rb#L215

Added line #L215 was not covered by tests
}
def skip_ineligible_formulae(formula)
return false if !formula.disabled? && !formula.head_only?

ohai formula.name

Check warning on line 220 in Library/Homebrew/dev-cmd/bump.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/bump.rb#L220

Added line #L220 was not covered by tests
puts "Formula is #{formula.disabled? ? "disabled" : "HEAD-only"}.\n"
true

Check warning on line 222 in Library/Homebrew/dev-cmd/bump.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/dev-cmd/bump.rb#L222

Added line #L222 was not covered by tests
end

sig {
params(formula_or_cask: T.any(Formula, Cask::Cask)).returns(T.any(Version, String))
}
Expand Down Expand Up @@ -436,6 +446,8 @@
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
Expand Down