summaryrefslogtreecommitdiff
path: root/pylint/utils.py
diff options
context:
space:
mode:
authorCosmin Poieana <cmin@ropython.org>2015-05-08 11:57:29 +0300
committerCosmin Poieana <cmin@ropython.org>2015-05-08 11:57:29 +0300
commit86b3f90914712dfda6dc1cc66e76fd28e03c9c50 (patch)
tree3b477b254fe9f8d7378a8b92d00b77daf5c61b07 /pylint/utils.py
parent87ecb9516898b2ad1dfc93d4672c90acec34130a (diff)
parent28a2583708f2ca51d3d237dd69e91b91aafdafd2 (diff)
downloadpylint-86b3f90914712dfda6dc1cc66e76fd28e03c9c50.tar.gz
Merge
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