#N/A: Remove old-style rules support

This commit is contained in:
Vladimir Iakovlev
2016-08-14 14:37:32 +03:00
parent c63e0d1582
commit 46cb87615e
3 changed files with 4 additions and 77 deletions
-22
View File
@@ -9,7 +9,6 @@ from contextlib import closing
from decorator import decorator
from difflib import get_close_matches
from functools import wraps
from inspect import getargspec
try:
from pathlib import Path
except ImportError:
@@ -245,27 +244,6 @@ def cache(*depends_on):
cache.disabled = False
def compatibility_call(fn, *args):
"""Special call for compatibility with user-defined old-style rules
with `settings` param.
"""
fn_args_count = len(getargspec(fn).args)
if fn.__name__ in ('match', 'get_new_command') and fn_args_count == 2:
warn("Two arguments `{}` from rule `{}` is deprecated, please "
"remove `settings` argument and use "
"`from thefuck.conf import settings` instead."
.format(fn.__name__, fn.__module__))
args += (settings,)
if fn.__name__ == 'side_effect' and fn_args_count == 3:
warn("Three arguments `side_effect` from rule `{}` is deprecated, "
"please remove `settings` argument and use `from thefuck.conf "
"import settings` instead."
.format(fn.__name__, fn.__module__))
args += (settings,)
return fn(*args)
def get_installation_info():
return pkg_resources.require('thefuck')[0]