Make suggestions based on Damerau-Levenshtein distance#1824
Make suggestions based on Damerau-Levenshtein distance#1824kinnison merged 3 commits intorust-lang:masterfrom Glamhoth:suggestions
Conversation
kinnison
left a comment
There was a problem hiding this comment.
Not bad, some comments in-line, and the commit history will need a good rebase toward the end (be careful to retain retep007's authorship at that point).
In addition, I'd like to see at least one test which demonstrates what happens if there's nothing worth suggesting within the heuristic distance of 3. E.g. rustup component add banana.
|
☔ The latest upstream changes (presumably #1833) made this pull request unmergeable. Please resolve the merge conflicts. |
kinnison
left a comment
There was a problem hiding this comment.
So very almost there. Please fold the requested changes into the two main commits you have (i.e. where your initial implementation, and retep's changes lie.
I'll expect to see:
- commit 1: the clitools.rs update
- commit 2: your code (with fixes folded in)
- commit 3: retep's work (with fixes folded in)
If you can do that, I think this is mergeable, so remember to remove WIP: from the title when you think you're ready for the final review before merge 😁
Thanks,
D.
In order to support testing commands which may return certain messages on `stderr` in a way in which they should *NOT* produce such messages, add a counterpart to `expect_not_stdout_ok`.
#1816
The only change that I'd suggest is to use Damerau-Levenshtein distance instead of Levenshtein distance, because the former adds transpositions to list of the basic operations. And as we know a lot of misspellings are made that way, even the example from issue is of this kind of error.