From 69ce5edd14f740ccd663c2ade0dd3511b3504c9e Mon Sep 17 00:00:00 2001 From: Carlo Cabrera Date: Thu, 10 Jul 2025 20:25:17 +0800 Subject: [PATCH] formulary: improve style Co-authored-by: Mike McQuaid --- Library/Homebrew/formulary.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index ac24daddd1..3c1f83d0be 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -139,11 +139,12 @@ module Formulary raise new_exception, "", e.backtrace end ensure - printed_to_stdout = $stdout.string.strip - if printed_to_stdout.present? + # TODO: Make printing to stdout an error so that we can print a tap name. + # See discussion at https://github.com/Homebrew/brew/pull/20226#discussion_r2195886888 + if (printed_to_stdout = $stdout.string.strip.presence) opoo <<~WARNING Formula #{name} attempted to print the following while being loaded: - #{$stdout.string.strip} + #{printed_to_stdout} WARNING end $stdout = old_stdout