mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-31 15:12:20 +00:00 
			
		
		
		
	Fix some issues reported by pylint
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
| from itertools import dropwhile, takewhile, islice | from itertools import dropwhile, takewhile, islice | ||||||
| import re | import re | ||||||
| import subprocess | import subprocess | ||||||
| from thefuck.utils import get_closest, sudo_support, replace_argument, replace_command | from thefuck.utils import sudo_support, replace_command | ||||||
|  |  | ||||||
|  |  | ||||||
| @sudo_support | @sudo_support | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ def match(command, settings): | |||||||
| def get_new_command(command, settings): | def get_new_command(command, settings): | ||||||
|     missing_file = re.findall( |     missing_file = re.findall( | ||||||
|             r"error: pathspec '([^']*)' " |             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 -- {}', '{}') |     formatme = shells.and_('git add -- {}', '{}') | ||||||
|     return formatme.format(missing_file, command.script) |     return formatme.format(missing_file, command.script) | ||||||
|   | |||||||
| @@ -27,7 +27,7 @@ def get_branches(): | |||||||
| def get_new_command(command, settings): | def get_new_command(command, settings): | ||||||
|     missing_file = re.findall( |     missing_file = re.findall( | ||||||
|         r"error: pathspec '([^']*)' " |         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(), |     closest_branch = utils.get_closest(missing_file, get_branches(), | ||||||
|                                        fallback_to_first=False) |                                        fallback_to_first=False) | ||||||
|     if closest_branch: |     if closest_branch: | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| def match(command, settings): | def match(command, settings): | ||||||
|     return (command.script == 'ls' |     return (command.script == 'ls' | ||||||
|             or command.script.startswith('ls ') |             or command.script.startswith('ls ') | ||||||
|             and not ('ls -' in command.script)) |             and 'ls -' not in command.script) | ||||||
|  |  | ||||||
|  |  | ||||||
| def get_new_command(command, settings): | 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 | import re | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,6 +1,5 @@ | |||||||
| import re | import re | ||||||
| from thefuck.utils import (get_closest, replace_argument, | from thefuck.utils import get_all_matched_commands, replace_command | ||||||
|                            get_all_matched_commands, replace_command) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| def match(command, settings): | def match(command, settings): | ||||||
|   | |||||||
| @@ -216,7 +216,7 @@ class Tcsh(Generic): | |||||||
|         return u'#+{}\n{}\n'.format(int(time()), command_script) |         return u'#+{}\n{}\n'.format(int(time()), command_script) | ||||||
|  |  | ||||||
|  |  | ||||||
| shells = defaultdict(lambda: Generic(), { | shells = defaultdict(Generic, { | ||||||
|     'bash': Bash(), |     'bash': Bash(), | ||||||
|     'fish': Fish(), |     'fish': Fish(), | ||||||
|     'zsh': Zsh(), |     'zsh': Zsh(), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user