diff options
author | Matus Valo <matusvalo@gmail.com> | 2021-02-20 22:01:03 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2021-02-21 11:41:20 +0100 |
commit | 34cce21d29f9692a34fec22a76bee70939e628a5 (patch) | |
tree | 3641d748277c8d2d0259f3a3bc517173da963702 /examples/deprecation_checker.py | |
parent | 30af955a7434952020416827b2482095866910e4 (diff) | |
download | pylint-git-34cce21d29f9692a34fec22a76bee70939e628a5.tar.gz |
Move message definition to the DeprecatedMixin class
Diffstat (limited to 'examples/deprecation_checker.py')
-rw-r--r-- | examples/deprecation_checker.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/examples/deprecation_checker.py b/examples/deprecation_checker.py index a6a8e3963..7059c89ab 100644 --- a/examples/deprecation_checker.py +++ b/examples/deprecation_checker.py @@ -33,25 +33,17 @@ from pylint.checkers import BaseChecker, DeprecatedMixin, utils from pylint.interfaces import IAstroidChecker -class DeprecationChecker(BaseChecker, DeprecatedMixin): +class DeprecationChecker(DeprecatedMixin, BaseChecker): """Class implementing deprecation checker.""" + # DeprecationMixin class is Mixin class implementing logic for searching deprecated methods and functions. + # The list of deprecated methods/functions is defined by implemeting class via deprecated_methods callback. + # DeprecatedMixin class is overriding attrigutes of BaseChecker hence must be specified *before* BaseChecker + # in list of base classes. + __implements__ = (IAstroidChecker,) # The name defines a custom section of the config for this checker. name = "deprecated" - # This class variable declares the messages (ie the warnings and errors) - # that the checker can emit. - msgs = { - # Each message has a code, a message that the user will see, - # a unique symbol that identifies the message, - # and a detailed help message - # that will be included in the documentation. - "W1505": ( - "Using deprecated method %s()", - "deprecated-method", - "The method is marked as deprecated and will be removed in the future.", - ), - } @utils.check_messages( "deprecated-method", |