1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 20:11:17 +00:00

Fix flake8 errors: E127 continuation line over-indented for visual indent

This commit is contained in:
Joseph Frazier 2016-10-06 15:16:43 -04:00
parent e0cab4fa1b
commit 521eb03d7a
8 changed files with 32 additions and 32 deletions

View File

@ -8,13 +8,13 @@ def stderr():
return ("Error: Could not symlink bin/gcp\n"
"Target /usr/local/bin/gcp\n"
"already exists. You may want to remove it:\n"
"rm '/usr/local/bin/gcp'\n"
" rm '/usr/local/bin/gcp'\n"
"\n"
"To force the link and overwrite all conflicting files:\n"
"brew link --overwrite coreutils\n"
" brew link --overwrite coreutils\n"
"\n"
"To list all files that would be deleted:\n"
"brew link --overwrite --dry-run coreutils\n")
" brew link --overwrite --dry-run coreutils\n")
@pytest.fixture

View File

@ -51,6 +51,6 @@ def test_get_new_command(composer_not_command, composer_not_command_one_of_this)
assert (get_new_command(Command('composer udpate',
stderr=composer_not_command))
== 'composer update')
assert get_new_command(
Command('composer pdate', stderr=composer_not_command_one_of_this)) \
== 'composer selfupdate'
assert (get_new_command(Command('composer pdate',
stderr=composer_not_command_one_of_this))
== 'composer selfupdate')

View File

@ -18,5 +18,5 @@ def test_match():
def test_get_new_command():
""" Replace the Alt+Space character by a simple space """
assert get_new_command(Command(u'ps -ef | grep foo'))\
== 'ps -ef | grep foo'
assert (get_new_command(Command(u'ps -ef | grep foo'))
== 'ps -ef | grep foo')

View File

@ -51,7 +51,7 @@ def test_get_new_command(git_not_command, git_not_command_one_of_this,
git_not_command_closest):
assert (get_new_command(Command('git brnch', stderr=git_not_command))
== ['git branch'])
assert get_new_command(Command('git st', stderr=git_not_command_one_of_this)) \
== ['git stats', 'git stash', 'git stage']
assert get_new_command(Command('git tags', stderr=git_not_command_closest)) \
== ['git tag', 'git stage']
assert (get_new_command(Command('git st', stderr=git_not_command_one_of_this))
== ['git stats', 'git stash', 'git stage'])
assert (get_new_command(Command('git tags', stderr=git_not_command_closest))
== ['git tag', 'git stage'])

View File

@ -47,8 +47,8 @@ def test_get_corrected_commands(mocker):
get_new_command=lambda x: [x.script + '@', x.script + ';'],
priority=60)]
mocker.patch('thefuck.corrector.get_rules', return_value=rules)
assert [cmd.script for cmd in get_corrected_commands(command)] \
== ['test!', 'test@', 'test;']
assert ([cmd.script for cmd in get_corrected_commands(command)]
== ['test!', 'test@', 'test;'])
def test_organize_commands():

View File

@ -41,8 +41,8 @@ class TestRule(object):
priority=900,
requires_output=True))
rule_path = os.path.join(os.sep, 'rules', 'bash.py')
assert Rule.from_path(Path(rule_path)) \
== Rule('bash', match, get_new_command, priority=900)
assert (Rule.from_path(Path(rule_path))
== Rule('bash', match, get_new_command, priority=900))
load_source.assert_called_once_with('bash', rule_path)
@pytest.mark.parametrize('rules, exclude_rules, rule, is_enabled', [
@ -79,15 +79,15 @@ class TestRule(object):
def test_get_corrected_commands_with_rule_returns_list(self):
rule = Rule(get_new_command=lambda x: [x.script + '!', x.script + '@'],
priority=100)
assert list(rule.get_corrected_commands(Command(script='test'))) \
== [CorrectedCommand(script='test!', priority=100),
CorrectedCommand(script='test@', priority=200)]
assert (list(rule.get_corrected_commands(Command(script='test')))
== [CorrectedCommand(script='test!', priority=100),
CorrectedCommand(script='test@', priority=200)])
def test_get_corrected_commands_with_rule_returns_command(self):
rule = Rule(get_new_command=lambda x: x.script + '!',
priority=100)
assert list(rule.get_corrected_commands(Command(script='test'))) \
== [CorrectedCommand(script='test!', priority=100)]
assert (list(rule.get_corrected_commands(Command(script='test')))
== [CorrectedCommand(script='test!', priority=100)])
class TestCommand(object):

View File

@ -30,11 +30,11 @@ def test_read_actions(patch_get_key):
const.KEY_DOWN, 'j',
# Ctrl+C:
const.KEY_CTRL_C, 'q'])
assert list(islice(ui.read_actions(), 8)) \
== [const.ACTION_SELECT, const.ACTION_SELECT,
const.ACTION_PREVIOUS, const.ACTION_PREVIOUS,
const.ACTION_NEXT, const.ACTION_NEXT,
const.ACTION_ABORT, const.ACTION_ABORT]
assert (list(islice(ui.read_actions(), 8))
== [const.ACTION_SELECT, const.ACTION_SELECT,
const.ACTION_PREVIOUS, const.ACTION_PREVIOUS,
const.ACTION_NEXT, const.ACTION_NEXT,
const.ACTION_ABORT, const.ACTION_ABORT])
def test_command_selector():
@ -74,8 +74,8 @@ class TestSelectCommand(object):
def test_without_confirmation_with_side_effects(
self, capsys, commands_with_side_effect, settings):
settings.require_confirmation = False
assert ui.select_command(iter(commands_with_side_effect)) \
== commands_with_side_effect[0]
assert (ui.select_command(iter(commands_with_side_effect))
== commands_with_side_effect[0])
assert capsys.readouterr() == ('', 'ls (+side effect)\n')
def test_with_confirmation(self, capsys, patch_get_key, commands):
@ -91,8 +91,8 @@ class TestSelectCommand(object):
def test_with_confirmation_with_side_effct(self, capsys, patch_get_key,
commands_with_side_effect):
patch_get_key(['\n'])
assert ui.select_command(iter(commands_with_side_effect)) \
== commands_with_side_effect[0]
assert (ui.select_command(iter(commands_with_side_effect))
== commands_with_side_effect[0])
assert capsys.readouterr() == ('', u'\x1b[1K\rls (+side effect) [enter/↑/↓/ctrl+c]\n')
def test_with_confirmation_select_second(self, capsys, patch_get_key, commands):

View File

@ -33,8 +33,8 @@ def match(command):
if 'not found' not in command.stderr:
return False
matched_layout = _get_matched_layout(command)
return matched_layout and \
_switch_command(command, matched_layout) != get_alias()
return (matched_layout and
_switch_command(command, matched_layout) != get_alias())
def get_new_command(command):