brew style --fix

This commit is contained in:
Douglas Eichelberger 2023-02-23 12:23:44 -08:00
parent d62211d3af
commit 2400c6daed
6 changed files with 20 additions and 9 deletions

View File

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

View File

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

View File

@ -684,7 +684,8 @@ module Homebrew
arg_types = types.map { |type| type.to_s.tr("_", " ") }
.to_sentence two_words_connector: " or ", last_word_connector: " or "
"This command does not take more than #{maximum} #{arg_types} #{Utils::Inflection.pluralize("argument", maximum)}."
"This command does not take more than #{maximum} #{arg_types} #{Utils::Inflection.pluralize("argument",
maximum)}."
end
end
end
@ -698,7 +699,8 @@ module Homebrew
arg_types = types.map { |type| type.to_s.tr("_", " ") }
.to_sentence two_words_connector: " or ", last_word_connector: " or "
super "This command requires at least #{minimum} #{arg_types} #{Utils::Inflection.pluralize("argument", minimum)}."
super "This command requires at least #{minimum} #{arg_types} #{Utils::Inflection.pluralize("argument",
minimum)}."
end
end
@ -711,7 +713,8 @@ module Homebrew
arg_types = types.map { |type| type.to_s.tr("_", " ") }
.to_sentence two_words_connector: " or ", last_word_connector: " or "
super "This command requires exactly #{minimum} #{arg_types} #{Utils::Inflection.pluralize("argument", minimum)}."
super "This command requires exactly #{minimum} #{arg_types} #{Utils::Inflection.pluralize("argument",
minimum)}."
end
end
end

View File

@ -73,7 +73,8 @@ module Homebrew
}
def self.find_versions(url:, regex: nil, **_unused, &block)
if regex.present? && block.blank?
raise ArgumentError, "#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
raise ArgumentError,
"#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
end
match_data = { matches: {}, regex: regex, url: url }

View File

@ -97,9 +97,13 @@ module Homebrew
}
def self.find_versions(cask:, url: nil, regex: nil, **_unused, &block)
if regex.present? && block.blank?
raise ArgumentError, "#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
raise ArgumentError,
"#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
end
unless T.unsafe(cask)
raise ArgumentError,
"The #{Utils::Inflection.demodulize(T.must(name))} strategy only supports casks."
end
raise ArgumentError, "The #{Utils::Inflection.demodulize(T.must(name))} strategy only supports casks." unless T.unsafe(cask)
match_data = { matches: {}, regex: regex, url: url }

View File

@ -203,7 +203,8 @@ module Homebrew
}
def self.find_versions(url:, regex: nil, **_unused, &block)
if regex.present? && block.blank?
raise ArgumentError, "#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
raise ArgumentError,
"#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
end
match_data = { matches: {}, regex: regex, url: url }