Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove space before colon in livecheck output #13201

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/livecheck/livecheck.rb
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def print_latest_version(info, verbose:, ambiguous_cask: false)
info[:version][:latest]
end

puts "#{formula_or_cask_s} : #{current_s} ==> #{latest_s}"
puts "#{formula_or_cask_s}: #{current_s} ==> #{latest_s}"
end

sig {
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/livecheck/skip_conditions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ def print_skip_information(skip_hash)
if skip_hash[:messages].is_a?(Array) && skip_hash[:messages].count.positive?
# TODO: Handle multiple messages, only if needed in the future
if skip_hash[:status] == "skipped"
puts "#{Tty.red}#{name}#{Tty.reset} : skipped - #{skip_hash[:messages][0]}"
puts "#{Tty.red}#{name}#{Tty.reset}: skipped - #{skip_hash[:messages][0]}"
else
puts "#{Tty.red}#{name}#{Tty.reset} : #{skip_hash[:messages][0]}"
puts "#{Tty.red}#{name}#{Tty.reset}: #{skip_hash[:messages][0]}"
end
elsif skip_hash[:status].present?
puts "#{Tty.red}#{name}#{Tty.reset} : #{skip_hash[:status]}"
puts "#{Tty.red}#{name}#{Tty.reset}: #{skip_hash[:status]}"
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/dev-cmd/livecheck_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
setup_test_formula("test", content)

expect { brew "livecheck", "test" }
.to output(/test : /).to_stdout
.to output(/test: /).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
Expand Down
28 changes: 14 additions & 14 deletions Library/Homebrew/test/livecheck/skip_conditions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -470,103 +470,103 @@
context "when a formula without a livecheckable is deprecated" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:formula][:deprecated]) }
.to output("test_deprecated : deprecated\n").to_stdout
.to output("test_deprecated: deprecated\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when a formula without a livecheckable is disabled" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:formula][:disabled]) }
.to output("test_disabled : disabled\n").to_stdout
.to output("test_disabled: disabled\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when a formula without a livecheckable is versioned" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:formula][:versioned]) }
.to output("test@0.0.1 : versioned\n").to_stdout
.to output("test@0.0.1: versioned\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when a formula is HEAD-only and not installed" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:formula][:head_only]) }
.to output("test_head_only : HEAD only formula must be installed to be livecheckable\n").to_stdout
.to output("test_head_only: HEAD only formula must be installed to be livecheckable\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when a formula has a GitHub Gist stable URL" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:formula][:gist]) }
.to output("test_gist : skipped - Stable URL is a GitHub Gist\n").to_stdout
.to output("test_gist: skipped - Stable URL is a GitHub Gist\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when a formula has a Google Code Archive stable URL" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:formula][:google_code_archive]) }
.to output("test_google_code_archive : skipped - Stable URL is from Google Code Archive\n").to_stdout
.to output("test_google_code_archive: skipped - Stable URL is from Google Code Archive\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when a formula has an Internet Archive stable URL" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:formula][:internet_archive]) }
.to output("test_internet_archive : skipped - Stable URL is from Internet Archive\n").to_stdout
.to output("test_internet_archive: skipped - Stable URL is from Internet Archive\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when a formula has a `livecheck` block containing `skip`" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:formula][:skip]) }
.to output("test_skip : skipped\n").to_stdout
.to output("test_skip: skipped\n").to_stdout
.and not_to_output.to_stderr

expect { skip_conditions.print_skip_information(status_hashes[:formula][:skip_with_message]) }
.to output("test_skip_with_message : skipped - Not maintained\n").to_stdout
.to output("test_skip_with_message: skipped - Not maintained\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when the cask is discontinued without a livecheckable" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:cask][:discontinued]) }
.to output("test_discontinued : discontinued\n").to_stdout
.to output("test_discontinued: discontinued\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when the cask has `version :latest` without a livecheckable" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:cask][:latest]) }
.to output("test_latest : latest\n").to_stdout
.to output("test_latest: latest\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when the cask has an unversioned URL without a livecheckable" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:cask][:unversioned]) }
.to output("test_unversioned : unversioned\n").to_stdout
.to output("test_unversioned: unversioned\n").to_stdout
.and not_to_output.to_stderr
end
end

context "when the cask has a `livecheck` block containing `skip`" do
it "prints skip information" do
expect { skip_conditions.print_skip_information(status_hashes[:cask][:skip]) }
.to output("test_skip : skipped\n").to_stdout
.to output("test_skip: skipped\n").to_stdout
.and not_to_output.to_stderr

expect { skip_conditions.print_skip_information(status_hashes[:cask][:skip_with_message]) }
.to output("test_skip_with_message : skipped - Not maintained\n").to_stdout
.to output("test_skip_with_message: skipped - Not maintained\n").to_stdout
.and not_to_output.to_stderr
end
end
Expand Down