From 2400c6daed704b97725e10ad1bde7f85ceea9240 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Thu, 23 Feb 2023 12:23:44 -0800 Subject: [PATCH] brew style --fix --- Library/Homebrew/cask/cmd/upgrade.rb | 3 ++- Library/Homebrew/cleanup.rb | 3 ++- Library/Homebrew/cli/parser.rb | 9 ++++++--- Library/Homebrew/livecheck/strategy/electron_builder.rb | 3 ++- Library/Homebrew/livecheck/strategy/extract_plist.rb | 8 ++++++-- Library/Homebrew/livecheck/strategy/sparkle.rb | 3 ++- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index e805a6914b..1dc312d08b 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -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 = [] diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 377a63c035..57e5d3ef27 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -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 diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index 86db8e223a..f3ec536c0c 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -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 diff --git a/Library/Homebrew/livecheck/strategy/electron_builder.rb b/Library/Homebrew/livecheck/strategy/electron_builder.rb index 29ea5d1c2d..542c00742d 100644 --- a/Library/Homebrew/livecheck/strategy/electron_builder.rb +++ b/Library/Homebrew/livecheck/strategy/electron_builder.rb @@ -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 } diff --git a/Library/Homebrew/livecheck/strategy/extract_plist.rb b/Library/Homebrew/livecheck/strategy/extract_plist.rb index cde31a43c8..db7565dca6 100644 --- a/Library/Homebrew/livecheck/strategy/extract_plist.rb +++ b/Library/Homebrew/livecheck/strategy/extract_plist.rb @@ -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 } diff --git a/Library/Homebrew/livecheck/strategy/sparkle.rb b/Library/Homebrew/livecheck/strategy/sparkle.rb index bba267b1e0..36685c15d4 100644 --- a/Library/Homebrew/livecheck/strategy/sparkle.rb +++ b/Library/Homebrew/livecheck/strategy/sparkle.rb @@ -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 }