1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-21 04:18:55 +00:00

Fix flake8 errors: E305 expected 2 blank lines after class or function definition

This commit is contained in:
Joseph Frazier 2017-03-08 19:53:54 -05:00
parent 78515c7bbb
commit e009f0a05b
9 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,7 @@ def tar_error(tmpdir):
return fixture
parametrize_extensions = pytest.mark.parametrize('ext', tar_extensions)
# (filename as typed by the user, unquoted filename, quoted filename as per shells.quote)

View File

@ -9,6 +9,7 @@ def match(command):
def get_new_command(command):
return ' '.join(command.script_parts[1:])
# it should be rare enough to actually have to type twice the same word, so
# this rule can have a higher priority to come before things like "cd cd foo"
priority = 900

View File

@ -40,6 +40,8 @@ def _make_pattern(pattern):
.replace('{line}', '(?P<line>[0-9]+)') \
.replace('{col}', '(?P<col>[0-9]+)')
return re.compile(pattern, re.MULTILINE)
patterns = [_make_pattern(p).search for p in patterns]

View File

@ -11,6 +11,7 @@ def match(command):
else:
return False
# git's output here is too complicated to be parsed (see the test file)
stash_commands = (
'apply',

View File

@ -6,4 +6,5 @@ def match(command):
def get_new_command(command):
return u'man {}'.format(command.script[3:])
priority = 2000

View File

@ -13,4 +13,5 @@ def get_new_command(command):
return [formatme.format(pacman, package, command.script)
for package in packages]
enabled_by_default, pacman = archlinux_env()

View File

@ -35,6 +35,7 @@ def get_key():
return ch
try:
from pathlib import Path
except ImportError:
@ -44,5 +45,6 @@ except ImportError:
def _expanduser(self):
return self.__class__(os.path.expanduser(str(self)))
if not hasattr(Path, 'expanduser'):
Path.expanduser = _expanduser

View File

@ -26,6 +26,7 @@ def get_key():
encoding = sys.stdout.encoding or os.environ.get('PYTHONIOENCODING', 'utf-8')
return ch.decode(encoding)
try:
from pathlib import Path
except ImportError:
@ -35,5 +36,6 @@ except ImportError:
def _expanduser(self):
return self.__class__(os.path.expanduser(str(self)))
# pathlib's expanduser fails on windows, see http://bugs.python.org/issue19776
Path.expanduser = _expanduser

View File

@ -40,6 +40,8 @@ def memoize(fn):
return value
return wrapper
memoize.disabled = False
@ -238,6 +240,8 @@ def cache(*depends_on):
return value
return _cache
cache.disabled = False