summaryrefslogtreecommitdiff
path: root/pylint/utils.py
diff options
context:
space:
mode:
authorClaudiu Popa <cpopa@cloudbasesolutions.com>2015-05-05 12:16:50 +0300
committerClaudiu Popa <cpopa@cloudbasesolutions.com>2015-05-05 12:16:50 +0300
commita76e32c89588be85f24b21fcdd23604e2ea9ce99 (patch)
treed08b1458c8a6cd2013f0a6edeb598f48c5b9b575 /pylint/utils.py
parent68fee0184aa4aa45f64f287b44ab940e7d3fb730 (diff)
downloadpylint-a76e32c89588be85f24b21fcdd23604e2ea9ce99.tar.gz
Make ignore-iface-methods a noop option, mark it as deprecated.
Diffstat (limited to 'pylint/utils.py')
-rw-r--r--pylint/utils.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/pylint/utils.py b/pylint/utils.py
index c91497a..d2c9ed8 100644
--- a/pylint/utils.py
+++ b/pylint/utils.py
@@ -925,3 +925,19 @@ def get_global_option(checker, option, default=None):
if options[0] == option:
return getattr(provider.config, option.replace("-", "_"))
return default
+
+
+def deprecated_option(shortname=None, opt_type=None, help_msg=None):
+ def _warn_deprecated(option, optname, *args): # pylint: disable=unused-argument
+ sys.stderr.write('Warning: option %s is deprecated and ignored.\n' % (optname,))
+
+ option = {
+ 'help': help_msg,
+ 'hide': True,
+ 'type': opt_type,
+ 'action': 'callback',
+ 'callback': _warn_deprecated
+ }
+ if shortname:
+ option['shortname'] = shortname
+ return option