You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
brew doctor puts two blank lines between this warning and its remediation, so they don't look related:
Warning: Some installed kegs have no formulae!
This means they were either deleted or installed manually.
You should find replacements for the following formulae:
terraform
Finding#to_s already separates the two and this heredoc also ended in a blank line, so this removes it.
brew upgrade has the opposite problem, with a multi-line warning running straight into the next output:
Warning: You are using macOS 12.
We (and Apple) do not provide support for this old version.
Homebrew no longer builds bottles for this configuration.
Consider MacPorts, which provides binary packages for this macOS version:
https://www.macports.org
==> Would upgrade 1 dependency:
llvm 22.1.8 -> 23.1.5
Diagnostic.checks now prints a blank line after multi-line warnings, which also separates two in a row. One-line warnings stay as they are and this doesn't affect brew doctor, which prints its own findings. The exception is :build_error_checks, because commands that continue after a failed build print their own blank line. brew upgrade already did and brew install now does too, so the next formula's output no longer runs into a warning. Outside Tier 1 a failed brew install can now get two blank lines before the tier message, as brew upgrade already does.
To reproduce:
mkdir -p "$(brew --cellar)/removed-formula/1.0"
brew doctor check_deleted_formula
rmdir "$(brew --cellar)/removed-formula/1.0" "$(brew --cellar)/removed-formula"
brew install --dry-run hello # needs a multi-line warning, e.g. on macOS 12
Have you checked for other open Pull Requests for the same change?
Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
Have you explained why you'd like these changes included, not just what they do?
For bug fixes, have you given step-by-step brew commands to reproduce the bug?
Have you written new tests (excluding integration tests)? Here's an example.
Have you successfully run brew lgtm (style, typechecking and tests) locally?
I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.
Claude Code (Claude Opus 5.5) found the causes, wrote the changes and their specs and ran them. Each new spec was seen failing before the code it covers was added. It ran the brew doctor reproduction, brew install --dry-run hello and a failing two-formula brew install from a local tap in a terminal on macOS 12. It ran brew lgtm on the final branch, which passed.
- Print a blank line after them in `Diagnostic.checks` so they stand
apart from the output that follows
- Skip it for `:build_error_checks`, which end a failed build's output,
as the tier message that follows adds its own blank line
Multi-line diagnostic findings now have a blank line after non-build-error messages, making them easier to distinguish from surrounding output.
Failed-build diagnostics retain their existing spacing and do not gain an extra blank line after the message.
A blank line now separates a reported build error from its detailed error output.
Diagnostic checks adjust spacing after multi-line findings, and the deleted-formula finding text no longer includes an embedded blank line. Build-error handling prints a blank line before the error dump. Tests cover these output changes.
Changes: Diagnostic and build-error output
Layer / File(s)
Summary
Diagnostic finding text and spacing Library/Homebrew/diagnostic.rb, Library/Homebrew/test/diagnostic_spec.rb, Library/Homebrew/test/diagnostic_checks_spec.rb
Non-fatal checks add a blank line after multi-line findings, except for build-error checks. The deleted-formula finding text no longer includes an embedded blank line. Tests cover both spacing rules and the deleted-formula diagnostic content.
Build-error handling prints a blank line before dumping error details. A regression test checks the standard output.
Merge Risk: Low · up to 0de8b
A macOS source-build warning can gain an extra blank line; base the spacing check on warning text before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "diagnostic: fix spacing around warnings" matches the main change. The PR removes an extra blank line from a check_deleted_formula heredoc and adds a blank line after multi-line warnings in …
Description check
The description matches the changeset. It explains the two blank lines after the brew doctor warning, the missing separation after multi-line warnings in brew upgrade and brew install, the :build_erro…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "diagnostic: fix spacing around warnings" matches the main change. The PR removes an extra blank line from a check_deleted_formula heredoc and adds a blank line after multi-line warnings in Diagnostic.checks and install_formulae. The title is specific and short, and it names the affected area (diagnostic warnings), so it passes.
Full details: Description check
Explanation
The description matches the changeset. It explains the two blank lines after the brew doctor warning, the missing separation after multi-line warnings in brew upgrade and brew install, the :build_error_checks exception, and the reproduction steps. It describes the same files and behaviour as the raw summary, so it passes.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: b2933145-156d-4ca1-b52a-c17f571026df
Commits
Reviewing files that changed from the base of the PR and between 8b0b7e4 and 4c9f03f.
Files selected for processing: 3
Library/Homebrew/diagnostic.rb
Library/Homebrew/test/diagnostic_checks_spec.rb
Library/Homebrew/test/diagnostic_spec.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
- `Diagnostic.checks` adds no blank line after a failed build's checks,
so the next formula's output could run straight into a warning
- Match `brew upgrade`, which already prints one after `e.dump`
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
⚠️ Outside diff range comments (1)
Minor · Base the spacing check on the warning text. · diagnostic.rb:54
Library/Homebrew/diagnostic.rb:54 Minor · Functional Correctness · Quick win
Base the spacing check on the warning text.
During a macOS source build, check_clt_up_to_date can return one-line warning text with non-empty remediation. Finding#to_s then contains a newline from the remediation, so this predicate adds an extra stderr blank line. Check finding.text instead. This preserves the required separator after multi-line warning text without changing one-line warnings.
Suggested fix
- $stderr.puts if type != :build_error_checks && finding.to_s.include?("\n")+ $stderr.puts if type != :build_error_checks && finding.text.include?("\n")
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: b7949353-e9c2-4c59-a510-b616adf9af31
Commits
Reviewing files that changed from the base of the PR and between f40af3b and 0de8b93.
Files selected for processing: 3
Library/Homebrew/diagnostic.rb
Library/Homebrew/install.rb
Library/Homebrew/test/install_spec.rb
Files skipped from review as they are similar to previous changes: 1
Library/Homebrew/diagnostic.rb
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
brew doctorputs two blank lines between this warning and its remediation, so they don't look related:Finding#to_salready separates the two and this heredoc also ended in a blank line, so this removes it.brew upgradehas the opposite problem, with a multi-line warning running straight into the next output:Diagnostic.checksnow prints a blank line after multi-line warnings, which also separates two in a row. One-line warnings stay as they are and this doesn't affectbrew doctor, which prints its own findings. The exception is:build_error_checks, because commands that continue after a failed build print their own blank line.brew upgradealready did andbrew installnow does too, so the next formula's output no longer runs into a warning. Outside Tier 1 a failedbrew installcan now get two blank lines before the tier message, asbrew upgradealready does.To reproduce:
brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?Claude Code (Claude Opus 5.5) found the causes, wrote the changes and their specs and ran them. Each new spec was seen failing before the code it covers was added. It ran the
brew doctorreproduction,brew install --dry-run helloand a failing two-formulabrew installfrom a local tap in a terminal on macOS 12. It ranbrew lgtmon the final branch, which passed.