Require `zap` stanzas in new casks #24315

Merged
bevanjkay opened 10:44am on October 21, 2026 wanted to merge 269 Ξ” into homebrew/brew main from
zap_audit
Diff Delta:
269
About 212 Diff Delta/hour
Classified as:  Feature Add

bevanjkay's Description of Work


  • New casks often omit zap, and the # No zap stanza required comment that marks a deliberate omission can't be audited, we've just used it for a fuzzy regex check to a apply a PR label. Add zap :not_required so a cask can declare it instead.

  • Serialise it as an empty zap stanza so that older versions of Homebrew can still load these casks from the API.

  • Audit new casks in official taps for a zap stanza on the OS and architecture being audited. CI audits each one, so this catches a cask that supports Linux but only has a zap in on_macos.

  • Only suggest brew generate-zap when auditing macOS, as it only scans macOS paths, and have it warn that the app must have been launched before it prints zap :not_required.

  • Fix Cask/UninstallMethodsOrder, which crashed on the non-hash argument of zap :not_required.



  • [x] Have you followed our Contributing guidelines?

  • [x] Have you checked for other open Pull Requests for the same change?

  • [x] Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.

  • [x] 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?

  • [x] Have you written new tests (excluding integration tests)? Here's an example.

  • [x] Have you successfully run brew lgtm (style, typechecking and tests) locally?



  • [x] 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.

Claude with Opus 5.5 at Extra High effort, with local review and testing.


13 total changed files
(1 file ignored)
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Review complete πŸ’ͺ
LGTM-land is officially in view