-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Added Uncommon Typos #1429
base: master
Are you sure you want to change the base?
Added Uncommon Typos #1429
Conversation
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.
Thanks for your PR, @preetham1239! Please, consider my suggestions below.
tests/rules/test_git_not_command.py
Outdated
@pytest.mark.parametrize('script, output', [ | ||
('git lock', "git: lock is not a git command. See 'git --help'. \n\n The most similar command is \n log"), | ||
('git lock --help', "git: lock is not a git command. See 'git --help'. \n\n The most similar command is \n log")]) | ||
def test_match_uncommon(output, script): | ||
assert match(Command(script, output)) | ||
|
||
|
||
@pytest.mark.parametrize('script', [ | ||
'git branch foo', | ||
'git checkout feature/test_commit', | ||
'git push']) | ||
def test_not_match_uncommon(script): | ||
assert not match(Command(script, '')) | ||
|
||
|
||
@pytest.mark.parametrize('script, expected_output', [ | ||
('git lock', ['git log']), | ||
('git lock --help', ['git log --help'])]) | ||
def test_get_new_command_uncommon(script, expected_output): | ||
output = "git: '{}' is not a git command. See 'git --help'.".format(script.split()[1]) | ||
command = Command(script, output) | ||
assert get_new_command(command) == expected_output |
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.
These test cases should be added to the existing test functions.
thefuck/rules/git_not_command.py
Outdated
if broken_cmd in COMMON_TYPOS: | ||
matched = COMMON_TYPOS[broken_cmd] | ||
else: | ||
matched = get_all_matched_commands(command.output, ['The most similar command', 'Did you mean']) |
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.
We still want to suggest similar commands. Hence the call to extend
in my suggestion.
Got it. Will make those changes. |
I added the test cases to the existing functions and extended the matched commands list. |
Hey @scorphus, I wanted to follow up on the pull request I submitted. As this is my first contribution to an open-source project, I'm quite eager to see it through. I understand you might be busy, but if you could take a moment to review the changes I've made, it would mean a lot to me. I'm looking forward to any further suggestions you might have. |
A pull request for the changes in #883