Skip to content

Replace deleted homebrew-cask helper scripts - #23672

Open
bevanjkay wants to merge 4 commits into
mainfrom
remove-cask-script-references
Open

Replace deleted homebrew-cask helper scripts#23672
bevanjkay wants to merge 4 commits into
mainfrom
remove-cask-script-references

Conversation

@bevanjkay

@bevanjkay bevanjkay commented Aug 27, 2026

Copy link
Copy Markdown
Member

Companion PR to helper script removal in homebrew-cask - Homebrew/homebrew-cask#283612

  1. Replace documentation references to these scripts (if we want to remove some of the script replacement happy to do so).
  2. Migrate two genuinely helpful scripts to Homebrew/Brew as dev-cmd.

  • 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 brew benchmark results.
  • 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.

To help prepare this PR and the companion PR, I used claude-code with Fable 5.

Copilot AI balanced review requested due to automatic review settings August 27, 2026 10:19
@bevanjkay
bevanjkay force-pushed the remove-cask-script-references branch from ca0b8d4 to bc477a5 Compare August 27, 2026 10:21

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

Migrates two useful Homebrew Cask helper scripts into brew developer commands and replaces documentation references to removed scripts.

Changes:

  • Adds find-appcast and generate-cask-token.
  • Adds command tests, generated RBIs, manpages and completions.
  • Replaces deleted helpers with native macOS commands in documentation.

Reviewed changes

Copilot reviewed 12 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Library/Homebrew/dev-cmd/find-appcast.rb Implements appcast discovery.
Library/Homebrew/dev-cmd/generate-cask-token.rb Implements cask token generation.
Library/Homebrew/test/dev-cmd/find-appcast_spec.rb Adds argument parsing coverage.
Library/Homebrew/test/dev-cmd/generate-cask-token_spec.rb Adds token generation tests.
Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/find_appcast.rbi Adds generated Sorbet definitions.
Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/generate_cask_token.rbi Adds generated Sorbet definitions.
docs/Cask-Cookbook.md Replaces removed helper references.
docs/Brew-Livecheck.md Documents the migrated appcast command.
docs/Manpage.md Adds command documentation.
manpages/brew.1 Updates the generated manpage.
completions/bash/brew Adds Bash completions.
completions/fish/brew.fish Adds Fish completions.
completions/zsh/_brew Adds Zsh completions.
completions/internal_commands_list.txt Registers both commands.
Files not reviewed (2)
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/find_appcast.rbi: File type not supported
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/generate_cask_token.rbi: File type not supported
Suppressed comments (4)

Library/Homebrew/dev-cmd/generate-cask-token.rb:210

  • Underscores are converted to the same temporary marker as CamelCase boundaries, which is deleted later, so Fancy_Word produces fancyword. The documented token convention says underscores become hyphens (docs/Cask-Cookbook.md:1555); preserve them as spaces here so tokenization creates the separator.
        name = name.gsub(/([^A-Z])([A-Z])/, "\\1\v\\2").tr("_", "\v")

Library/Homebrew/dev-cmd/generate-cask-token.rb:133

  • This pattern only removes two or more leading hyphens, leaving a single leading hyphen in the generated token. That violates the documented rule to delete leading hyphens (docs/Cask-Cookbook.md:1561); match one or more instead.
                     .gsub(/^--+/, "")

Library/Homebrew/dev-cmd/generate-cask-token.rb:190

  • ASCII decomposition drops middots/interpuncts before tokenization, so Foo路Bar becomes foobar rather than the documented foo-bar (docs/Cask-Cookbook.md:1556). Translate these separators to hyphens before filtering non-ASCII characters.
        name.unicode_normalize(:nfkd).each_char.select(&:ascii_only?).join

Library/Homebrew/dev-cmd/find-appcast.rb:82

  • The s3.amazon-aws.yml hostname is invalid, so this candidate can never discover an S3 appcast. Correct it to the standard s3.amazonaws.com endpoint.
          "https://#{components[:bucket]}.s3.amazon-aws.yml/#{components[:channel]}/latest-mac.yml",

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

Comment thread Library/Homebrew/dev-cmd/generate-cask-token.rb Outdated
Comment thread Library/Homebrew/dev-cmd/find-appcast.rb Outdated
Comment thread Library/Homebrew/test/dev-cmd/find-appcast_spec.rb
Comment thread Library/Homebrew/test/dev-cmd/generate-cask-token_spec.rb Outdated
@bevanjkay
bevanjkay force-pushed the remove-cask-script-references branch 2 times, most recently from 8db1e2f to f65143e Compare August 27, 2026 11:42
@MikeMcQuaid MikeMcQuaid changed the title docs: remove references to deleted homebrew-cask helper scripts Replace deleted homebrew-cask helper scripts Aug 27, 2026

@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 for this! Tweaked the title to reflect it's not a docs-only change.

I think ideally all of this stuff (including generate-zap probably) would just live inside brew create. It feels like right now there's a bit of busywork required running multiple commands that don't e.g. suggest or run each other in order to get a Great Working Cask and ideally it'd just be a brew create --cask call.

Comment thread Library/Homebrew/dev-cmd/find-appcast.rb
Comment thread Library/Homebrew/dev-cmd/generate-cask-token.rb

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

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

Files not reviewed (2)
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/find_appcast.rbi: File type not supported
  • Library/Homebrew/sorbet/rbi/dsl/homebrew/dev_cmd/generate_cask_token.rbi: File type not supported

Comment thread Library/Homebrew/cask/token_generator.rb
Comment thread Library/Homebrew/cask/appcast.rb Outdated
Comment thread docs/Cask-Cookbook.md Outdated
Comment thread Library/Homebrew/cask/appcast.rb
Comment thread docs/Cask-Cookbook.md Outdated
@p-linnane

Copy link
Copy Markdown
Contributor

Generating a zap stanza requires running the installed application to generate the files that will be identified. That's one that's a bit trickier unless we're going to make brew create a more guided process.

@bevanjkay
bevanjkay force-pushed the remove-cask-script-references branch from 07e9fe1 to 67f6dca Compare August 27, 2026 23:31
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