Skip to content

Conversation

@botantony
Copy link
Member

  • 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 for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

Closes #21067

Copilot AI review requested due to automatic review settings November 15, 2025 03:20
Copilot finished reviewing on behalf of botantony November 15, 2025 03:23
Copy link
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

This pull request implements functionality to prevent users from uninstalling casks that have dependent casks installed, similar to the existing behavior for formulae.

Key changes:

  • Extracted DependentsMessage class to a shared module for reuse between formula and cask uninstall operations
  • Added check_dependent_casks method to verify cask dependencies before uninstallation
  • Integrated the dependency check into the cask uninstall command workflow

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Library/Homebrew/dependents_message.rb New shared class extracted from uninstall.rb to format and display dependency error messages with Sorbet type signatures
Library/Homebrew/uninstall.rb Removed the DependentsMessage class (now in separate file) and added require statement for the new module
Library/Homebrew/cask/uninstall.rb Added check_dependent_casks method to identify and report casks with dependencies before uninstallation
Library/Homebrew/cmd/uninstall.rb Integrated the dependency check into the uninstall command flow, halting execution if dependencies are found
Library/Homebrew/test/cask/uninstall_spec.rb Added comprehensive test coverage for the new dependency checking functionality, including single/multiple casks and dependents

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@Rylan12 Rylan12 left a comment

Choose a reason for hiding this comment

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

Nice!

@botantony botantony added this pull request to the merge queue Nov 15, 2025
Merged via the queue into main with commit b1e6f31 Nov 15, 2025
37 checks passed
@botantony botantony deleted the cask-uninstall-dependents-check branch November 15, 2025 23:23
Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks @botantony!

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.

Cask uninstaller doesn't check for dependent casks

4 participants