1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-21 20:38:54 +00:00

Fix some spelling mistakes

This commit is contained in:
mcarton 2015-08-23 21:27:38 +02:00
parent 15d19fdf9c
commit 6754ebe20d
3 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@ import pytest
from tests.utils import Command
from thefuck.rules.mercurial import (
extract_possisiblities, match, get_new_command
extract_possibilities, match, get_new_command
)
@ -96,8 +96,8 @@ def test_not_match(command):
'\n rebase recover remove rename resolve revert'
)), ['rebase', 'recover', 'remove', 'rename', 'resolve', 'revert']),
])
def test_extract_possisiblities(command, possibilities):
assert extract_possisiblities(command) == possibilities
def test_extract_possibilities(command, possibilities):
assert extract_possibilities(command) == possibilities
@pytest.mark.parametrize('command, new_command', [

View File

@ -13,12 +13,12 @@ def _is_tar_extract(cmd):
def _tar_file(cmd):
tar_extentions = ('.tar', '.tar.Z', '.tar.bz2', '.tar.gz', '.tar.lz',
tar_extensions = ('.tar', '.tar.Z', '.tar.bz2', '.tar.gz', '.tar.lz',
'.tar.lzma', '.tar.xz', '.taz', '.tb2', '.tbz', '.tbz2',
'.tgz', '.tlz', '.txz', '.tz')
for c in cmd.split():
for ext in tar_extentions:
for ext in tar_extensions:
if c.endswith(ext):
return (c, c[0:len(c)-len(ext)])

View File

@ -2,7 +2,7 @@ import re
from thefuck.utils import get_closest
def extract_possisiblities(command):
def extract_possibilities(command):
possib = re.findall(r'\n\(did you mean one of ([^\?]+)\?\)', command.stderr)
if possib:
return possib[0].split(', ')
@ -24,6 +24,6 @@ def match(command, settings):
def get_new_command(command, settings):
script = command.script.split(' ')
possisiblities = extract_possisiblities(command)
script[1] = get_closest(script[1], possisiblities)
possibilities = extract_possibilities(command)
script[1] = get_closest(script[1], possibilities)
return ' '.join(script)