mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-31 07:04:12 +00:00 
			
		
		
		
	Fix some issues reported by pylint
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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) | ||||
|   | ||||
| @@ -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: | ||||
|   | ||||
| @@ -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): | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| from thefuck.utils import get_closest, replace_command | ||||
| from thefuck.utils import replace_command | ||||
| import re | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -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): | ||||
|   | ||||
| @@ -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(), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user