Skip to content

Conversation

@toobuntu
Copy link
Contributor

@toobuntu toobuntu commented Nov 25, 2025

  • 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?

Implements #17247 by letting casks opt into running uninstall quit/signal during brew upgrade and brew reinstall (default is to skip them) via an on_upgrade metadata key for uninstall stanzas of the form on_upgrade: :quit, on_upgrade: :signal, or on_upgrade: [:quit, :signal].

Adds fixtures, tests, updates docs, and teaches UninstallMethodsOrder to validate the metadata key and ignore it when checking uninstall method ordering. Default behavior remains unchanged unless a cask opts in.

@toobuntu toobuntu changed the title cask uninstall: opt-in quit/signal on upgrade cask uninstall: opt-in quit/signal on upgrade/reinstall Nov 25, 2025
@bevanjkay
Copy link
Member

This is great! I'll give it a proper look through and test a bit later today or tomorrow. But thanks for looking at this @toobuntu

@toobuntu toobuntu force-pushed the feature/cask-dsl/quit-signal-on-upgrade branch from 59c7df6 to e9686e1 Compare November 27, 2025 02:14
Allow casks to opt into running uninstall quit/signal during
brew upgrade/reinstall (default is to skip them) via on_upgrade.
Add fixtures, tests, and update docs.

Implements Homebrew#17247
@toobuntu toobuntu force-pushed the feature/cask-dsl/quit-signal-on-upgrade branch from e9686e1 to 3536f2e Compare December 8, 2025 05:27
@toobuntu
Copy link
Contributor Author

toobuntu commented Dec 8, 2025

Rebased and updated:
As requested, the DSL is now on_upgrade: :quit, on_upgrade: :signal, or on_upgrade: [:quit, :signal]. The docs warning previously requested remains. The UninstallMethodsOrder RuboCop‘s ordering behavior is unchanged and a symbol-aware on_upgrade metadata check was added that reuses the existing hash rewrite logic. on_upgrade tests were updated.

Teach UninstallMethodsOrder about on_upgrade metadata key, and add
spec cases covering it.
- Ignore metadata for ordering checks.
- Flag on_upgrade when none of its symbols match uninstall directives,
  and autocorrect when other directives exist.
- Warn without autocorrecting when on_upgrade symbols are invalid.
@toobuntu toobuntu force-pushed the feature/cask-dsl/quit-signal-on-upgrade branch from 3536f2e to 45cdd3a Compare December 8, 2025 05:34
@toobuntu toobuntu requested a review from MikeMcQuaid December 8, 2025 05:36
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.

Looks great, thanks @toobuntu, nice work!

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Dec 10, 2025
Merged via the queue into Homebrew:main with commit 760158b Dec 10, 2025
36 checks passed
@toobuntu toobuntu deleted the feature/cask-dsl/quit-signal-on-upgrade branch December 10, 2025 10:21
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.

4 participants