Commit 1abd975
Refactor pyreverse Association Logic (#10397)
* Correct the test output to follow UML semantics
* Introduce composition
* Update all the printers to emit the right arrow types
* Update docstring
* Remove type annotations from test output
* Avoid processing duplicate relationships
* Update expected files again -> defaults to association
* change arrowhead for dot language for association relationsships
* Update comment
* Update comments in test file
* rename test folders for better clarity
* Enhance composition and aggregation handling in AST node processing so that the differentation between aggregation and composition is correct according to UMLEnhance composition and aggregation handling in AST node processing so that the differentation between aggregation and composition is correct according to UML
* Update relationship extraction to avoid duplicate entries
* Correctly infer the node type for Composition
* Update the functional test for comprehensions aswell
* Instead of checking not call node check for name node ==> more explicit
* Remove redundant checks in AggregationHandler
* Add todo note because infering type in Aggregation comprehensions is unreliable for now
* Enhance type resolution in AssociationsHandler and add utility functions for extracting element types and resolving class definitionsEnhance type resolution in AssociationsHandler and add utility functions for extracting element types and resolving class definitions
* Fix order so that tests pass
* Update the functional test files for attribute annotation, because now pyreverse correctly extracts Dummy as Association
* Use the new utility function for the other handlers aswell
* Fix regression that did not correctly detect Composition in fields.py
* Revert functional test for comprehension ==> this now works with new util functions
* Add correct arrow type for dot printer
* Update functional tests to include all file formats
* Fix diadefs tests (DoNothing now is correctly detected as Composition instead of assoiciation)
* Remove TODO since this now works
* Rename functional test files to relationships for better clarity
* rename to compositionshandler for better clarity
* Rename association-related classes to relationship aswell for improved clarity
* Try to fix the failing tests by processing instance attributes and class level attributes separate
* Fix diadefs_test again (cls_member is now also correctly identified as composition instead of association)
* Also consider composition when when filtering for --no-standalone ==> fixes last failing test
* Add newsfragment
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add functional tests
* Update newsfragement
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Apply suggestions from code review
Co-authored-by: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>
* Update fields test files
* Update comprehensions test file
* Reverse arrows in attribute annotation test files aswell
* Reverse arrows in writer
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Finkler <3929834+DudeNr33@users.noreply.github.com>1 parent 4f98c18 commit 1abd975
File tree
40 files changed
+498
-133
lines changed- doc/whatsnew/fragments
- pylint/pyreverse
- tests/pyreverse
- functional/class_diagrams
- aggregation
- annotations
- attributes
- relationships_filtering
- relationships
40 files changed
+498
-133
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| 229 | + | |
229 | 230 | | |
230 | 231 | | |
231 | 232 | | |
| |||
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
237 | | - | |
238 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
239 | 247 | | |
240 | | - | |
241 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
242 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
243 | 258 | | |
244 | 259 | | |
245 | 260 | | |
| 261 | + | |
246 | 262 | | |
| 263 | + | |
247 | 264 | | |
248 | | - | |
249 | 265 | | |
250 | 266 | | |
251 | 267 | | |
252 | 268 | | |
253 | 269 | | |
| 270 | + | |
| 271 | + | |
254 | 272 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | 273 | | |
259 | 274 | | |
260 | 275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
0 commit comments