aboutsummaryrefslogtreecommitdiff
path: root/pylint/reporters/__init__.py
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2021-09-16 11:03:37 +0200
committerGitHub <noreply@github.com>2021-09-16 11:03:37 +0200
commitdc0c7e97b1e92beffa36f76c5c56164f69b81a2a (patch)
tree589ce577ea9cc1bc9d33b40bdd208e708a98f538 /pylint/reporters/__init__.py
parent14f4db56c00cd34ddd60fe9498823806abd6b3f9 (diff)
downloadpylint-dc0c7e97b1e92beffa36f76c5c56164f69b81a2a.tar.gz
Add typing in ``pylint.reporters`` (#5004)
* Add typing and fix small issue in pylint.reporters Fix typing error in pylint/checkers/imports.py. Add typing of report related code outside of pylint.reporters. * Remove unused argument in pylint.reporters.VNode constructor * Simplify and specify the typing in reporters nodes Co-authored-by: Daniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>
Diffstat (limited to 'pylint/reporters/__init__.py')
-rw-r--r--pylint/reporters/__init__.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pylint/reporters/__init__.py b/pylint/reporters/__init__.py
index 79b13e083..39cf5fb0a 100644
--- a/pylint/reporters/__init__.py
+++ b/pylint/reporters/__init__.py
@@ -21,7 +21,7 @@
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
"""utilities methods and classes for reporters"""
-
+from typing import TYPE_CHECKING
from pylint import utils
from pylint.reporters.base_reporter import BaseReporter
@@ -30,10 +30,13 @@ from pylint.reporters.json_reporter import JSONReporter
from pylint.reporters.multi_reporter import MultiReporter
from pylint.reporters.reports_handler_mix_in import ReportsHandlerMixIn
+if TYPE_CHECKING:
+ from pylint.lint.pylinter import PyLinter
+
-def initialize(linter):
+def initialize(linter: "PyLinter") -> None:
"""initialize linter with reporters in this package"""
- utils.register_plugins(linter, __path__[0])
+ utils.register_plugins(linter, __path__[0]) # type: ignore # Fixed in https://github.com/python/mypy/pull/9454
__all__ = [