diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-05 12:16:50 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-05 12:16:50 +0300 |
commit | a76e32c89588be85f24b21fcdd23604e2ea9ce99 (patch) | |
tree | d08b1458c8a6cd2013f0a6edeb598f48c5b9b575 /pylint/utils.py | |
parent | 68fee0184aa4aa45f64f287b44ab940e7d3fb730 (diff) | |
download | pylint-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.py | 16 |
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 |