Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyreverse: Don't show multiple class association arrows #9055

Merged

Conversation

nickdrozd
Copy link
Contributor

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Fixes the multiple-association-arrows bug mentioned in #9045

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #9055 (4869dd8) into main (2d85a39) will increase coverage by 0.00%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #9055   +/-   ##
=======================================
  Coverage   95.75%   95.75%           
=======================================
  Files         173      173           
  Lines       18652    18657    +5     
=======================================
+ Hits        17860    17865    +5     
  Misses        792      792           
Files Changed Coverage Ξ”
pylint/pyreverse/writer.py 100.00% <100.00%> (ΓΈ)

@github-actions

This comment has been minimized.

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we need to determine what is the strongest association here and show only this one. There's another unrelated bug signaled by Andreas in the original issue (no composition here) that will make the association the only remaining link between those classes, right ?

doc/whatsnew/fragments/9045.bugfix Outdated Show resolved Hide resolved
@nickdrozd
Copy link
Contributor Author

This change is a bit hacky. Rather than sort out why relations are being miscategorized, we just drop any extra arrows if they show up. This is done according to relation precedence, so if there is a composition arrow, we print it and then ignore any subsequent aggregation arrows, since those have lower precedence.

This doesn't address how relations are categorized, but it does eliminate the most annoying side effect of the problem, namely too many arrows.

@github-actions
Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 4869dd8

@Pierre-Sassoulas Pierre-Sassoulas added Bug πŸͺ² pyreverse Related to pyreverse component labels Sep 22, 2023
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0a8, 3.0.0b1 Sep 22, 2023
Copy link
Collaborator

@DudeNr33 DudeNr33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for yet another fix!
I would be OK with separating the fixes for multiple arrows vs. determining the correct association into distinct PRs.

@nickdrozd and @Pierre-Sassoulas I would leave it to one of you to merge, in case you want to include the fix for the misclassified associations in this PR as well.

@Pierre-Sassoulas
Copy link
Member

Wondering if we should release 3.0.0a8 without this or directly 3.0.0b0 with it (#9065 / #7607).

@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0b1, 3.0.0b0 Sep 25, 2023
@Pierre-Sassoulas Pierre-Sassoulas merged commit 209f234 into pylint-dev:main Sep 25, 2023
46 checks passed
@nickdrozd nickdrozd deleted the pyreverse-composition-arrows branch October 7, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug πŸͺ² pyreverse Related to pyreverse component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants