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

Use spaces instead of tabs

The is more common in python and follows other rules usage.
This commit is contained in:
mcarton 2015-06-26 14:08:25 +02:00
parent 40fe604adc
commit 7173e0dbad
10 changed files with 64 additions and 64 deletions

View File

@ -4,12 +4,12 @@ from tests.utils import Command
@pytest.mark.parametrize('command', [ @pytest.mark.parametrize('command', [
Command(script='brew upgrade')]) Command(script='brew upgrade')])
def test_match(command): def test_match(command):
assert match(command, None) assert match(command, None)
@pytest.mark.parametrize('command, new_command', [ @pytest.mark.parametrize('command, new_command', [
(Command('brew upgrade'), 'brew upgrade --all')]) (Command('brew upgrade'), 'brew upgrade --all')])
def test_get_new_command(command, new_command): def test_get_new_command(command, new_command):
assert get_new_command(command, None) == new_command assert get_new_command(command, None) == new_command

View File

@ -4,14 +4,14 @@ from tests.utils import Command
@pytest.mark.parametrize('command', [ @pytest.mark.parametrize('command', [
Command(script='go run foo'), Command(script='go run foo'),
Command(script='go run bar')]) Command(script='go run bar')])
def test_match(command): def test_match(command):
assert match(command, None) assert match(command, None)
@pytest.mark.parametrize('command, new_command', [ @pytest.mark.parametrize('command, new_command', [
(Command('go run foo'), 'go run foo.go'), (Command('go run foo'), 'go run foo.go'),
(Command('go run bar'), 'go run bar.go')]) (Command('go run bar'), 'go run bar.go')])
def test_get_new_command(command, new_command): def test_get_new_command(command, new_command):
assert get_new_command(command, None) == new_command assert get_new_command(command, None) == new_command

View File

@ -4,14 +4,14 @@ from tests.utils import Command
@pytest.mark.parametrize('command', [ @pytest.mark.parametrize('command', [
Command(script='java foo.java'), Command(script='java foo.java'),
Command(script='java bar.java')]) Command(script='java bar.java')])
def test_match(command): def test_match(command):
assert match(command, None) assert match(command, None)
@pytest.mark.parametrize('command, new_command', [ @pytest.mark.parametrize('command, new_command', [
(Command('java foo.java'), 'java foo'), (Command('java foo.java'), 'java foo'),
(Command('java bar.java'), 'java bar')]) (Command('java bar.java'), 'java bar')])
def test_get_new_command(command, new_command): def test_get_new_command(command, new_command):
assert get_new_command(command, None) == new_command assert get_new_command(command, None) == new_command

View File

@ -4,14 +4,14 @@ from tests.utils import Command
@pytest.mark.parametrize('command', [ @pytest.mark.parametrize('command', [
Command(script='javac foo'), Command(script='javac foo'),
Command(script='javac bar')]) Command(script='javac bar')])
def test_match(command): def test_match(command):
assert match(command, None) assert match(command, None)
@pytest.mark.parametrize('command, new_command', [ @pytest.mark.parametrize('command, new_command', [
(Command('javac foo'), 'javac foo.java'), (Command('javac foo'), 'javac foo.java'),
(Command('javac bar'), 'javac bar.java')]) (Command('javac bar'), 'javac bar.java')])
def test_get_new_command(command, new_command): def test_get_new_command(command, new_command):
assert get_new_command(command, None) == new_command assert get_new_command(command, None) == new_command

View File

@ -4,22 +4,22 @@ from tests.utils import Command
@pytest.mark.parametrize('command', [ @pytest.mark.parametrize('command', [
Command(script='open foo.com'), Command(script='open foo.com'),
Command(script='open foo.ly'), Command(script='open foo.ly'),
Command(script='open foo.org'), Command(script='open foo.org'),
Command(script='open foo.net'), Command(script='open foo.net'),
Command(script='open foo.se'), Command(script='open foo.se'),
Command(script='open foo.io')]) Command(script='open foo.io')])
def test_match(command): def test_match(command):
assert match(command, None) assert match(command, None)
@pytest.mark.parametrize('command, new_command', [ @pytest.mark.parametrize('command, new_command', [
(Command('open foo.com'), 'open http://foo.com'), (Command('open foo.com'), 'open http://foo.com'),
(Command('open foo.ly'), 'open http://foo.ly'), (Command('open foo.ly'), 'open http://foo.ly'),
(Command('open foo.org'), 'open http://foo.org'), (Command('open foo.org'), 'open http://foo.org'),
(Command('open foo.net'), 'open http://foo.net'), (Command('open foo.net'), 'open http://foo.net'),
(Command('open foo.se'), 'open http://foo.se'), (Command('open foo.se'), 'open http://foo.se'),
(Command('open foo.io'), 'open http://foo.io')]) (Command('open foo.io'), 'open http://foo.io')])
def test_get_new_command(command, new_command): def test_get_new_command(command, new_command):
assert get_new_command(command, None) == new_command assert get_new_command(command, None) == new_command

