-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Improvements to HOMEBREW_USE_INTERNAL_API
#20947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
b190a96 to
f428d23
Compare
|
I named the helper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors formula loading calls by introducing and using a new Formulary.factory_stub method as a cleaner API for requesting stubbed formula instances. The change replaces scattered calls to Formulary.factory(..., prefer_stub: true) with the more explicit Formulary.factory_stub(...) method.
Key changes:
- Added
Formulary.factory_stubmethod as a shortcut for callingfactorywithprefer_stub: true - Updated all call sites to use the new method instead of passing the
prefer_stubparameter - Replaced some
Formula[name]calls withFormulary.factory_stub(name)where only stub data is needed
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/formulary.rb | Added new factory_stub method with documentation and updated resolve to use it |
| Library/Homebrew/style.rb | Updated shellcheck, shfmt, and actionlint methods to use factory_stub |
| Library/Homebrew/extend/pathname.rb | Updated which_install_info to use factory_stub for texinfo formula |
| Library/Homebrew/extend/os/mac/pkgconf.rb | Updated macos_sdk_mismatch to use factory_stub for pkgconf formula |
| Library/Homebrew/extend/kernel.rb | Updated ensure_executable! to use factory_stub |
| Library/Homebrew/cli/parser.rb | Updated formulae method to use factory_stub |
| Library/Homebrew/cli/named_args.rb | Updated load_formula_or_cask to use factory_stub |
| Library/Homebrew/attestation.rb | Updated sort_formulae_for_install to check formula names instead of using Formula["gh"] |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f428d23 to
f3a83f7
Compare
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR contains a handful of improvements to installations with
HOMEBREW_USE_INTERNAL_APIto help reduce unnecessary downloads of formula JSON files.A note: I started working on this before #20940, and there were some conflicts, so I'm not sure they play nicely together yet.