diff options
Diffstat (limited to 'pylint/checkers/format.py')
-rw-r--r-- | pylint/checkers/format.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py index 0cee7b90b..17a50911c 100644 --- a/pylint/checkers/format.py +++ b/pylint/checkers/format.py @@ -56,7 +56,7 @@ Some parts of the process_token method is based from The Tab Nanny std module. import tokenize from functools import reduce -from typing import List +from typing import TYPE_CHECKING, List from astroid import nodes @@ -71,6 +71,10 @@ from pylint.constants import WarningScope from pylint.interfaces import IAstroidChecker, IRawChecker, ITokenChecker from pylint.utils.pragma_parser import OPTION_PO, PragmaParserError, parse_pragma +if TYPE_CHECKING: + from pylint.lint import PyLinter + + _ASYNC_TOKEN = "async" _KEYWORD_TOKENS = [ "assert", @@ -819,6 +823,5 @@ class FormatChecker(BaseTokenChecker): ) -def register(linter): - """required method to auto register this checker""" +def register(linter: "PyLinter") -> None: linter.register_checker(FormatChecker(linter)) |