diff options
Diffstat (limited to 'pylint/checkers/spelling.py')
-rw-r--r-- | pylint/checkers/spelling.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pylint/checkers/spelling.py b/pylint/checkers/spelling.py index ad6847478..012c396de 100644 --- a/pylint/checkers/spelling.py +++ b/pylint/checkers/spelling.py @@ -33,7 +33,7 @@ import os import re import tokenize -from typing import Pattern +from typing import TYPE_CHECKING, Pattern from astroid import nodes @@ -41,6 +41,9 @@ from pylint.checkers import BaseTokenChecker from pylint.checkers.utils import check_messages from pylint.interfaces import IAstroidChecker, ITokenChecker +if TYPE_CHECKING: + from pylint.lint import PyLinter + try: import enchant from enchant.tokenize import ( @@ -470,6 +473,5 @@ class SpellingChecker(BaseTokenChecker): self._check_spelling("wrong-spelling-in-docstring", line, start_line + idx) -def register(linter): - """required method to auto register this checker""" +def register(linter: "PyLinter") -> None: linter.register_checker(SpellingChecker(linter)) |