Replace deleted homebrew-cask helper scripts - #23672
Conversation
ca0b8d4 to
bc477a5
Compare
There was a problem hiding this comment.
Pull request overview
Migrates two useful Homebrew Cask helper scripts into brew developer commands and replaces documentation references to removed scripts.
Changes:
- Adds
find-appcastandgenerate-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_Wordproducesfancyword. 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路Barbecomesfoobarrather than the documentedfoo-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.ymlhostname is invalid, so this candidate can never discover an S3 appcast. Correct it to the standards3.amazonaws.comendpoint.
"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.
8db1e2f to
f65143e
Compare
MikeMcQuaid
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
Generating a |
07e9fe1 to
67f6dca
Compare
Companion PR to helper script removal in
homebrew-cask- Homebrew/homebrew-cask#283612dev-cmd.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?To help prepare this PR and the companion PR, I used
claude-codewith Fable 5.