mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
Merge branch 'master' of https://github.com/nvbn/thefuck into feature/git_checkout_multiple_options
This commit is contained in:
commit
10cf108ecd
@ -12,7 +12,6 @@ matrix:
|
|||||||
- python: "3.6-dev"
|
- python: "3.6-dev"
|
||||||
- python: "3.6"
|
- python: "3.6"
|
||||||
- python: "3.5"
|
- python: "3.5"
|
||||||
- python: "3.4"
|
|
||||||
- python: "2.7"
|
- python: "2.7"
|
||||||
- os: osx
|
- os: osx
|
||||||
language: generic
|
language: generic
|
||||||
|
@ -3,7 +3,6 @@ build: false
|
|||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- PYTHON: "C:/Python27"
|
- PYTHON: "C:/Python27"
|
||||||
- PYTHON: "C:/Python34"
|
|
||||||
- PYTHON: "C:/Python35"
|
- PYTHON: "C:/Python35"
|
||||||
- PYTHON: "C:/Python36"
|
- PYTHON: "C:/Python36"
|
||||||
- PYTHON: "C:/Python37"
|
- PYTHON: "C:/Python37"
|
||||||
|
4
setup.py
4
setup.py
@ -26,8 +26,8 @@ if version < (2, 7):
|
|||||||
print('thefuck requires Python version 2.7 or later' +
|
print('thefuck requires Python version 2.7 or later' +
|
||||||
' ({}.{} detected).'.format(*version))
|
' ({}.{} detected).'.format(*version))
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
elif (3, 0) < version < (3, 4):
|
elif (3, 0) < version < (3, 5):
|
||||||
print('thefuck requires Python version 3.4 or later' +
|
print('thefuck requires Python version 3.5 or later' +
|
||||||
' ({}.{} detected).'.format(*version))
|
' ({}.{} detected).'.format(*version))
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
@ -225,9 +225,12 @@ class TestGetValidHistoryWithoutCurrent(object):
|
|||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def history(self, mocker):
|
def history(self, mocker):
|
||||||
return mocker.patch('thefuck.shells.shell.get_history',
|
mock = mocker.patch('thefuck.shells.shell.get_history')
|
||||||
return_value=['le cat', 'fuck', 'ls cat',
|
# Passing as an argument causes `UnicodeDecodeError`
|
||||||
'diff x', 'nocommand x', u'café ô'])
|
# with newer py.test and python 2.7
|
||||||
|
mock.return_value = ['le cat', 'fuck', 'ls cat',
|
||||||
|
'diff x', 'nocommand x', u'café ô']
|
||||||
|
return mock
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(autouse=True)
|
||||||
def alias(self, mocker):
|
def alias(self, mocker):
|
||||||
|
@ -106,7 +106,7 @@ def how_to_configure_alias(configuration_details):
|
|||||||
|
|
||||||
if configuration_details.can_configure_automatically:
|
if configuration_details.can_configure_automatically:
|
||||||
print(
|
print(
|
||||||
u"Or run {bold}fuck{reset} second time for configuring"
|
u"Or run {bold}fuck{reset} a second time to configure"
|
||||||
u" it automatically.".format(
|
u" it automatically.".format(
|
||||||
bold=color(colorama.Style.BRIGHT),
|
bold=color(colorama.Style.BRIGHT),
|
||||||
reset=color(colorama.Style.RESET_ALL)))
|
reset=color(colorama.Style.RESET_ALL)))
|
||||||
|
@ -9,6 +9,6 @@ def match(command):
|
|||||||
|
|
||||||
|
|
||||||
def get_new_command(command):
|
def get_new_command(command):
|
||||||
path = path = re.findall(
|
path = re.findall(
|
||||||
r"touch: (?:cannot touch ')?(.+)/.+'?:", command.output)[0]
|
r"touch: (?:cannot touch ')?(.+)/.+'?:", command.output)[0]
|
||||||
return shell.and_(u'mkdir -p {}'.format(path), command.script)
|
return shell.and_(u'mkdir -p {}'.format(path), command.script)
|
||||||
|
@ -98,7 +98,7 @@ def get_closest(word, possibilities, cutoff=0.6, fallback_to_first=True):
|
|||||||
|
|
||||||
|
|
||||||
def get_close_matches(word, possibilities, n=None, cutoff=0.6):
|
def get_close_matches(word, possibilities, n=None, cutoff=0.6):
|
||||||
"""Overrides `difflib.get_close_match` to controle argument `n`."""
|
"""Overrides `difflib.get_close_match` to control argument `n`."""
|
||||||
if n is None:
|
if n is None:
|
||||||
n = settings.num_close_matches
|
n = settings.num_close_matches
|
||||||
return difflib_get_close_matches(word, possibilities, n, cutoff)
|
return difflib_get_close_matches(word, possibilities, n, cutoff)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user