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

Add --max-depth option to control diagram complexity #10077

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Julfried
Copy link
Contributor

@Julfried Julfried commented Nov 11, 2024

Type of Changes

Type
πŸ› Bug fix
βœ“ ✨ New feature
πŸ”¨ Refactoring
πŸ“œ Docs

Description

This PR adds a new --max-depth option to pyreverse that allows basic controlling of the visualization depth of packages and classes in the generated diagrams. The depth is simply calculated by counting dots in qualified names, where depth 0 represents top-level packages/classes.

For packages, the full path depth is considered. For classes, the depth is calculated based on their containing module to ensure meaningful class diagrams while respecting the depth limit.

Closes #9233

@Julfried Julfried changed the title Set depth Add --max-depth option to control diagram complexity Nov 11, 2024
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 16 lines in your changes missing coverage. Please review.

Project coverage is 95.72%. Comparing base (614f80e) to head (7c95c20).

Files with missing lines Patch % Lines
pylint/pyreverse/writer.py 40.74% 16 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #10077      +/-   ##
==========================================
- Coverage   95.80%   95.72%   -0.08%     
==========================================
  Files         174      174              
  Lines       18962    18990      +28     
==========================================
+ Hits        18166    18178      +12     
- Misses        796      812      +16     
Files with missing lines Coverage Ξ”
pylint/pyreverse/main.py 91.66% <ΓΈ> (ΓΈ)
pylint/testutils/pyreverse.py 98.11% <100.00%> (+0.03%) ⬆️
pylint/pyreverse/writer.py 86.44% <40.74%> (-13.56%) ⬇️

@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component pyreverse Related to pyreverse component labels Nov 11, 2024
@Pierre-Sassoulas Pierre-Sassoulas added this to the 4.0.0 milestone Nov 11, 2024
Copy link
Contributor

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

This comment was generated for commit 7c95c20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component pyreverse Related to pyreverse component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set depth in pyreverse
2 participants