1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-31 10:11:14 +00:00

Fix some issues reported by pylint

This commit is contained in:
mcarton 2015-08-17 17:19:16 +02:00
parent 1becd92b12
commit c5e1139879
7 changed files with 7 additions and 8 deletions

View File

@ -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

View File

@ -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)

View File

@ -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:

View File

@ -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):

View File

@ -1,4 +1,4 @@
from thefuck.utils import get_closest, replace_command
from thefuck.utils import replace_command
import re

View File

@ -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):

View File

@ -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(),