summaryrefslogtreecommitdiff
path: root/pylint/extensions/check_elif.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/extensions/check_elif.py')
-rw-r--r--pylint/extensions/check_elif.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/pylint/extensions/check_elif.py b/pylint/extensions/check_elif.py
index f70b43684..b4658577e 100644
--- a/pylint/extensions/check_elif.py
+++ b/pylint/extensions/check_elif.py
@@ -12,12 +12,17 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
+from typing import TYPE_CHECKING
+
from astroid import nodes
from pylint.checkers import BaseTokenChecker
from pylint.checkers.utils import check_messages
from pylint.interfaces import HIGH, IAstroidChecker, ITokenChecker
+if TYPE_CHECKING:
+ from pylint.lint import PyLinter
+
class ElseifUsedChecker(BaseTokenChecker):
"""Checks for use of "else if" when an "elif" could be used"""
@@ -62,10 +67,5 @@ class ElseifUsedChecker(BaseTokenChecker):
self.add_message("else-if-used", node=node, confidence=HIGH)
-def register(linter):
- """Required method to auto register this checker.
-
- :param linter: Main interface object for Pylint plugins
- :type linter: Pylint object
- """
+def register(linter: "PyLinter") -> None:
linter.register_checker(ElseifUsedChecker(linter))