summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Finkler <3929834+DudeNr33@users.noreply.github.com>2021-10-02 16:33:55 +0200
committerGitHub <noreply@github.com>2021-10-02 16:33:55 +0200
commit87ab1bd84536c7ef7e50229a5cb56625b1bd4daf (patch)
treeb7b6e62e6fe7b878387582053b594f03f6ed9492
parent2705e0f3971cd0a20e4310b6a16155e039c5127b (diff)
parent4c36ba7763530444f2abf8af0acfebdb015cee7c (diff)
downloadpylint-git-87ab1bd84536c7ef7e50229a5cb56625b1bd4daf.tar.gz
Merge pull request #5102 from DanielNoord/typing-pyreverse
Add basic typing to ``pylint/pyreverse``
-rw-r--r--pylint/pyreverse/dot_printer.py2
-rw-r--r--pylint/pyreverse/printer.py6
-rw-r--r--pylint/pyreverse/printer_factory.py4
3 files changed, 6 insertions, 6 deletions
diff --git a/pylint/pyreverse/dot_printer.py b/pylint/pyreverse/dot_printer.py
index fea9046f4..ff8122a58 100644
--- a/pylint/pyreverse/dot_printer.py
+++ b/pylint/pyreverse/dot_printer.py
@@ -28,7 +28,7 @@ SHAPES: Dict[NodeType, str] = {
NodeType.INTERFACE: "record",
NodeType.CLASS: "record",
}
-ARROWS: Dict[EdgeType, Dict] = {
+ARROWS: Dict[EdgeType, Dict[str, str]] = {
EdgeType.INHERITS: dict(arrowtail="none", arrowhead="empty"),
EdgeType.IMPLEMENTS: dict(arrowtail="node", arrowhead="empty", style="dashed"),
EdgeType.ASSOCIATION: dict(
diff --git a/pylint/pyreverse/printer.py b/pylint/pyreverse/printer.py
index bdd561898..6aa99bdb9 100644
--- a/pylint/pyreverse/printer.py
+++ b/pylint/pyreverse/printer.py
@@ -54,7 +54,7 @@ class Printer(ABC):
title: str,
layout: Optional[Layout] = None,
use_automatic_namespace: Optional[bool] = None,
- ):
+ ) -> None:
self.title: str = title
self.layout = layout
self.use_automatic_namespace = use_automatic_namespace
@@ -62,11 +62,11 @@ class Printer(ABC):
self._indent = ""
self._open_graph()
- def _inc_indent(self):
+ def _inc_indent(self) -> None:
"""increment indentation"""
self._indent += " "
- def _dec_indent(self):
+ def _dec_indent(self) -> None:
"""decrement indentation"""
self._indent = self._indent[:-2]
diff --git a/pylint/pyreverse/printer_factory.py b/pylint/pyreverse/printer_factory.py
index c52f24a4d..d38b2d869 100644
--- a/pylint/pyreverse/printer_factory.py
+++ b/pylint/pyreverse/printer_factory.py
@@ -3,14 +3,14 @@
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
-from typing import Type
+from typing import Dict, Type
from pylint.pyreverse.dot_printer import DotPrinter
from pylint.pyreverse.plantuml_printer import PlantUmlPrinter
from pylint.pyreverse.printer import Printer
from pylint.pyreverse.vcg_printer import VCGPrinter
-filetype_to_printer = {
+filetype_to_printer: Dict[str, Type[Printer]] = {
"vcg": VCGPrinter,
"plantuml": PlantUmlPrinter,
"puml": PlantUmlPrinter,