From 6b19bc5535d6373e0278e608204eeed0c6ae5090 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Tue, 19 Mar 2024 12:36:30 -0700 Subject: [PATCH] Style cleanup --- Library/Homebrew/cli/parser.rb | 2 +- Library/Homebrew/dev-cmd/audit.rb | 9 ++++----- Library/Homebrew/dev-cmd/bottle.rb | 8 ++++---- Library/Homebrew/dev-cmd/contributions.rb | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index c6edbc617d..d475d6d418 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -28,7 +28,7 @@ module Homebrew if cmd cmd.parser else - # TODO: remove once all commands inherit AbstractCommand + # FIXME: remove once commands are all subclasses of `AbstractCommand`: Homebrew.send(cmd_args_method_name) end end diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index a2ddbbcd8d..6e29e4fa37 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -226,9 +226,8 @@ module Homebrew audit_proc = proc { FormulaAuditor.new(Formulary.factory(path), **options).tap(&:audit) } - # Audit requires full Ruby source so disable API. - # We shouldn't do this for taps however so that we don't unnecessarily require a full Homebrew/core - # clone. + # Audit requires full Ruby source so disable API. We shouldn't do this for taps however so that we + # don't unnecessarily require a full Homebrew/core clone. fa = if f.core_formula? Homebrew.with_no_api_env(&audit_proc) else @@ -308,8 +307,8 @@ module Homebrew errors_summary += " detected" if corrected_problem_count.positive? - errors_summary += ", #{Utils.pluralize("problem", corrected_problem_count, - include_count: true)} corrected" + errors_summary += + ", #{Utils.pluralize("problem", corrected_problem_count, include_count: true)} corrected" end ofail "#{errors_summary}." diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb index 288f058a76..c8632b8417 100644 --- a/Library/Homebrew/dev-cmd/bottle.rb +++ b/Library/Homebrew/dev-cmd/bottle.rb @@ -397,8 +397,8 @@ module Homebrew tab_json = Utils::Bottles.file_from_bottle(bottle_path, tab_path) tab = Tab.from_file_content(tab_json, tab_path) - tag_spec = Formula[formula.name].bottle_specification.tag_specification_for(bottle_tag, - no_older_versions: true) + tag_spec = Formula[formula.name].bottle_specification + .tag_specification_for(bottle_tag, no_older_versions: true) relocatable = [:any, :any_skip_relocation].include?(tag_spec.cellar) skip_relocation = tag_spec.cellar == :any_skip_relocation @@ -818,8 +818,8 @@ module Homebrew return if bottle_node.nil? return [] unless args.keep_old? - old_keys = T.cast(Utils::AST.body_children(bottle_node.body), - T::Array[RuboCop::AST::SendNode]).map(&:method_name) + old_keys = T.cast(Utils::AST.body_children(bottle_node.body), T::Array[RuboCop::AST::SendNode]) + .map(&:method_name) old_bottle_spec = formula.bottle_specification mismatches, checksums = merge_bottle_spec(old_keys, old_bottle_spec, bottle_hash["bottle"]) if mismatches.present? diff --git a/Library/Homebrew/dev-cmd/contributions.rb b/Library/Homebrew/dev-cmd/contributions.rb index 5ec518eb7a..22fd4fdad6 100644 --- a/Library/Homebrew/dev-cmd/contributions.rb +++ b/Library/Homebrew/dev-cmd/contributions.rb @@ -75,8 +75,8 @@ module Homebrew "#{Utils.pluralize("time", type_count, include_count: true)} (#{type})" end - contributions << "#{Utils.pluralize("time", grand_totals[username].values.sum, - include_count: true)} (total)" + contributions << + "#{Utils.pluralize("time", grand_totals[username].values.sum, include_count: true)} (total)" puts [ "#{username} contributed",