summaryrefslogtreecommitdiff
path: root/pylint/interfaces.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/interfaces.py
parent14f4db56c00cd34ddd60fe9498823806abd6b3f9 (diff)
downloadpylint-git-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/interfaces.py')
-rw-r--r--pylint/interfaces.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pylint/interfaces.py b/pylint/interfaces.py
index cac7e76c3..2e1ca6da5 100644
--- a/pylint/interfaces.py
+++ b/pylint/interfaces.py
@@ -17,6 +17,7 @@
"""Interfaces for Pylint objects"""
from collections import namedtuple
+from typing import Tuple
from astroid import nodes
@@ -40,7 +41,7 @@ class Interface:
return implements(instance, cls)
-def implements(obj, interface):
+def implements(obj: "Interface", interface: Tuple[type, type]) -> bool:
"""Return true if the give object (maybe an instance or class) implements
the interface.
"""
@@ -101,4 +102,4 @@ class IReporter(Interface):
"""display results encapsulated in the layout tree"""
-__all__ = ("IRawChecker", "IAstroidChecker", "ITokenChecker", "IReporter")
+__all__ = ("IRawChecker", "IAstroidChecker", "ITokenChecker", "IReporter", "IChecker")