Fix style/type violations

This commit is contained in:
Douglas Eichelberger 2023-02-27 20:34:07 -08:00
parent 82dad857a8
commit 1ab278f74c
9 changed files with 15 additions and 15 deletions

View File

@ -143,7 +143,7 @@ module Cask
verb = dry_run ? "Would upgrade" : "Upgrading"
oh1 "#{verb} #{outdated_casks.count} outdated #{::Utils.pluralize("package",
outdated_casks.count)}:"
outdated_casks.count)}:"
caught_exceptions = []

View File

@ -585,7 +585,7 @@ module Homebrew
verb = dry_run ? "Would autoremove" : "Autoremoving"
oh1 "#{verb} #{formulae_names.count} unneeded #{Utils.pluralize("formula", formulae_names.count,
plural: "e")}:"
plural: "e")}:"
puts formulae_names.join("\n")
return if dry_run

View File

@ -685,7 +685,7 @@ module Homebrew
.to_sentence two_words_connector: " or ", last_word_connector: " or "
"This command does not take more than #{maximum} #{arg_types} #{Utils.pluralize("argument",
maximum)}."
maximum)}."
end
end
end
@ -700,7 +700,7 @@ module Homebrew
.to_sentence two_words_connector: " or ", last_word_connector: " or "
super "This command requires at least #{minimum} #{arg_types} #{Utils.pluralize("argument",
minimum)}."
minimum)}."
end
end
@ -714,7 +714,7 @@ module Homebrew
.to_sentence two_words_connector: " or ", last_word_connector: " or "
super "This command requires exactly #{minimum} #{arg_types} #{Utils.pluralize("argument",
minimum)}."
minimum)}."
end
end
end

View File

@ -40,8 +40,8 @@ module Homebrew
case args.named.first
when nil, "state"
if env_vars.any?
puts "Developer mode is enabled because #{env_vars.to_sentence} #{Utils.pluralize("",
env_vars.count, plural: "are", singular: "is")} set."
verb = Utils.pluralize("", env_vars.count, plural: "are", singular: "is")
puts "Developer mode is enabled because #{env_vars.to_sentence} #{verb} set."
elsif Homebrew::Settings.read("devcmdrun") == "true"
puts "Developer mode is enabled."
else

View File

@ -200,7 +200,7 @@ module Homebrew
unless updated_taps.empty?
auto_update_header args: args
puts "Updated #{updated_taps.count} #{Utils.pluralize("tap",
updated_taps.count)} (#{updated_taps.to_sentence})."
updated_taps.count)} (#{updated_taps.to_sentence})."
updated = true
end
@ -612,13 +612,13 @@ class ReporterHub
if outdated_formulae.positive?
msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{Utils.pluralize("formula",
outdated_formulae, plural: "e")}"
outdated_formulae, plural: "e")}"
end
if outdated_casks.positive?
msg += " and " if msg.present?
msg += "#{Tty.bold}#{outdated_casks}#{Tty.reset} outdated #{Utils.pluralize("cask",
outdated_casks)}"
outdated_casks)}"
end
return if msg.blank?

View File

@ -181,7 +181,7 @@ module Homebrew
else
verb = args.dry_run? ? "Would upgrade" : "Upgrading"
oh1 "#{verb} #{formulae_to_install.count} outdated #{Utils.pluralize("package",
formulae_to_install.count)}:"
formulae_to_install.count)}:"
formulae_upgrades = formulae_to_install.map do |f|
if f.optlinked?
"#{f.full_specified_name} #{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}"

View File

@ -282,7 +282,7 @@ module Homebrew
error_sources = []
if formula_count.positive?
error_sources << "#{formula_count} #{Utils.pluralize("formula", formula_count,
plural: "e")}"
plural: "e")}"
end
error_sources << "#{cask_count} #{Utils.pluralize("cask", cask_count)}" if cask_count.positive?
error_sources << "#{tap_count} #{Utils.pluralize("tap", tap_count)}" if tap_count.positive?
@ -293,7 +293,7 @@ module Homebrew
if corrected_problem_count.positive?
errors_summary += ", #{corrected_problem_count} #{Utils.pluralize("problem",
corrected_problem_count)} corrected"
corrected_problem_count)} corrected"
end
ofail errors_summary

View File

@ -100,7 +100,7 @@ module Homebrew
).returns(T::Hash[Symbol, T.untyped])
}
def self.find_versions(url:, regex: nil, provided_content: nil, homebrew_curl: false, **_unused, &block)
raise ArgumentError, "#{T.must(name).demodulize} requires a `strategy` block" if block.blank?
raise ArgumentError, "#{Utils.demodulize(T.must(name))} requires a `strategy` block" if block.blank?
match_data = { matches: {}, regex: regex, url: url }
return match_data if url.blank? || block.blank?

View File

@ -137,7 +137,7 @@ module Homebrew
def are_required_by_deps
"#{Utils.pluralize("", reqs.count, plural: "are",
singular: "is")} required by #{deps.to_sentence}, " \
singular: "is")} required by #{deps.to_sentence}, " \
"which #{Utils.pluralize("", deps.count, plural: "are", singular: "is")} currently installed"
end
end