Skip to content

Stop cleaning corrupt cask dirs#21980

Merged
MikeMcQuaid merged 1 commit intomainfrom
reinstall-corrupt-casks
Apr 10, 2026
Merged

Stop cleaning corrupt cask dirs#21980
MikeMcQuaid merged 1 commit intomainfrom
reinstall-corrupt-casks

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • 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

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

OpenAI Codex used with multiple local review and testing passes.


- 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`
Copilot AI review requested due to automatic review settings April 10, 2026 08:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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’s check_cask_corrupt_dirs output to recommend brew reinstall --cask --force <token>.
  • Add an RSpec example covering the new check_cask_corrupt_dirs guidance.

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.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit 91bff3a Apr 10, 2026
49 checks passed
@MikeMcQuaid MikeMcQuaid deleted the reinstall-corrupt-casks branch April 10, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants