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

Pull Request Overview

  • Opened on October 21, 2026
  • Status Merged
  • Commit count 1 with first commit October 21, 2026

Total Delta

269 Total Diff Delta

Open Days

Open 15 weekdays

Test Delta

23 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.3 days Authoring 1 commit before pull request opened for review
 
0.0 days Awaiting first review
 
1.3 days Revising work with 0 commits in response to 7 reviews that left 14 comments
Set up deploy tracking to begin tracking full PR start-to-deploy times

Total time for pull request 1.6 business days from first commit authored to merge
Deploy tracking has not been set up

Author avatar

Require `zap` stanzas in new casks


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


Comments Threads Pending Resolution

MikeMcQuaid reviewed and approved this work on October 21, 2026
MikeMcQuaid left a comment

Thanks!

coderabbitai[bot] reviewed on October 21, 2026
coderabbitai[bot] reviewed on October 21, 2026
coderabbitai[bot] left a comment

**Actionable comments posted: 1**

---

ℹ️ Review info

βš™οΈ Run configuration

- **Configuration used**: Organization UI
- **Review profile**: CHILL
- **Plan**: Advanced
- **Run ID**: `84cffbe5-19a0-43b4-8d1a-ac502f23a629`

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 6c5afbf4b0339d45cfb8a00ae3ebb3701cf3b54d and 9d7fa14367f34baf702ee5f6b31bf2ae8aab7db2.

πŸ“’ Files selected for processing: 2

* `Library/Homebrew/dev-cmd/audit.rb`
* `Library/Homebrew/test/dev-cmd/audit_spec.rb`

**Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

coderabbitai[bot] reviewed on October 21, 2026
coderabbitai[bot] left a comment

**Actionable comments posted: 1**

---

ℹ️ Review info

βš™οΈ Run configuration

- **Configuration used**: Organization UI
- **Review profile**: CHILL
- **Plan**: Advanced
- **Run ID**: `2411f990-6587-458e-8f79-50d9b2eab207`

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between d1063bc73cf26dfac39f257dc37e0f4c9bc12121 and 6c5afbf4b0339d45cfb8a00ae3ebb3701cf3b54d.

πŸ“’ Files selected for processing: 4

* `Library/Homebrew/cask/audit.rb`
* `Library/Homebrew/dev-cmd/audit.rb`
* `Library/Homebrew/test/cask/audit_spec.rb`
* `Library/Homebrew/test/dev-cmd/audit_spec.rb`

**Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Library/Homebrew/dev-cmd/audit.rb
272
            os = :linux if os != :linux && !cask.supports_macos?
273
            os = :macos if os == :linux && !cask.supports_linux?
274
            cask_archs = SimulateSystem.with(os:, arch:) { Cask::CaskLoader.load(path) }
275
                                       .depends_on.arch&.map { |cask_arch| cask_arch[:type] }
276
            arch = OnSystem::ARCH_OPTIONS.find { cask_archs.include?(it) } if cask_archs&.exclude?(arch)
coderabbitai[bot] reviewed on October 21, 2026
coderabbitai[bot] left a comment

**Actionable comments posted: 1**

---

ℹ️ Review info

βš™οΈ Run configuration

- **Configuration used**: Organization UI
- **Review profile**: CHILL
- **Plan**: Advanced
- **Run ID**: `e2dc10a1-bd51-42d3-963b-5decaf6cd618`

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 32c4e9de4bc8907f5a9df04044dad58b182d2a64 and d1063bc73cf26dfac39f257dc37e0f4c9bc12121.

πŸ“’ Files selected for processing: 1

* `Library/Homebrew/cask/audit.rb`

**Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

MikeMcQuaid reviewed on October 21, 2026
MikeMcQuaid left a comment

Can we have `brew create` automatically run this or at least make clear what exactly needs to be run to generate zaps before or as part of this PR?

As a periodic Homebrew-cask contributor, adding zaps is the part I've always found to be the most confusing.

coderabbitai[bot] reviewed on October 21, 2026
coderabbitai[bot] left a comment

**Actionable comments posted: 1**

---

ℹ️ Review info

βš™οΈ Run configuration

- **Configuration used**: Organization UI
- **Review profile**: CHILL
- **Plan**: Advanced
- **Run ID**: `637d1837-b103-45bc-aba3-fcf8ddfc3566`

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 332963d53699d6a49b9d16bcb04b9fbc66ae5f00 and fab6ca68bfbaf19349535d2a03c054a2e43700f0.

πŸ“’ Files selected for processing: 11

* `Library/Homebrew/cask/artifact/zap.rb`
* `Library/Homebrew/cask/audit.rb`
* `Library/Homebrew/dev-cmd/generate-zap.rb`
* `Library/Homebrew/rubocops/cask/uninstall_methods_order.rb`
* `Library/Homebrew/test/cask/artifact/zap_spec.rb`
* `Library/Homebrew/test/cask/audit_spec.rb`
* `Library/Homebrew/test/dev-cmd/generate-zap_spec.rb`
* `Library/Homebrew/test/rubocops/cask/uninstall_methods_order_spec.rb`
* `docs/Cask-Cookbook.md`
* `docs/Manpage.md`
* `manpages/brew.1`

**Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Library/Homebrew/cask/audit.rb
360
    sig { void }
361
    def audit_zap_required
362
      return unless new_cask?
363
      return unless cask.tap&.official?
364
      return if cask.artifacts.any?(Artifact::Zap)

Resolved Comment Threads

coderabbitai[bot] reviewed on October 21, 2026
coderabbitai[bot] left a comment

**Actionable comments posted: 1**

---

ℹ️ Review info

βš™οΈ Run configuration

- **Configuration used**: Organization UI
- **Review profile**: CHILL
- **Plan**: Advanced
- **Run ID**: `84cffbe5-19a0-43b4-8d1a-ac502f23a629`

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 6c5afbf4b0339d45cfb8a00ae3ebb3701cf3b54d and 9d7fa14367f34baf702ee5f6b31bf2ae8aab7db2.

πŸ“’ Files selected for processing: 2

* `Library/Homebrew/dev-cmd/audit.rb`
* `Library/Homebrew/test/dev-cmd/audit_spec.rb`

**Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

Library/Homebrew/dev-cmd/audit.rb
Outdated
269
            # Casks have no stanza values for platforms they don't support, so
270
            # audit them on one they do instead. `depends_on arch` can differ
271
            # between OSes, so read it on the OS being audited.
272
            os = :linux if os != :linux && !cask.supports_macos?
273
            os = :macos if os == :linux && !cask.supports_linux?