Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR centralizes parsing of tap-qualified “full names” into Utils helpers to keep formula/cask name and tap extraction consistent across Homebrew commands, Bundle code, and migration/auditing paths.
Changes:
- Add
Utils.name_from_full_nameandUtils.tap_from_full_namehelpers plus unit tests. - Replace repeated
split("/")/rpartition("/")parsing across commands, Bundle, and audit/diagnostic code with the helpers. - Minor cleanup in an RBI file (remove a stray trailing line).
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/utils.rb | Adds shared full-name parsing helpers (name_from_full_name, tap_from_full_name). |
| Library/Homebrew/test/utils_spec.rb | Adds unit tests for the new parsing helpers. |
| Library/Homebrew/test/bundle/commands/cleanup_spec.rb | Updates Bundle cleanup specs to use the helpers and requires utils. |
| Library/Homebrew/tap_auditor.rb | Uses helper for extracting short names from tap-provided token/full-name lists. |
| Library/Homebrew/missing_formula.rb | Refactors tap migration messaging to use helpers (introduces an uncovered edge-case). |
| Library/Homebrew/migrator.rb | Uses helper to derive tap names from migration targets. |
| Library/Homebrew/linkage_checker.rb | Uses helper to extract dependency names from possibly tap-qualified names. |
| Library/Homebrew/language/python.rb | Uses helper when matching requirements/deps against the chosen Python dependency name. |
| Library/Homebrew/formulary.rb | Uses helper for alias-table short-name extraction. |
| Library/Homebrew/formula.rb | Uses helper when deriving aliases and enumerating tap formula/alias names. |
| Library/Homebrew/formula_auditor.rb | Uses helper to compare dependency oldnames against dep short name. |
| Library/Homebrew/extend/hash/deep_transform_values.rbi | Removes an extraneous trailing blank line. |
| Library/Homebrew/diagnostic.rb | Uses helper to extract tap names for shadowed formula/cask reporting. |
| Library/Homebrew/dev-cmd/bottle.rb | Uses helper to compute short formula name for bottle commit messages. |
| Library/Homebrew/descriptions.rb | Uses helper to build a map of short names for display. |
| Library/Homebrew/dependency.rb | Uses helper for option_names derived from dependency name. |
| Library/Homebrew/cmd/update-report.rb | Uses helpers for rename/migration parsing in update report generation and migration actions. |
| Library/Homebrew/cmd/untap.rb | Uses helper to match installed formulae/casks against tap entries (missing require "utils"). |
| Library/Homebrew/cmd/leaves.rb | Uses helper instead of local base-name parsing for dependency name extraction. |
| Library/Homebrew/cli/named_args.rb | Uses helpers when raising tap-qualified unavailable errors. |
| Library/Homebrew/bundle/dsl.rb | Uses helper in cask-name sanitization. |
| Library/Homebrew/bundle/cask.rb | Uses helpers when checking installed taps and comparing cask names/oldnames. |
| Library/Homebrew/bundle/brew.rb | Uses helpers in array checks, oldname/alias handling, and entry initialization. |
| Library/Homebrew/bundle/brew_services.rb | Uses helper for base-name resolution when matching started services and old names. |
Files not reviewed (1)
- Library/Homebrew/extend/hash/deep_transform_values.rbi: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- keep `full_name` parsing consistent across formula and cask code
- reduce repeated `split("/")` logic so tap and name extraction
do not drift in commands, bundle code, and migrations
- cover `Utils.name_from_full_name` and
`Utils.tap_from_full_name` in `test/utils_spec.rb`
1a0eb3d to
3148d27
Compare
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.
full_nameparsing consistent across formula and cask codesplit("/")logic so tap and name extraction do not drift in commands, bundle code, and migrationsUtils.name_from_full_nameandUtils.tap_from_full_nameintest/utils_spec.rbbrew lgtm(style, typechecking and tests) with your changes locally?Used OpenAI Codex with manual review and feedback.