diff options
author | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-10-02 16:02:30 +0200 |
---|---|---|
committer | Daniël van Noord <13665637+DanielNoord@users.noreply.github.com> | 2021-10-02 16:02:30 +0200 |
commit | 4c36ba7763530444f2abf8af0acfebdb015cee7c (patch) | |
tree | 2cc718cb91c47b183a4dd13205dabac25a3ab38c | |
parent | a655e78fa8e9c51c6455806c1f04ef3f839c0526 (diff) | |
download | pylint-git-4c36ba7763530444f2abf8af0acfebdb015cee7c.tar.gz |
Add basic typing to ``pylint/pyreverse``
-rw-r--r-- | pylint/pyreverse/dot_printer.py | 2 | ||||
-rw-r--r-- | pylint/pyreverse/printer.py | 6 | ||||
-rw-r--r-- | pylint/pyreverse/printer_factory.py | 4 |
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, |