mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-31 07:04:12 +00:00 
			
		
		
		
	Fix flake8 errors: E126 continuation line over-indented for hanging indent
This commit is contained in:
		| @@ -21,8 +21,8 @@ def test_match(brew_unknown_cmd): | ||||
|  | ||||
|  | ||||
| def test_get_new_command(brew_unknown_cmd, brew_unknown_cmd2): | ||||
|     assert get_new_command(Command('brew inst', stderr=brew_unknown_cmd)) \ | ||||
|            == ['brew list', 'brew install', 'brew uninstall'] | ||||
|     assert (get_new_command(Command('brew inst', stderr=brew_unknown_cmd)) | ||||
|             == ['brew list', 'brew install', 'brew uninstall']) | ||||
|  | ||||
|     cmds = get_new_command(Command('brew instaa', stderr=brew_unknown_cmd2)) | ||||
|     assert 'brew install' in cmds | ||||
|   | ||||
| @@ -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): | ||||
|     assert get_new_command(Command('composer udpate', | ||||
|                                    stderr=composer_not_command)) \ | ||||
|            == 'composer update' | ||||
|     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' | ||||
|   | ||||
| @@ -2,7 +2,7 @@ import os | ||||
| import pytest | ||||
| import tarfile | ||||
| from thefuck.rules.dirty_untar import match, get_new_command, side_effect, \ | ||||
|                                       tar_extensions | ||||
|                                       tar_extensions  # noqa: E126 | ||||
| from tests.utils import Command | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -39,5 +39,5 @@ def test_match(stderr): | ||||
|  | ||||
|  | ||||
| def test_get_new_command(): | ||||
|     assert get_new_command(Command('./manage.py migrate auth')) \ | ||||
|            == './manage.py migrate auth --merge' | ||||
|     assert (get_new_command(Command('./manage.py migrate auth')) | ||||
|             == './manage.py migrate auth --merge') | ||||
|   | ||||
| @@ -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, | ||||
|                          git_not_command_closest): | ||||
|     assert get_new_command(Command('git brnch', stderr=git_not_command)) \ | ||||
|            == ['git branch'] | ||||
|     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)) \ | ||||
|   | ||||
| @@ -25,5 +25,5 @@ def test_match(stderr): | ||||
|  | ||||
|  | ||||
| def test_get_new_command(stderr): | ||||
|     assert get_new_command(Command('git pull', stderr=stderr)) \ | ||||
|            == "git branch --set-upstream-to=origin/master master && git pull" | ||||
|     assert (get_new_command(Command('git pull', stderr=stderr)) | ||||
|             == "git branch --set-upstream-to=origin/master master && git pull") | ||||
|   | ||||
| @@ -15,5 +15,5 @@ def test_match(stderr): | ||||
|  | ||||
|  | ||||
| def test_get_new_command(stderr): | ||||
|     assert get_new_command(Command('git pull', stderr=stderr)) \ | ||||
|            == "git stash && git pull && git stash pop" | ||||
|     assert (get_new_command(Command('git pull', stderr=stderr)) | ||||
|             == "git stash && git pull && git stash pop") | ||||
|   | ||||
| @@ -15,5 +15,5 @@ def test_match(stderr): | ||||
|  | ||||
|  | ||||
| def test_get_new_command(stderr): | ||||
|     assert get_new_command(Command('git pull', stderr=stderr)) \ | ||||
|            == "git stash && git pull && git stash pop" | ||||
|     assert (get_new_command(Command('git pull', stderr=stderr)) | ||||
|             == "git stash && git pull && git stash pop") | ||||
|   | ||||
| @@ -4,14 +4,14 @@ from tests.utils import Command | ||||
|  | ||||
|  | ||||
| cherry_pick_error = ( | ||||
|         'error: Your local changes would be overwritten by cherry-pick.\n' | ||||
|         'hint: Commit your changes or stash them to proceed.\n' | ||||
|         'fatal: cherry-pick failed') | ||||
|     'error: Your local changes would be overwritten by cherry-pick.\n' | ||||
|     'hint: Commit your changes or stash them to proceed.\n' | ||||
|     'fatal: cherry-pick failed') | ||||
|  | ||||
|  | ||||
| rebase_error = ( | ||||
|         'Cannot rebase: Your index contains uncommitted changes.\n' | ||||
|         'Please commit or stash them.') | ||||
|     'Cannot rebase: Your index contains uncommitted changes.\n' | ||||
|     'Please commit or stash them.') | ||||
|  | ||||
|  | ||||
| @pytest.mark.parametrize('command', [ | ||||
|   | ||||
| @@ -19,5 +19,5 @@ def test_match(is_not_task): | ||||
|  | ||||
|  | ||||
| def test_get_new_command(is_not_task): | ||||
|     assert get_new_command(Command(script='lein rpl --help', stderr=is_not_task)) \ | ||||
|            == ['lein repl --help', 'lein jar --help'] | ||||
|     assert (get_new_command(Command(script='lein rpl --help', stderr=is_not_task)) | ||||
|             == ['lein repl --help', 'lein jar --help']) | ||||
|   | ||||
| @@ -8,5 +8,5 @@ def test_match(): | ||||
|  | ||||
|  | ||||
| def test_get_new_command(): | ||||
|     assert get_new_command(Command('./test_sudo.py'))\ | ||||
|            == 'python ./test_sudo.py' | ||||
|     assert (get_new_command(Command('./test_sudo.py')) | ||||
|             == 'python ./test_sudo.py') | ||||
|   | ||||
| @@ -17,5 +17,5 @@ def test_not_match(command): | ||||
|  | ||||
|  | ||||
| def test_get_new_command(): | ||||
|     assert get_new_command(Command(script='rm -rf /')) \ | ||||
|            == 'rm -rf / --no-preserve-root' | ||||
|     assert (get_new_command(Command(script='rm -rf /')) | ||||
|             == 'rm -rf / --no-preserve-root') | ||||
|   | ||||
| @@ -18,11 +18,11 @@ def test_match(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)) \ | ||||
|             == 'sed -e s/foo/bar/' | ||||
|     assert get_new_command(Command('sed -es/foo/bar', stderr=sed_unterminated_s)) \ | ||||
|             == 'sed -es/foo/bar/' | ||||
|     assert get_new_command(Command(r"sed -e 's/\/foo/bar'", stderr=sed_unterminated_s)) \ | ||||
|             == r"sed -e 's/\/foo/bar/'" | ||||
|     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/" | ||||
|     assert (get_new_command(Command('sed -e s/foo/bar', stderr=sed_unterminated_s)) | ||||
|             == 'sed -e s/foo/bar/') | ||||
|     assert (get_new_command(Command('sed -es/foo/bar', stderr=sed_unterminated_s)) | ||||
|             == 'sed -es/foo/bar/') | ||||
|     assert (get_new_command(Command(r"sed -e 's/\/foo/bar'", stderr=sed_unterminated_s)) | ||||
|             == r"sed -e 's/\/foo/bar/'") | ||||
|     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/") | ||||
|   | ||||
| @@ -13,10 +13,10 @@ from thefuck.system import Path | ||||
| class TestCorrectedCommand(object): | ||||
|  | ||||
|     def test_equality(self): | ||||
|         assert CorrectedCommand('ls', None, 100) == \ | ||||
|                CorrectedCommand('ls', None, 200) | ||||
|         assert CorrectedCommand('ls', None, 100) != \ | ||||
|                CorrectedCommand('ls', lambda *_: _, 100) | ||||
|         assert (CorrectedCommand('ls', None, 100) == | ||||
|                 CorrectedCommand('ls', None, 200)) | ||||
|         assert (CorrectedCommand('ls', None, 100) != | ||||
|                 CorrectedCommand('ls', lambda *_: _, 100)) | ||||
|  | ||||
|     def test_hashable(self): | ||||
|         assert {CorrectedCommand('ls', None, 100), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user