fix(release): hoist install out of the generated formula's on_arm blocks - #212
Merged
Conversation
Homebrew 6.0 enforces RuboCop's Sorbet/BlockMethodDefinition, which rejects `def` inside a block. The generated formula put a `def install` in each on_arm/on_intel stanza, so `brew style workos/tap` now fails with four offenses and takes `brew test-bot --only-tap-syntax` red on every homebrew-tap pull request. Emit a single class-level `def install` that globs the one asset the current platform downloaded, matching Formula/workos-emulate.rb in the same tap. Verified with brew 6.0.13: style, readall, and audit are all clean against a scratch tap built from the patched formula. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Greptile SummaryUpdates the Homebrew formula generator to:
Confidence Score: 5/5The PR appears safe to merge with no actionable defects identified in the generator change. The generated formula retains architecture-specific URLs and checksums while moving installation to a valid class-level method that installs the single downloaded platform asset. Important Files Changed
Reviews (1): Last reviewed commit: "fix(release): hoist install out of the f..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
brew style workos/tapfails onFormula/workos.rb, which takesbrew test-bot --only-tap-syntaxred on every workos/homebrew-tap pull request (e.g. homebrew-tap#3, a README-only change).Homebrew 6.0 enforces RuboCop's
Sorbet/BlockMethodDefinition, which rejectsdefinside a block.scripts/gen-homebrew-formula.tsemits adef installinside eachon_arm/on_intelstanza, so the generated formula now trips it four times:Change
Drop
installfrom the per-arch stanzas (they now pin onlyurl+sha256) and emit one class-leveldef installthat globs whichever asset the current platform downloaded. This is the same shape asFormula/workos-emulate.rb, which is already clean under the new cop — so the tap ends up with one consistent pattern.The
odieguard is the one deviation from the emulate formula: a bareDir[...].firstreturnsnilon a miss and fails with an opaque error, so this names the cause.Verification
Ran the generator with stub binaries, then the full
--only-tap-syntaxsuite against a scratch tap built from the real remotemainwith the patched formula dropped in — local brew is 6.0.13, the same version CI uses:brew stylebrew readall --aliases --os=all --arch=allbrew audit --except=installedNotes
Formula/workos.rbstays stale until the next release regenerates it, so it needs the same edit by hand to unblock homebrew-tap CI now. Companion PR: fix: hoist install out of workos.rb's on_arm blocks homebrew-tap#4.🤖 Generated with Claude Code