diff options
Diffstat (limited to 'pylint/checkers/strings.py')
-rw-r--r-- | pylint/checkers/strings.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pylint/checkers/strings.py b/pylint/checkers/strings.py index 064902b5d..e4dcfc831 100644 --- a/pylint/checkers/strings.py +++ b/pylint/checkers/strings.py @@ -41,7 +41,7 @@ import collections import numbers import re import tokenize -from typing import Counter, Iterable +from typing import TYPE_CHECKING, Counter, Iterable import astroid from astroid import nodes @@ -50,6 +50,9 @@ from pylint.checkers import BaseChecker, BaseTokenChecker, utils from pylint.checkers.utils import check_messages from pylint.interfaces import IAstroidChecker, IRawChecker, ITokenChecker +if TYPE_CHECKING: + from pylint.lint import PyLinter + _AST_NODE_STR_TYPES = ("__builtin__.unicode", "__builtin__.str", "builtins.str") # Prefixes for both strings and bytes literals per # https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals @@ -925,8 +928,7 @@ class StringConstantChecker(BaseTokenChecker): ) -def register(linter): - """required method to auto register this checker""" +def register(linter: "PyLinter") -> None: linter.register_checker(StringFormatChecker(linter)) linter.register_checker(StringConstantChecker(linter)) |