Skip to content

cask/artifact: support wildcards in uninstall quit/signal - #23559

Merged
MikeMcQuaid merged 2 commits into
mainfrom
cask-uninstall-quit-wildcard
Aug 19, 2026
Merged

cask/artifact: support wildcards in uninstall quit/signal#23559
MikeMcQuaid merged 2 commits into
mainfrom
cask-uninstall-quit-wildcard

Conversation

@bevanjkay

Copy link
Copy Markdown
Member
  • Extend glob (*) support to uninstall quit/signal paths
  • Add a cop to prevent bare * being used in these stanzas

  • Have you followed our Contributing guidelines?
  • 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 Hyperfine benchmarks.
  • 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.

I used claude-code with Opus 5 to implement the changes. I have reviewed the diff.

Copilot AI lite review requested due to automatic review settings August 19, 2026 03:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds wildcard (*) support for matching multiple running bundle IDs in Cask uninstall quit: and signal: directives, and introduces a RuboCop cop to prevent dangerously broad wildcard-only IDs.

Changes:

  • Expand quit:/signal: bundle IDs containing * to matching running bundle IDs at uninstall time.
  • Add RuboCop::Cop::Cask::UninstallWildcard to flag wildcard-only IDs like "*"/"*.*"/"**" in uninstall/zap directives.
  • Add tests/fixtures and update the Cask cookbook documentation to describe the new wildcard behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Library/Homebrew/cask/artifact/abstract_uninstall.rb Implements wildcard expansion for uninstall_quit and uninstall_signal via expand_bundle_id/running_bundle_ids.
Library/Homebrew/rubocops/cask/uninstall_wildcard.rb New cop preventing unbounded wildcard-only IDs in uninstall/zap (quit/signal/launchctl).
Library/Homebrew/rubocops/rubocop-cask.rb Registers the new uninstall_wildcard cop.
Library/Homebrew/test/cask/artifact/uninstall_spec.rb Adds unit tests for wildcard matching behavior in uninstall_quit and uninstall_signal.
Library/Homebrew/test/rubocops/cask/uninstall_wildcard_spec.rb Adds cop specs covering offenses and non-offenses.
Library/Homebrew/test/support/fixtures/cask/Casks/with-uninstall-signal-wildcard.rb New test fixture cask exercising uninstall signal wildcard usage.
docs/Cask-Cookbook.md Documents wildcard semantics for quit: and signal: bundle IDs.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Library/Homebrew/cask/artifact/abstract_uninstall.rb

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, code looks good just need safety tightened up a bit.

Comment thread Library/Homebrew/rubocops/cask/uninstall_wildcard.rb Outdated

@MikeMcQuaid MikeMcQuaid left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid
MikeMcQuaid enabled auto-merge August 19, 2026 13:22
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit df2ff2a Aug 19, 2026
45 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the cask-uninstall-quit-wildcard branch August 19, 2026 13:47
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