Merged
Conversation
- stop deleting corrupt cask directories from `brew cleanup` so missing metadata does not silently erase user state - update `brew doctor` to recommend `brew reinstall --cask --force <token>` for those casks - cover the new `check_cask_corrupt_dirs` guidance in `Library/Homebrew/test/diagnostic_checks_spec.rb`
Contributor
There was a problem hiding this comment.
Pull request overview
Stops brew cleanup from deleting “corrupt” Caskroom directories (missing metadata) and updates diagnostics to guide users toward force reinstalling affected casks instead.
Changes:
- Remove the automatic removal of corrupt Caskroom directories from
brew cleanup. - Update
brew doctor’scheck_cask_corrupt_dirsoutput to recommendbrew reinstall --cask --force <token>. - Add an RSpec example covering the new
check_cask_corrupt_dirsguidance.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Library/Homebrew/cleanup.rb |
Removes the corrupt-cask-dir cleanup step so user state isn’t silently deleted. |
Library/Homebrew/diagnostic.rb |
Updates the doctor check message to list corrupt dirs and provide force-reinstall commands. |
Library/Homebrew/test/diagnostic_checks_spec.rb |
Adds test coverage for the updated doctor output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bevanjkay
approved these changes
Apr 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 cleanupso missing metadata does not silently erase user statebrew doctorto recommendbrew reinstall --cask --force <token>for those caskscheck_cask_corrupt_dirsguidance inLibrary/Homebrew/test/diagnostic_checks_spec.rbbrew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex used with multiple local review and testing passes.