summaryrefslogtreecommitdiff
path: root/pylint/pyreverse/diagrams.py
diff options
context:
space:
mode:
authorMark Byrne <31762852+mbyrnepr2@users.noreply.github.com>2021-06-26 20:36:10 +0200
committerGitHub <noreply@github.com>2021-06-26 20:36:10 +0200
commit1e55ae64624d28c5fe8b63ad7979880ee2e6ef3f (patch)
tree05a6b93fcb973fb72fe368b7d43eee00ed6635da /pylint/pyreverse/diagrams.py
parent14731ad97aa13fd4fc39e0eba134a000bd49b8f5 (diff)
downloadpylint-git-1e55ae64624d28c5fe8b63ad7979880ee2e6ef3f.tar.gz
Add type annotations to pyreverse (#4551)
* Add type annotations to pyreverse dot files Closes #1548 - Indicate the attribute is optional in the dot files by inspecting the default value. - Handle the Subscript type annotations - Refactor & move the logic to obtain annotations to utils.py as re-usable functions - Add unittests for the added functions - Add a try/except to deal with a possible InferenceError when using NodeNG.infer method - Create a function in utils and so remove repeated logic in inspector.py - Add unittests to check the InferenceError logic - Adjust the types in function input
Diffstat (limited to 'pylint/pyreverse/diagrams.py')
-rw-r--r--pylint/pyreverse/diagrams.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/pyreverse/diagrams.py b/pylint/pyreverse/diagrams.py
index bf9f67af6..4c391c7fa 100644
--- a/pylint/pyreverse/diagrams.py
+++ b/pylint/pyreverse/diagrams.py
@@ -122,7 +122,7 @@ class ClassDiagram(Figure, FilterMixIn):
if isinstance(node, astroid.Instance):
node = node._proxied
if (
- isinstance(node, astroid.ClassDef)
+ isinstance(node, (astroid.ClassDef, astroid.Name, astroid.Subscript))
and hasattr(node, "name")
and not self.has_node(node)
):