-
Notifications
You must be signed in to change notification settings - Fork 902
feat(cli): prompt for misspelled parameter names #10350
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
a162f63
to
6ab0407
Compare
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.
Awesome! 🤩
return int(d[i+1][j+1]), ErrMaxDist | ||
} | ||
} | ||
} |
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.
Not against us having our own implementation, but there's also: https://github.com/agnivade/levenshtein (in this case, the performance optimizations are negligible, though.)
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.
I was also considering https://pkg.go.dev/github.com/junegunn/fzf@v0.0.0-20231029150554-1cfa3ee4c7c1/src/algo but didn't want to necessarily add a dep just for this.
Needle: "foo", | ||
MaxDistance: 2, | ||
Haystack: []string{"bar", "boo", "boof"}, | ||
Expected: []string{"boo", "boof"}, |
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.
Should we test some slightly longer inputs as well?
6ab0407
to
24a04fa
Compare
Part of #10292
Performs a fuzzy-matching based on Levenshtein edit distance when an unknown parameter name is encountered.
Edit distance defaults to
len(parameter)/2
.Should result in less guessing about what that parameter was named exactly.