View File

@ -4,14 +4,14 @@ from tests.utils import Command
@pytest.mark.parametrize('command', [ @pytest.mark.parametrize('command', [
Command(script='python foo'), Command(script='python foo'),
Command(script='python bar')]) Command(script='python bar')])
def test_match(command): def test_match(command):
assert match(command, None) assert match(command, None)
@pytest.mark.parametrize('command, new_command', [ @pytest.mark.parametrize('command, new_command', [
(Command('python foo'), 'python foo.py'), (Command('python foo'), 'python foo.py'),
(Command('python bar'), 'python bar.py')]) (Command('python bar'), 'python bar.py')])
def test_get_new_command(command, new_command): def test_get_new_command(command, new_command):
assert get_new_command(command, None) == new_command assert get_new_command(command, None) == new_command

View File

@ -4,16 +4,16 @@ from tests.utils import Command
@pytest.mark.parametrize('command', [ @pytest.mark.parametrize('command', [
Command(script="git commit -m \'My Message\""), Command(script="git commit -m \'My Message\""),
Command(script="git commit -am \"Mismatched Quotation Marks\'"), Command(script="git commit -am \"Mismatched Quotation Marks\'"),
Command(script="echo \"hello\'")]) Command(script="echo \"hello\'")])
def test_match(command): def test_match(command):
assert match(command, None) assert match(command, None)
@pytest.mark.parametrize('command, new_command', [ @pytest.mark.parametrize('command, new_command', [
(Command("git commit -m \'My Message\""), "git commit -m \"My Message\""), (Command("git commit -m \'My Message\""), "git commit -m \"My Message\""),
(Command("git commit -am \"Mismatched Quotation Marks\'"), "git commit -am \"Mismatched Quotation Marks\""), (Command("git commit -am \"Mismatched Quotation Marks\'"), "git commit -am \"Mismatched Quotation Marks\""),
(Command("echo \"hello\'"), "echo \"hello\"")]) (Command("echo \"hello\'"), "echo \"hello\"")])
def test_get_new_command(command, new_command): def test_get_new_command(command, new_command):
assert get_new_command(command, None) == new_command assert get_new_command(command, None) == new_command

View File

@ -1,13 +1,14 @@
# Fixes common java command mistake # Fixes common java command mistake
# #
# Example: # Example:
# > java foo.java # > java foo.java
# Error: Could not find or load main class foo.java # Error: Could not find or load main class foo.java
#
def match(command, settings): def match(command, settings):
return (command.script.startswith ('java ') return (command.script.startswith('java ')
and command.script.endswith ('.java')) and command.script.endswith('.java'))
def get_new_command(command, settings): def get_new_command(command, settings):
return command.script[:-5] return command.script[:-5]

View File

@ -1,15 +1,15 @@
# Appends .java when compiling java files # Appends .java when compiling java files
# #
# Example: # Example:
# > javac foo # > javac foo
# error: Class names, 'foo', are only accepted if annotation # error: Class names, 'foo', are only accepted if annotation
# processing is explicitly requested # processing is explicitly requested
#
#
def match(command, settings): def match(command, settings):
return (command.script.startswith ('javac ') return (command.script.startswith('javac ')
and not command.script.endswith('.java')) and not command.script.endswith('.java'))
def get_new_command(command, settings): def get_new_command(command, settings):
return command.script + '.java' return command.script + '.java'

View File

@ -1,15 +1,14 @@
# Appends .py when compiling python files # Appends .py when compiling python files
# #
# Example: # Example:
# > python foo # > python foo
# error: python: can't open file 'foo': [Errno 2] No such file or directory # error: python: can't open file 'foo': [Errno 2] No such file or directory
#
#
def match(command, settings): def match(command, settings):
return (command.script.startswith ('python ') return (command.script.startswith('python ')
and not command.script.endswith('.py')) and not command.script.endswith('.py'))
def get_new_command(command, settings): def get_new_command(command, settings):
return command.script + '.py' return command.script + '.py'