-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
brew CLI commands should be namespaced and implement an interface #16814
Comments
For this, we probably should be excluding In theory, you should be able to mark everything in every command file as |
Agreed 👍🏻 That said: I do agree splitting into more modules would be desirable. We'll just need to maintain backwards compatibility so external commands still work using this module (although we can deprecate/disable/remove that behaviour eventually). |
Soft disagree – I realize https://rubydoc.brew.sh/ is targeted toward surfacing the Formula API, but could be a better resource for (Commands will need a public |
Though the argument is none of these should be used internally through The one exception to the rule is subprocess args calls in |
I'm attempting to articulate that there are use cases for https://rubydoc.brew.sh/ beyond public API browsing, e.g. browsing brew commands (see "Direct Known Subclasses" here, for one example, which this ticket would unlock). Excluding |
I think if we want to do this we should probably figure out how to do so better, perhaps through a different site entirely. I don't have a problem with better documentation there if these APIs are clearly and consistently labeled as "private". |
I'm adding this here as a sort of public reminder. The |
Thank for noting here @apainintheneck! |
Amazing work @dduugg 👏 |
Verification
brew install wget
. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.Provide a detailed description of the proposed feature
Currently, all
brew
CLI commands live in the same namespace. As a result, the documentation page for theHomebrew
currently contains ~400 class methods. Another consequence is that including a module in any command causes Sorbet to include it in every command, leading to avoidable bugs.Moving commands to individual namespaces would also allow us to define an interface (currently, no two commands can implement the same methods without potentially clobbering each other), providing clarity to future command authors/maintainers.
What is the motivation for the feature?
☝️
How will the feature be relevant to at least 90% of Homebrew users?
Fewer runtime errors due to missing dependencies (though hopefully this is not something 90% of our users are encountering 😹).
What alternatives to the feature have been considered?
Maintaining the status quo?
The text was updated successfully, but these errors were encountered: