summaryrefslogtreecommitdiff
path: root/pylint/checkers/similar.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-12-27 21:30:34 +0100
committerGitHub <noreply@github.com>2021-12-27 21:30:34 +0100
commit7d2584251552283bf95893019e74dad0390dc65c (patch)
tree7b5b8fa573a94d73b97741789a3e1fe35c7e7824 /pylint/checkers/similar.py
parent691b41b3ddd3b533bce4d6a1f03ebc1e5cacf508 (diff)
downloadpylint-git-7d2584251552283bf95893019e74dad0390dc65c.tar.gz
Add typing and uniformize the checker registering in Pylinter (#5558)
Remove verbose docstring in code, keep them in example and doc Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Diffstat (limited to 'pylint/checkers/similar.py')
-rw-r--r--pylint/checkers/similar.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py
index cadee9f70..51ec27c0b 100644
--- a/pylint/checkers/similar.py
+++ b/pylint/checkers/similar.py
@@ -52,6 +52,7 @@ from getopt import getopt
from io import BufferedIOBase, BufferedReader, BytesIO
from itertools import chain, groupby
from typing import (
+ TYPE_CHECKING,
Any,
Dict,
FrozenSet,
@@ -75,6 +76,9 @@ from pylint.interfaces import IRawChecker
from pylint.reporters.ureports.nodes import Table
from pylint.utils import LinterStats, decoding_stream
+if TYPE_CHECKING:
+ from pylint.lint import PyLinter
+
DEFAULT_MIN_SIMILARITY_LINE = 4
REGEX_FOR_LINES_WITH_CONTENT = re.compile(r".*\w+")
@@ -879,8 +883,7 @@ class SimilarChecker(BaseChecker, Similar, MapReduceMixin):
recombined.close()
-def register(linter):
- """required method to auto register this checker"""
+def register(linter: "PyLinter") -> None:
linter.register_checker(SimilarChecker(linter))