diff options
author | Téo Bouvard <teobouvard@gmail.com> | 2022-03-09 17:43:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-09 17:43:40 +0100 |
commit | 1ebdc8c59f31962db0244a79eaab9b8d90a87baf (patch) | |
tree | 30e3ec2963f3109a8371b38217f4318aca04835e /tests/pyreverse/data/classes_colorized.dot | |
parent | b1bb7f86bf08876e909fe135802a262fb2e5d82f (diff) | |
download | pylint-git-1ebdc8c59f31962db0244a79eaab9b8d90a87baf.tar.gz |
Fix pyreverse type hinting for class methods (#5881)
* Fix pyreverse type hinting for class methods
This commit fixes the alignment of arguments and their type annotations
in pyreverse printer output. It does so by checking for the type of the
current function rather than the name of the first argument.
This allows class methods having a non-standard first argument
(different from "self" or "cls") to be correctly serialized in class
diagrams.
* Add test for method with None args
According to astroid docs, this happens for builtin functions
implemented in C. In this case, we return an empty argument list.
Diffstat (limited to 'tests/pyreverse/data/classes_colorized.dot')
-rw-r--r-- | tests/pyreverse/data/classes_colorized.dot | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/pyreverse/data/classes_colorized.dot b/tests/pyreverse/data/classes_colorized.dot index 0ed328566..3b68c7933 100644 --- a/tests/pyreverse/data/classes_colorized.dot +++ b/tests/pyreverse/data/classes_colorized.dot @@ -8,7 +8,7 @@ charset="utf-8" "data.suppliermodule_test.DoSomething" [color="aliceblue", fontcolor="black", label="{DoSomething|my_int : Optional[int]\lmy_int_2 : Optional[int]\lmy_string : str\l|do_it(new_int: int): int\l}", shape="record", style="filled"]; "data.suppliermodule_test.Interface" [color="aliceblue", fontcolor="black", label="{Interface|\l|get_value()\lset_value(value)\l}", shape="record", style="filled"]; "data.property_pattern.PropertyPatterns" [color="aliceblue", fontcolor="black", label="{PropertyPatterns|prop1\lprop2\l|}", shape="record", style="filled"]; -"data.clientmodule_test.Specialization" [color="aliceblue", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|}", shape="record", style="filled"]; +"data.clientmodule_test.Specialization" [color="aliceblue", fontcolor="black", label="{Specialization|TYPE : str\lrelation\lrelation2\ltop : str\l|from_value(value: int)\ltransform_value(value: int): int\l}", shape="record", style="filled"]; "data.clientmodule_test.Specialization" -> "data.clientmodule_test.Ancestor" [arrowhead="empty", arrowtail="none"]; "data.clientmodule_test.Ancestor" -> "data.suppliermodule_test.Interface" [arrowhead="empty", arrowtail="node", style="dashed"]; "data.suppliermodule_test.DoNothing" -> "data.clientmodule_test.Ancestor" [arrowhead="diamond", arrowtail="none", fontcolor="green", label="cls_member", style="solid"]; |