mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
brew style --fix
This commit is contained in:
parent
d62211d3af
commit
2400c6daed
@ -142,7 +142,8 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
verb = dry_run ? "Would upgrade" : "Upgrading"
|
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 = []
|
caught_exceptions = []
|
||||||
|
|
||||||
|
@ -584,7 +584,8 @@ module Homebrew
|
|||||||
formulae_names = removable_formulae.map(&:full_name).sort
|
formulae_names = removable_formulae.map(&:full_name).sort
|
||||||
|
|
||||||
verb = dry_run ? "Would autoremove" : "Autoremoving"
|
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")
|
puts formulae_names.join("\n")
|
||||||
return if dry_run
|
return if dry_run
|
||||||
|
|
||||||
|
@ -684,7 +684,8 @@ module Homebrew
|
|||||||
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
||||||
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
.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
|
end
|
||||||
end
|
end
|
||||||
@ -698,7 +699,8 @@ module Homebrew
|
|||||||
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
||||||
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
.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
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -711,7 +713,8 @@ module Homebrew
|
|||||||
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
||||||
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
.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
|
end
|
||||||
end
|
end
|
||||||
|
@ -73,7 +73,8 @@ module Homebrew
|
|||||||
}
|
}
|
||||||
def self.find_versions(url:, regex: nil, **_unused, &block)
|
def self.find_versions(url:, regex: nil, **_unused, &block)
|
||||||
if regex.present? && block.blank?
|
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
|
end
|
||||||
|
|
||||||
match_data = { matches: {}, regex: regex, url: url }
|
match_data = { matches: {}, regex: regex, url: url }
|
||||||
|
@ -97,9 +97,13 @@ module Homebrew
|
|||||||
}
|
}
|
||||||
def self.find_versions(cask:, url: nil, regex: nil, **_unused, &block)
|
def self.find_versions(cask:, url: nil, regex: nil, **_unused, &block)
|
||||||
if regex.present? && block.blank?
|
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
|
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 }
|
match_data = { matches: {}, regex: regex, url: url }
|
||||||
|
|
||||||
|
@ -203,7 +203,8 @@ module Homebrew
|
|||||||
}
|
}
|
||||||
def self.find_versions(url:, regex: nil, **_unused, &block)
|
def self.find_versions(url:, regex: nil, **_unused, &block)
|
||||||
if regex.present? && block.blank?
|
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
|
end
|
||||||
|
|
||||||
match_data = { matches: {}, regex: regex, url: url }
|
match_data = { matches: {}, regex: regex, url: url }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user