-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Pyreverse: PlantUML support + coloring (from PR #4521) #4615
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
Conversation
Distinguish modules and packages.
…ibute in VCGPrinter
…modules is checked
… test does not work in tox env
…hod ``get_package_properties``. Rename ``get_values`` to ``get_class_properties``. VCGWriter and VCGPrinter thus no longer need special handling.
Add ChangeLog and whatsnew entry
Refactor coloring logic into own Mixin class that can be used for both ``DotWriter`` and ``PlantUmlWriter``
…hem more readable.
…nt backends into ``printer`` module.
…s, move to own directory
…ately 'wrong' code. Check top level ``conftest.py`` but ignore remaining ones, as this raises mypy errors for duplicate modules.
…nts and introduce proper subclasses for different kinds of diagram entities.
…ass suitable for the given output format
…is also not necessary anymore. The "shape" is now automatically set by the ``Printer`` classes.
…output format (Open-Closed-Principle).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, sorry for the delay before reviewing. There's a lot to review here and I never got a long enough period to do it properly. Could you rebase on the latest main, fix the conflicts, and put the changelog in 2.10 instead of 2.9 first, please ? If there are little changes that could be reviewed as a standalone MR, we could merge them first and that would help with the review time.
Splitting this MR into smaller parts would certainly be possible.
1 & 2 might fit together well into one MR. |
Sound great, I don't mind if we open a dozen of new MR and close this one :) |
Closing in favor of #4850 |
Steps
doc/whatsnew/<current release.rst>
.Description
This is a rather large PR, so I try my best to summarize the changes.
It solves both #4488 and #4498.
The requested changes from PR #4521 are already included, and PR #4521 can be deleted (the introduction of
NamedTuple
for better typing was easier to do with the changes already made for the PlantUML support).So here is an overview what this PR includes:
New Features:
--colorized
and--max-color-depth
to automatically color classes/modules of the same package (merged from PR Pyreverse autocolor #4521)PlantUmlPrinter
to support output to .puml files.Note that automatic conversion to .png or other image formats is not supported yet; specifying "png" as output format will still rely on the Dot backend.
ImportsChecker
can now be produced in .vcg and .puml format, not only .dot.Refactoring:
Printer
interface inpylint.pyreverse.printer
for the possible backends (Dot, VCG, PlantUML).Moved
DotBackend
andVCGPrinter
toprinter
module.Printer
subclasses that were never used by the callers in the codebase, to find a minimal superset of parameters for each method signature.Printer
orDiagramWriter
subclass for the desired output format.pylint.graph
as it is no longer needed (DotBackend
is replaced bypylint.pyreverse.printer.DotPrinter
). Same forpylint.pyreverse.vcgutils
.Move orphaned
get_cycles()
function topylint.checkers.imports
, which is (in my opinion) the better place for it anyway.pyreverse.utils
into own test moduleexclude
rules in thepre-commit-config.yaml
so it does not need to be expanded every time a newdata
subdirectory or a newconftest.py
is added to the tests.Type of Changes
Related Issue
Closes #4488
Closes #4498