Repository navigation
Allow tap-qualified formula names - #18
Conversation
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
A moderate active issue remains in main.go where the cask-tap rejection logic uses an overly broad "homebrew/cask" prefix match that could incorrectly reject non-official tap-qualified formulae, so the matching needs tightening to the intended official cask tap patterns.
1 open issue
What changed in this PR
Adds support for tap-qualified Homebrew formula arguments (e.g. homebrew/core/foo) to allow disambiguation across taps while keeping casks from official homebrew/cask* taps unsupported.
Changes:
- Expand formula argument validation to accept an optional
user/repo/tap prefix with segment constraints. - Preserve existing behavior by rejecting tap-qualified names from official
homebrew/cask*taps. - Update documentation and extend tests to cover accepted and rejected tap-qualified inputs.
| File | Description |
|---|---|
| README.md | Documents the newly supported tap-qualified formula argument syntax and clarifies that casks remain unsupported. |
| main.go | Updates formula argument validation to allow an optional tap prefix and adds explicit rejection logic for homebrew/cask* tap-qualified inputs. |
| main_test.go | Adds and refines test cases for valid tap-qualified formula names and rejected cases including malformed prefixes and cask taps. |
Review effort: Balanced
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟢 Approval recommended
The review evidence indicates the change is narrowly scoped to formula argument validation with documented behavior and accompanying unit tests for both accepted tap-qualified names and explicit rejections/edge cases, leaving no unresolved issues.
No open issues 🎉
1 resolved since last review
Review effort: Balanced
grahamgilbert
left a comment
There was a problem hiding this comment.
Please fix the test coverage though
Formula arguments were limited to bare names, so there was no way to target a specific tap when more than one tap provides a formula with the same name (e.g. homebrew/core/foo vs someuser/sometap/foo). Accept an optional user/repo/ prefix in formula arguments. Casks from the official homebrew/cask* taps are still rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cask check matched any tap whose repo started with "cask", which also rejected unrelated taps such as homebrew/caskify. Match only homebrew/cask and homebrew/cask-* instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a47e52f to
e571ca5
Compare
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
A critical validation flaw in main.go allows option-like inputs (e.g., "--help") to pass as a formula name and be forwarded to brew, creating a surprising argument-injection vector that must be fixed before approval.
1 open issue
Review effort: Balanced
| var formulaRe = regexp.MustCompile( //nolint:gochecknoglobals | ||
| `^([A-Za-z0-9][A-Za-z0-9_-]{0,63}/[A-Za-z0-9][A-Za-z0-9_.-]{0,63}/)?[A-Za-z0-9+@._-]{1,128}$`, | ||
| ) |


Summary
Formula arguments are currently validated against
^[A-Za-z0-9+@._-]{1,128}$, so tap-qualified names such ashomebrew/core/fooare rejected withinvalid formula name. That leaves no way to target a specific tap when more than one tap provides a formula with the same name.This change accepts an optional
user/repo/prefix on formula arguments:-/., and..are rejected.homebrew/cask*taps are still rejected, which keeps the existinghomebrew/cask/vlctest case.With
check, a tap-qualified name won't match an entry in thebrew info --installedcache (which is keyed by bare name), so it falls back to a directbrew info --json <name>call. That's the existing behaviour for names not found in the cache.The README documents the new form.
Testing
go test ./...golangci-lint run ./...(v2.6.2, matching CI): 0 issues🤖 Generated with Claude Code