-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Formula fuzzy search and did you mean #11565
Formula fuzzy search and did you mean #11565
Conversation
Review period will end on 2021-06-22 at 00:00:00 UTC. |
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.
This looks great so far, fantastic work @bayandin!
Nice! Feels like the output is slightly duplicated, though. Maybe worth removing from the exception message?
This seems fine/worth it 👍🏻
May need to adjust the load path and/or requires in |
Review period ended. |
c825324
to
5e65419
Compare
Yep, it looks like now, we have similar duplication. I've removed the second message.
We run tests via
We'll be able to get rid of it when switching to ruby 2.7 in the future. Alternatively, if we don't want to bundle it, we can use this gem opportunistically (like |
5e65419
to
3528899
Compare
Makes sense, thanks @bayandin! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?This PR improves
brew search
command by adding approximately matching formula names (which is useful for mistyped formula names) and adds "Did you mean ..." for mistyped formula names (will be useful for cases like #11526):Before
After
I use
did_you_mean
gem for it (it bundled with ruby since ruby 2.6 and promoted to default gems in ruby 2.7).To make it possible to use it I had to remove it from a list of disabled options, here's a test of how it affects performance (I've chosen
HOMEBREW_NO_ANALYTICS=1 brew info docker
command, please let me know if this is not representative enough):The fuzzy search itself works fast enough and takes ~0.02s per query:
Things to be sorted out:
ToDo (could be sorted out in the following PRs):