1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-04-19 09:10:47 +01:00

Fix flake8 errors: E126 continuation line over-indented for hanging indent

This commit is contained in:
Joseph Frazier 2016-10-06 14:51:22 -04:00
parent 1b30c00546
commit e0cab4fa1b
20 changed files with 62 additions and 63 deletions

View File

@ -21,8 +21,8 @@ def test_match(brew_unknown_cmd):
def test_get_new_command(brew_unknown_cmd, brew_unknown_cmd2): def test_get_new_command(brew_unknown_cmd, brew_unknown_cmd2):
assert get_new_command(Command('brew inst', stderr=brew_unknown_cmd)) \ assert (get_new_command(Command('brew inst', stderr=brew_unknown_cmd))
== ['brew list', 'brew install', 'brew uninstall'] == ['brew list', 'brew install', 'brew uninstall'])
cmds = get_new_command(Command('brew instaa', stderr=brew_unknown_cmd2)) cmds = get_new_command(Command('brew instaa', stderr=brew_unknown_cmd2))
assert 'brew install' in cmds assert 'brew install' in cmds

View File

@ -48,9 +48,9 @@ def test_match(composer_not_command, composer_not_command_one_of_this):
def test_get_new_command(composer_not_command, composer_not_command_one_of_this): def test_get_new_command(composer_not_command, composer_not_command_one_of_this):
assert get_new_command(Command('composer udpate', assert (get_new_command(Command('composer udpate',
stderr=composer_not_command)) \ stderr=composer_not_command))
== 'composer update' == 'composer update')
assert get_new_command( assert get_new_command(
Command('composer pdate', stderr=composer_not_command_one_of_this)) \ Command('composer pdate', stderr=composer_not_command_one_of_this)) \
== 'composer selfupdate' == 'composer selfupdate'

View File

@ -2,7 +2,7 @@ import os
import pytest import pytest
import tarfile import tarfile
from thefuck.rules.dirty_untar import match, get_new_command, side_effect, \ from thefuck.rules.dirty_untar import match, get_new_command, side_effect, \
tar_extensions tar_extensions # noqa: E126
from tests.utils import Command from tests.utils import Command

View File

@ -39,5 +39,5 @@ def test_match(stderr):
def test_get_new_command(): def test_get_new_command():
assert get_new_command(Command('./manage.py migrate auth')) \ assert (get_new_command(Command('./manage.py migrate auth'))
== './manage.py migrate auth --merge' == './manage.py migrate auth --merge')

View File

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

View File

@ -25,5 +25,5 @@ def test_match(stderr):
def test_get_new_command(stderr): def test_get_new_command(stderr):
assert get_new_command(Command('git pull', stderr=stderr)) \ assert (get_new_command(Command('git pull', stderr=stderr))
== "git branch --set-upstream-to=origin/master master && git pull" == "git branch --set-upstream-to=origin/master master && git pull")

View File

@ -15,5 +15,5 @@ def test_match(stderr):
def test_get_new_command(stderr): def test_get_new_command(stderr):
assert get_new_command(Command('git pull', stderr=stderr)) \ assert (get_new_command(Command('git pull', stderr=stderr))
== "git stash && git pull && git stash pop" == "git stash && git pull && git stash pop")

View File

@ -15,5 +15,5 @@ def test_match(stderr):
def test_get_new_command(stderr): def test_get_new_command(stderr):
assert get_new_command(Command('git pull', stderr=stderr)) \ assert (get_new_command(Command('git pull', stderr=stderr))
== "git stash && git pull && git stash pop" == "git stash && git pull && git stash pop")

View File

@ -19,5 +19,5 @@ def test_match(is_not_task):
def test_get_new_command(is_not_task): def test_get_new_command(is_not_task):
assert get_new_command(Command(script='lein rpl --help', stderr=is_not_task)) \ assert (get_new_command(Command(script='lein rpl --help', stderr=is_not_task))
== ['lein repl --help', 'lein jar --help'] == ['lein repl --help', 'lein jar --help'])

View File

@ -8,5 +8,5 @@ def test_match():
def test_get_new_command(): def test_get_new_command():
assert get_new_command(Command('./test_sudo.py'))\ assert (get_new_command(Command('./test_sudo.py'))
== 'python ./test_sudo.py' == 'python ./test_sudo.py')

View File

@ -17,5 +17,5 @@ def test_not_match(command):
def test_get_new_command(): def test_get_new_command():
assert get_new_command(Command(script='rm -rf /')) \ assert (get_new_command(Command(script='rm -rf /'))
== 'rm -rf / --no-preserve-root' == 'rm -rf / --no-preserve-root')

View File

