diff --git a/thefuck/rules/docker_not_command.py b/thefuck/rules/docker_not_command.py index d866ee27..1c7e84c6 100644 --- a/thefuck/rules/docker_not_command.py +++ b/thefuck/rules/docker_not_command.py @@ -1,7 +1,7 @@ from itertools import dropwhile, takewhile, islice import re import subprocess -from thefuck.utils import get_closest, sudo_support, replace_argument, replace_command +from thefuck.utils import sudo_support, replace_command @sudo_support diff --git a/thefuck/rules/git_add.py b/thefuck/rules/git_add.py index 10415d91..cb92e804 100644 --- a/thefuck/rules/git_add.py +++ b/thefuck/rules/git_add.py @@ -12,7 +12,7 @@ def match(command, settings): def get_new_command(command, settings): missing_file = re.findall( r"error: pathspec '([^']*)' " - "did not match any file\(s\) known to git.", command.stderr)[0] + r"did not match any file\(s\) known to git.", command.stderr)[0] formatme = shells.and_('git add -- {}', '{}') return formatme.format(missing_file, command.script) diff --git a/thefuck/rules/git_checkout.py b/thefuck/rules/git_checkout.py index afff835a..b883fca6 100644 --- a/thefuck/rules/git_checkout.py +++ b/thefuck/rules/git_checkout.py @@ -27,7 +27,7 @@ def get_branches(): def get_new_command(command, settings): missing_file = re.findall( r"error: pathspec '([^']*)' " - "did not match any file\(s\) known to git.", command.stderr)[0] + r"did not match any file\(s\) known to git.", command.stderr)[0] closest_branch = utils.get_closest(missing_file, get_branches(), fallback_to_first=False) if closest_branch: diff --git a/thefuck/rules/ls_lah.py b/thefuck/rules/ls_lah.py index 70f6baab..580744bb 100644 --- a/thefuck/rules/ls_lah.py +++ b/thefuck/rules/ls_lah.py @@ -1,7 +1,7 @@ def match(command, settings): return (command.script == 'ls' or command.script.startswith('ls ') - and not ('ls -' in command.script)) + and 'ls -' not in command.script) def get_new_command(command, settings): diff --git a/thefuck/rules/tmux.py b/thefuck/rules/tmux.py index d58ae37a..2ba446e3 100644 --- a/thefuck/rules/tmux.py +++ b/thefuck/rules/tmux.py @@ -1,4 +1,4 @@ -from thefuck.utils import get_closest, replace_command +from thefuck.utils import replace_command import re diff --git a/thefuck/rules/tsuru_not_command.py b/thefuck/rules/tsuru_not_command.py index e3f1e4cf..86b4d15f 100644 --- a/thefuck/rules/tsuru_not_command.py +++ b/thefuck/rules/tsuru_not_command.py @@ -1,6 +1,5 @@ import re -from thefuck.utils import (get_closest, replace_argument, - get_all_matched_commands, replace_command) +from thefuck.utils import get_all_matched_commands, replace_command def match(command, settings): diff --git a/thefuck/shells.py b/thefuck/shells.py index 6c7a7baa..400d705f 100644 --- a/thefuck/shells.py +++ b/thefuck/shells.py @@ -216,7 +216,7 @@ class Tcsh(Generic): return u'#+{}\n{}\n'.format(int(time()), command_script) -shells = defaultdict(lambda: Generic(), { +shells = defaultdict(Generic, { 'bash': Bash(), 'fish': Fish(), 'zsh': Zsh(),