Style cleanup

This commit is contained in:
Douglas Eichelberger 2024-03-19 12:36:30 -07:00
parent 0373e0dc29
commit 6b19bc5535
4 changed files with 11 additions and 12 deletions

View File

@ -28,7 +28,7 @@ module Homebrew
if cmd if cmd
cmd.parser cmd.parser
else else
# TODO: remove once all commands inherit AbstractCommand # FIXME: remove once commands are all subclasses of `AbstractCommand`:
Homebrew.send(cmd_args_method_name) Homebrew.send(cmd_args_method_name)
end end
end end

View File

@ -226,9 +226,8 @@ module Homebrew
audit_proc = proc { FormulaAuditor.new(Formulary.factory(path), **options).tap(&:audit) } audit_proc = proc { FormulaAuditor.new(Formulary.factory(path), **options).tap(&:audit) }
# Audit requires full Ruby source so disable API. # Audit requires full Ruby source so disable API. We shouldn't do this for taps however so that we
# We shouldn't do this for taps however so that we don't unnecessarily require a full Homebrew/core # don't unnecessarily require a full Homebrew/core clone.
# clone.
fa = if f.core_formula? fa = if f.core_formula?
Homebrew.with_no_api_env(&audit_proc) Homebrew.with_no_api_env(&audit_proc)
else else
@ -308,8 +307,8 @@ module Homebrew
errors_summary += " detected" errors_summary += " detected"
if corrected_problem_count.positive? if corrected_problem_count.positive?
errors_summary += ", #{Utils.pluralize("problem", corrected_problem_count, errors_summary +=
include_count: true)} corrected" ", #{Utils.pluralize("problem", corrected_problem_count, include_count: true)} corrected"
end end
ofail "#{errors_summary}." ofail "#{errors_summary}."

View File

@ -397,8 +397,8 @@ module Homebrew
tab_json = Utils::Bottles.file_from_bottle(bottle_path, tab_path) tab_json = Utils::Bottles.file_from_bottle(bottle_path, tab_path)
tab = Tab.from_file_content(tab_json, tab_path) tab = Tab.from_file_content(tab_json, tab_path)
tag_spec = Formula[formula.name].bottle_specification.tag_specification_for(bottle_tag, tag_spec = Formula[formula.name].bottle_specification
no_older_versions: true) .tag_specification_for(bottle_tag, no_older_versions: true)
relocatable = [:any, :any_skip_relocation].include?(tag_spec.cellar) relocatable = [:any, :any_skip_relocation].include?(tag_spec.cellar)
skip_relocation = tag_spec.cellar == :any_skip_relocation skip_relocation = tag_spec.cellar == :any_skip_relocation
@ -818,8 +818,8 @@ module Homebrew
return if bottle_node.nil? return if bottle_node.nil?
return [] unless args.keep_old? return [] unless args.keep_old?
old_keys = T.cast(Utils::AST.body_children(bottle_node.body), old_keys = T.cast(Utils::AST.body_children(bottle_node.body), T::Array[RuboCop::AST::SendNode])
T::Array[RuboCop::AST::SendNode]).map(&:method_name) .map(&:method_name)
old_bottle_spec = formula.bottle_specification old_bottle_spec = formula.bottle_specification
mismatches, checksums = merge_bottle_spec(old_keys, old_bottle_spec, bottle_hash["bottle"]) mismatches, checksums = merge_bottle_spec(old_keys, old_bottle_spec, bottle_hash["bottle"])
if mismatches.present? if mismatches.present?

View File

@ -75,8 +75,8 @@ module Homebrew
"#{Utils.pluralize("time", type_count, include_count: true)} (#{type})" "#{Utils.pluralize("time", type_count, include_count: true)} (#{type})"
end end
contributions << "#{Utils.pluralize("time", grand_totals[username].values.sum, contributions <<
include_count: true)} (total)" "#{Utils.pluralize("time", grand_totals[username].values.sum, include_count: true)} (total)"
puts [ puts [
"#{username} contributed", "#{username} contributed",