@ -18,11 +18,11 @@ def test_match(sed_unterminated_s):
def test_get_new_command(sed_unterminated_s): def test_get_new_command(sed_unterminated_s):
assert get_new_command(Command('sed -e s/foo/bar', stderr=sed_unterminated_s)) \ assert (get_new_command(Command('sed -e s/foo/bar', stderr=sed_unterminated_s))
== 'sed -e s/foo/bar/' == 'sed -e s/foo/bar/')
assert get_new_command(Command('sed -es/foo/bar', stderr=sed_unterminated_s)) \ assert (get_new_command(Command('sed -es/foo/bar', stderr=sed_unterminated_s))
== 'sed -es/foo/bar/' == 'sed -es/foo/bar/')
assert get_new_command(Command(r"sed -e 's/\/foo/bar'", stderr=sed_unterminated_s)) \ assert (get_new_command(Command(r"sed -e 's/\/foo/bar'", stderr=sed_unterminated_s))
== r"sed -e 's/\/foo/bar/'" == r"sed -e 's/\/foo/bar/'")
assert get_new_command(Command(r"sed -e s/foo/bar -es/baz/quz", stderr=sed_unterminated_s)) \ assert (get_new_command(Command(r"sed -e s/foo/bar -es/baz/quz", stderr=sed_unterminated_s))
== r"sed -e s/foo/bar/ -es/baz/quz/" == r"sed -e s/foo/bar/ -es/baz/quz/")

View File

@ -13,10 +13,10 @@ from thefuck.system import Path
class TestCorrectedCommand(object): class TestCorrectedCommand(object):
def test_equality(self): def test_equality(self):
assert CorrectedCommand('ls', None, 100) == \ assert (CorrectedCommand('ls', None, 100) ==
CorrectedCommand('ls', None, 200) CorrectedCommand('ls', None, 200))
assert CorrectedCommand('ls', None, 100) != \ assert (CorrectedCommand('ls', None, 100) !=
CorrectedCommand('ls', lambda *_: _, 100) CorrectedCommand('ls', lambda *_: _, 100))
def test_hashable(self): def test_hashable(self):
assert {CorrectedCommand('ls', None, 100), assert {CorrectedCommand('ls', None, 100),

View File

@ -59,8 +59,7 @@ def how_to_configure_alias():
def main(): def main():
parser = ArgumentParser(prog='thefuck') parser = ArgumentParser(prog='thefuck')
version = get_installation_info().version version = get_installation_info().version
parser.add_argument( parser.add_argument('-v', '--version',
'-v', '--version',
action='version', action='version',
version='The Fuck {} using Python {}'.format( version='The Fuck {} using Python {}'.format(
version, sys.version.split()[0])) version, sys.version.split()[0]))

View File

@ -54,8 +54,8 @@ def _brew_commands():
brew_path_prefix = get_brew_path_prefix() brew_path_prefix = get_brew_path_prefix()
if brew_path_prefix: if brew_path_prefix:
try: try:
return _get_brew_commands(brew_path_prefix) \ return (_get_brew_commands(brew_path_prefix)
+ _get_brew_tap_specific_commands(brew_path_prefix) + _get_brew_tap_specific_commands(brew_path_prefix))
except OSError: except OSError:
pass pass

View File

@ -26,7 +26,7 @@ def get_new_command(command):
available = _get_all_environments() available = _get_all_environments()
if available: if available:
return replace_command(command, misspelled_env, available) \ return (replace_command(command, misspelled_env, available)
+ [create_new] + [create_new])
else: else:
return create_new return create_new

View File

@ -39,8 +39,8 @@ class Command(object):
def __eq__(self, other): def __eq__(self, other):
if isinstance(other, Command): if isinstance(other, Command):
return (self.script, self.stdout, self.stderr) \ return ((self.script, self.stdout, self.stderr)
== (other.script, other.stdout, other.stderr) == (other.script, other.stdout, other.stderr))
else: else:
return False return False
@ -158,12 +158,12 @@ class Rule(object):
def __eq__(self, other): def __eq__(self, other):
if isinstance(other, Rule): if isinstance(other, Rule):
return (self.name, self.match, self.get_new_command, return ((self.name, self.match, self.get_new_command,
self.enabled_by_default, self.side_effect, self.enabled_by_default, self.side_effect,
self.priority, self.requires_output) \ self.priority, self.requires_output)
== (other.name, other.match, other.get_new_command, == (other.name, other.match, other.get_new_command,
other.enabled_by_default, other.side_effect, other.enabled_by_default, other.side_effect,
other.priority, other.requires_output) other.priority, other.requires_output))
else: else:
return False return False