From bd9c436d50c71eef58b3f9ba511e701cf27b377c Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Tue, 27 Sep 2022 00:36:33 -0400 Subject: [PATCH] Remove unnecessary parameter from method A boolean `resource` parameter was added to `#print_latest_version` but its only purpose is to identify whether `info` corresponds to a resource. This can be achieved using `info[:resource].present?`, so this additional parameter isn't necessary and can be removed. --- Library/Homebrew/livecheck/livecheck.rb | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index 722297ddbb..086b4cfcd8 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -472,9 +472,9 @@ module Homebrew end # Formats and prints the livecheck result for a formula/cask/resource. - sig { params(info: Hash, verbose: T::Boolean, ambiguous_cask: T::Boolean, resource: T::Boolean).void } - def print_latest_version(info, verbose: false, ambiguous_cask: false, resource: false) - package_or_resource_s = resource ? " " : "" + sig { params(info: Hash, verbose: T::Boolean, ambiguous_cask: T::Boolean).void } + def print_latest_version(info, verbose: false, ambiguous_cask: false) + package_or_resource_s = info[:resource].present? ? " " : "" package_or_resource_s += "#{Tty.blue}#{info[:formula] || info[:cask] || info[:resource]}#{Tty.reset}" package_or_resource_s += " (cask)" if ambiguous_cask package_or_resource_s += " (guessed)" if verbose && !info[:meta][:livecheckable] @@ -501,11 +501,7 @@ module Homebrew if r_info[:status] && r_info[:messages] SkipConditions.print_skip_information(r_info) else - print_latest_version( - r_info, - verbose: verbose, - resource: true, - ) + print_latest_version(r_info, verbose: verbose) end end end