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: Add option for colored output #4850

Merged
merged 9 commits into from Aug 15, 2021

Conversation

DudeNr33
Copy link
Collaborator

  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature, or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Type of Changes

Type
✨ New feature

Description

This MR adds two command line options to pyreverse:

  • --colorized: Use colored output. Classes/modules of the same package get the same color.
  • --max-color-depth: Use separate colors up to package depth of

This feature is usable with DotPrinter and PlantUmlPrinter.
VCGPrinter will simply ignore the color passed to it.

Closes #4488

ChangeLog Show resolved Hide resolved
obj = Mock()
obj.node = Mock()
obj.node.qname.return_value = "collections"
assert writer.get_color(obj) == "grey"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I hope this test works well in the CI.
On my local computer it passes in the tox environment, but fails when running the test directly from VS code. I guess it has something to do with the way the virtual environment is set up.
If it causes issues we can remove this test, I only included it because otherwise the corresponding could would have no test coverage. But given that the code is simple, having a more stable CI (and dev environments for other contributors) might be more important.

Copy link
Member

Choose a reason for hiding this comment

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

It seems it's passing so probably something due to your VScode environment ? I don't see how this test could be flaky.

@coveralls
Copy link

coveralls commented Aug 15, 2021

Pull Request Test Coverage Report for Build 1133158792

  • 46 of 46 (100.0%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 92.731%

Totals Coverage Status
Change from base Build 1132425686: 0.02%
Covered Lines: 13408
Relevant Lines: 14459

💛 - Coveralls

@DudeNr33 DudeNr33 marked this pull request as ready for review August 15, 2021 13:34
@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component pyreverse Related to pyreverse component labels Aug 15, 2021
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.10.0 milestone Aug 15, 2021
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.

LGTM, I only have minor comments, this is definitely going in 2.10. Thanks again for the huge work you did on this!

doc/whatsnew/2.10.rst Outdated Show resolved Hide resolved
pylint/pyreverse/main.py Show resolved Hide resolved
pylint/pyreverse/writer.py Outdated Show resolved Hide resolved
tests/pyreverse/data/classes_colorized.puml Outdated Show resolved Hide resolved
@Pierre-Sassoulas Pierre-Sassoulas merged commit 14c0075 into pylint-dev:main Aug 15, 2021
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.

Proposal: automatically color modules in package diagram
3 participants