summaryrefslogtreecommitdiff
path: root/pylint/pyreverse
diff options
context:
space:
mode:
authorAndreas Finkler <3929834+DudeNr33@users.noreply.github.com>2023-03-09 19:37:03 +0100
committerGitHub <noreply@github.com>2023-03-09 19:37:03 +0100
commitd04734d43a30505e2e28ac3e5f7d066e85bf5772 (patch)
treed715be0928a8914b442eb01b7633674c39beeb71 /pylint/pyreverse
parent62889d46ad94fe81bd1cd50f4171b259bffb3007 (diff)
downloadpylint-git-d04734d43a30505e2e28ac3e5f7d066e85bf5772.tar.gz
Remove remaining code parts related to __implements__ (#8414)
Refs #8404
Diffstat (limited to 'pylint/pyreverse')
-rw-r--r--pylint/pyreverse/diagrams.py8
-rw-r--r--pylint/pyreverse/dot_printer.py2
-rw-r--r--pylint/pyreverse/inspector.py4
-rw-r--r--pylint/pyreverse/mermaidjs_printer.py5
-rw-r--r--pylint/pyreverse/plantuml_printer.py5
-rw-r--r--pylint/pyreverse/printer.py2
-rw-r--r--pylint/pyreverse/utils.py5
-rw-r--r--pylint/pyreverse/vcg_printer.py7
-rw-r--r--pylint/pyreverse/writer.py12
9 files changed, 7 insertions, 43 deletions
diff --git a/pylint/pyreverse/diagrams.py b/pylint/pyreverse/diagrams.py
index 54b138752..1f76b29ce 100644
--- a/pylint/pyreverse/diagrams.py
+++ b/pylint/pyreverse/diagrams.py
@@ -13,7 +13,7 @@ import astroid
from astroid import nodes, util
from pylint.checkers.utils import decorated_with_property
-from pylint.pyreverse.utils import FilterMixIn, is_interface
+from pylint.pyreverse.utils import FilterMixIn
class Figure:
@@ -195,11 +195,7 @@ class ClassDiagram(Figure, FilterMixIn):
node = obj.node
obj.attrs = self.get_attrs(node)
obj.methods = self.get_methods(node)
- # shape
- if is_interface(node):
- obj.shape = "interface"
- else:
- obj.shape = "class"
+ obj.shape = "class"
# inheritance link
for par_node in node.ancestors(recurs=False):
try:
diff --git a/pylint/pyreverse/dot_printer.py b/pylint/pyreverse/dot_printer.py
index 077e0552d..381c7b69f 100644
--- a/pylint/pyreverse/dot_printer.py
+++ b/pylint/pyreverse/dot_printer.py
@@ -25,13 +25,11 @@ class HTMLLabels(Enum):
ALLOWED_CHARSETS: frozenset[str] = frozenset(("utf-8", "iso-8859-1", "latin1"))
SHAPES: dict[NodeType, str] = {
NodeType.PACKAGE: "box",
- NodeType.INTERFACE: "record",
NodeType.CLASS: "record",
}
# pylint: disable-next=consider-using-namedtuple-or-dataclass
ARROWS: dict[EdgeType, dict[str, str]] = {
EdgeType.INHERITS: {"arrowtail": "none", "arrowhead": "empty"},
- EdgeType.IMPLEMENTS: {"arrowtail": "node", "arrowhead": "empty", "style": "dashed"},
EdgeType.ASSOCIATION: {
"fontcolor": "green",
"arrowtail": "none",
diff --git a/pylint/pyreverse/inspector.py b/pylint/pyreverse/inspector.py
index aa52845b4..f36816c97 100644
--- a/pylint/pyreverse/inspector.py
+++ b/pylint/pyreverse/inspector.py
@@ -106,9 +106,6 @@ class Linker(IdGeneratorMixIn, utils.LocalsVisitor):
* aggregations_type
as instance_attrs_type but for aggregations relationships
-
- * implements,
- list of implemented interface _objects_ (only on astroid.Class nodes)
"""
def __init__(self, project: Project, tag: bool = False) -> None:
@@ -149,7 +146,6 @@ class Linker(IdGeneratorMixIn, utils.LocalsVisitor):
"""Visit an astroid.Class node.
* set the locals_type and instance_attrs_type mappings
- * set the implements list and build it
* optionally tag the node with a unique id
"""
if hasattr(node, "locals_type"):
diff --git a/pylint/pyreverse/mermaidjs_printer.py b/pylint/pyreverse/mermaidjs_printer.py
index a8f3c576b..37a52f6d3 100644
--- a/pylint/pyreverse/mermaidjs_printer.py
+++ b/pylint/pyreverse/mermaidjs_printer.py
@@ -17,12 +17,10 @@ class MermaidJSPrinter(Printer):
NODES: dict[NodeType, str] = {
NodeType.CLASS: "class",
- NodeType.INTERFACE: "class",
NodeType.PACKAGE: "class",
}
ARROWS: dict[EdgeType, str] = {
EdgeType.INHERITS: "--|>",
- EdgeType.IMPLEMENTS: "..|>",
EdgeType.ASSOCIATION: "--*",
EdgeType.AGGREGATION: "--o",
EdgeType.USES: "-->",
@@ -46,7 +44,6 @@ class MermaidJSPrinter(Printer):
# pylint: disable=duplicate-code
if properties is None:
properties = NodeProperties(label=name)
- stereotype = "~~Interface~~" if type_ is NodeType.INTERFACE else ""
nodetype = self.NODES[type_]
body = []
if properties.attrs:
@@ -60,7 +57,7 @@ class MermaidJSPrinter(Printer):
line += f" {get_annotation_label(func.returns)}"
body.append(line)
name = name.split(".")[-1]
- self.emit(f"{nodetype} {name}{stereotype} {{")
+ self.emit(f"{nodetype} {name} {{")
self._inc_indent()
for line in body:
self.emit(line)
diff --git a/pylint/pyreverse/plantuml_printer.py b/pylint/pyreverse/plantuml_printer.py
index de3f983b7..73c9b2640 100644
--- a/pylint/pyreverse/plantuml_printer.py
+++ b/pylint/pyreverse/plantuml_printer.py
@@ -17,12 +17,10 @@ class PlantUmlPrinter(Printer):
NODES: dict[NodeType, str] = {
NodeType.CLASS: "class",
- NodeType.INTERFACE: "class",
NodeType.PACKAGE: "package",
}
ARROWS: dict[EdgeType, str] = {
EdgeType.INHERITS: "--|>",
- EdgeType.IMPLEMENTS: "..|>",
EdgeType.ASSOCIATION: "--*",
EdgeType.AGGREGATION: "--o",
EdgeType.USES: "-->",
@@ -56,7 +54,6 @@ class PlantUmlPrinter(Printer):
"""
if properties is None:
properties = NodeProperties(label=name)
- stereotype = " << interface >>" if type_ is NodeType.INTERFACE else ""
nodetype = self.NODES[type_]
if properties.color and properties.color != self.DEFAULT_COLOR:
color = f" #{properties.color}"
@@ -76,7 +73,7 @@ class PlantUmlPrinter(Printer):
label = properties.label if properties.label is not None else name
if properties.fontcolor and properties.fontcolor != self.DEFAULT_COLOR:
label = f"<color:{properties.fontcolor}>{label}</color>"
- self.emit(f'{nodetype} "{label}" as {name}{stereotype}{color} {{')
+ self.emit(f'{nodetype} "{label}" as {name}{color} {{')
self._inc_indent()
for line in body:
self.emit(line)
diff --git a/pylint/pyreverse/printer.py b/pylint/pyreverse/printer.py
index cdbf7e3c8..45b06f5c2 100644
--- a/pylint/pyreverse/printer.py
+++ b/pylint/pyreverse/printer.py
@@ -17,13 +17,11 @@ from pylint.pyreverse.utils import get_annotation_label
class NodeType(Enum):
CLASS = "class"
- INTERFACE = "interface"
PACKAGE = "package"
class EdgeType(Enum):
INHERITS = "inherits"
- IMPLEMENTS = "implements"
ASSOCIATION = "association"
AGGREGATION = "aggregation"
USES = "uses"
diff --git a/pylint/pyreverse/utils.py b/pylint/pyreverse/utils.py
index 078bc1b7e..d1aad2a03 100644
--- a/pylint/pyreverse/utils.py
+++ b/pylint/pyreverse/utils.py
@@ -72,11 +72,6 @@ def get_visibility(name: str) -> str:
return visibility
-def is_interface(node: nodes.ClassDef) -> bool:
- # bw compatibility
- return node.type == "interface" # type: ignore[no-any-return]
-
-
def is_exception(node: nodes.ClassDef) -> bool:
# bw compatibility
return node.type == "exception" # type: ignore[no-any-return]
diff --git a/pylint/pyreverse/vcg_printer.py b/pylint/pyreverse/vcg_printer.py
index b9e2e94f3..2a2591265 100644
--- a/pylint/pyreverse/vcg_printer.py
+++ b/pylint/pyreverse/vcg_printer.py
@@ -152,7 +152,6 @@ EDGE_ATTRS = {
SHAPES: dict[NodeType, str] = {
NodeType.PACKAGE: "box",
NodeType.CLASS: "box",
- NodeType.INTERFACE: "ellipse",
}
# pylint: disable-next=consider-using-namedtuple-or-dataclass
ARROWS: dict[EdgeType, dict[str, str | int]] = {
@@ -166,12 +165,6 @@ ARROWS: dict[EdgeType, dict[str, str | int]] = {
"backarrowstyle": "none",
"backarrowsize": 10,
},
- EdgeType.IMPLEMENTS: {
- "arrowstyle": "solid",
- "backarrowstyle": "none",
- "linestyle": "dotted",
- "backarrowsize": 10,
- },
EdgeType.ASSOCIATION: {
"arrowstyle": "solid",
"backarrowstyle": "none",
diff --git a/pylint/pyreverse/writer.py b/pylint/pyreverse/writer.py
index 3d0a4613a..a8b1143fd 100644
--- a/pylint/pyreverse/writer.py
+++ b/pylint/pyreverse/writer.py
@@ -75,9 +75,10 @@ class DiagramWriter:
# sorted to get predictable (hence testable) results
for obj in sorted(diagram.objects, key=lambda x: x.title): # type: ignore[no-any-return]
obj.fig_id = obj.node.qname()
- type_ = NodeType.INTERFACE if obj.shape == "interface" else NodeType.CLASS
self.printer.emit_node(
- obj.fig_id, type_=type_, properties=self.get_class_properties(obj)
+ obj.fig_id,
+ type_=NodeType.CLASS,
+ properties=self.get_class_properties(obj),
)
# inheritance links
for rel in diagram.get_relationships("specialization"):
@@ -86,13 +87,6 @@ class DiagramWriter:
rel.to_object.fig_id,
type_=EdgeType.INHERITS,
)
- # implementation links
- for rel in diagram.get_relationships("implements"):
- self.printer.emit_edge(
- rel.from_object.fig_id,
- rel.to_object.fig_id,
- type_=EdgeType.IMPLEMENTS,
- )
# generate associations
for rel in diagram.get_relationships("association"):
self.printer.emit_edge(