edit: auto-tap core/cask repos when not installed#21641
Merged
MikeMcQuaid merged 5 commits intoHomebrew:mainfrom Mar 1, 2026
Merged
edit: auto-tap core/cask repos when not installed#21641MikeMcQuaid merged 5 commits intoHomebrew:mainfrom
MikeMcQuaid merged 5 commits intoHomebrew:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts brew edit to automatically tap homebrew/core or homebrew/cask when a requested formula/cask is known via the API but the corresponding tap isn’t installed, preventing misleading “doesn’t exist on disk” errors after developer mode is auto-enabled.
Changes:
- Auto-install
homebrew/core/homebrew/cask(with--force) before resolving named args to paths indev-cmd/edit. - Add an
editcommand spec covering auto-tapping core for an API-known formula when core isn’t installed. - Add a
NamedArgs#to_pathsspec documenting thewithout_api: truebehavior that motivates theeditworkaround.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
Library/Homebrew/dev-cmd/edit.rb |
Auto-tap core/cask before to_paths when the item is API-known but the tap isn’t installed. |
Library/Homebrew/test/dev-cmd/edit_spec.rb |
Adds a regression test for auto-tapping homebrew/core during brew edit. |
Library/Homebrew/test/cli/named_args_spec.rb |
Adds a spec documenting to_paths behavior under without_api: true when core isn’t installed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MikeMcQuaid
reviewed
Feb 28, 2026
Member
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Thanks, looks good so far, a few comments.
MikeMcQuaid
reviewed
Feb 28, 2026
MikeMcQuaid
reviewed
Mar 1, 2026
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.
brew lgtm(style, typechecking and tests) with your changes locally?Fixes #21585.
brew editauto-enables developer mode but doesn't clone the taps, leaving users with a misleadingbrew createerror. This fix adds auto-tap beforeto_pathsinedit.rbwhen the formula/cask is API-known, but the tap isn't installed.Verified end-to-end with
brew edit --print-path wgeton an install without taps.