-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Remove ActiveSupport String#exclude? #16189
Conversation
There's some uses in other taps that need updating first: https://github.com/search?q=org%3AHomebrew+exclude%3F+-repo%3AHomebrew%2Fbrew+-repo%3AHomebrew%2Fbrew-ghsa-h7hq-48hm-3mfj+language%3ARuby&type=code&l=Ruby. However, due to the |
Thanks for the heads up. I've restored the monkey-patch and left a comment in |
I suppose it depends what the plan is. If the plan is to remove ActiveSupport entirely, it's probably worth just carrying the monkey-patch ourselves. The implementation sounds like it would be extremely trivial (without looking, it's probably just As to whether that means keeping the monkey-patch indefinitely or to deprecate, I'll defer to what others like @MikeMcQuaid prefer as I have no particularly strong opinion. I personally avoid certain ActiveSupportisms (e.g. |
I've been chipping away at this as I work on the sorbet stuff, but it probably makes sense at this point to actually have a ticket to track what we ultimately do with ActiveSupport: #16190 Feel free to comment there if you have opinions. If we want to move forward with considering this, I can then make a table of what we're using, what has downstream dependencies, and what we to do (i.e. convert call sites or implement directly). (As always, I'm happy to have this PR closed out if it seems to be jumping the gun) |
Thanks, have commented more generally on #16190.
Yes, an implementation like that seems ideal. Where we can keep around things like
I like The ActiveSupport implementations are fairly involved; I'd propose we create our own simple implementations here instead. |
Yeah for sure, I didn't mean to suggest never. I just don't use it as liberally as before and think about it when doing so as if I write a function that takes in an array, I would just make the type signature disallow nil to begin with. Allowing both nil and empty can be a sign of poor type control, and did make Sorbet adoption a little harder in places. That doesn't mean that's always the case though. There's a reasonable notion of, for example, a CLI arg that's not supplied (nil) and an empty arg (""). Being a CLI tool, that applies a lot to us. I agree with the approach here: we can definitely have our own implementation of the presence functions etc and remove ActiveSupport entirely. General rule of thumb I'd say is: if it's used in Homebrew/core, consider it public API as it is supposed to only be public API there (which people copy as inspiration or via |
Pausing, pending scheduling in #16190 |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?As a continuation of #16184 this removes
String#exclude?
. (I've refactored allexclude?
calls to use the inverse method, sinceEnumerable#exclude?
is also via ActiveSupport.)