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

DOC: pyreverse supported format not recognized missing puml, plantuml, mmd, etc #5950

Closed
ChrisKeefe opened this issue Mar 22, 2022 · 1 comment · Fixed by #5951
Closed

DOC: pyreverse supported format not recognized missing puml, plantuml, mmd, etc #5950

ChrisKeefe opened this issue Mar 22, 2022 · 1 comment · Fixed by #5951
Assignees
Labels
Minor 💅 Polishing pylint is always nice pyreverse Related to pyreverse component
Milestone

Comments

@ChrisKeefe
Copy link

ChrisKeefe commented Mar 22, 2022

Bug description

Some supported formats are not listed in the error messaging:

> pyreverse -ASmy -o .puml my_package/my_module.py 
parsing my_package/my_module.py...
Format: "puml" not recognized. Use one of: bmp canon cmap cmapx cmapx_np dot dot_json eps fig gd gd2 gif gtk gv ico imap imap_np ismap jpe jpeg jpg json json0 mp pdf pic plain plain-ext png pov ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp x11 xdot xdot1.2 xdot1.4 xdot_json xlib

Here, I have made the mistake of prepending a . to puml. The error output should list puml (and plantuml and mmd and vcg) as supported formats.

Without the preceding ., the command runs as expected.

Command used

`> pyreverse -ASmy -o .puml my_package/my_module.py `

Pylint output

parsing my_package/my_module.py...
Format: "puml" not recognized. Use one of: bmp canon cmap cmapx cmapx_np dot dot_json eps fig gd gd2 gif gtk gv ico imap imap_np ismap jpe jpeg jpg json json0 mp pdf pic plain plain-ext png pov ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp x11 xdot xdot1.2 xdot1.4 xdot_json xlib

Expected behavior

All supported formats are listed when user makes a typo in the -o format argument

Pylint version

> pylint --version
pylint 2.12.2
astroid 2.9.3
Python 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:59:51) 
[GCC 9.4.0]

OS / Environment

OpenSUSE Tumbleweed

@ChrisKeefe ChrisKeefe added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Mar 22, 2022
@DudeNr33
Copy link
Collaborator

Thank you for the report.
This error message is not generated by pyreverse itself, but comes from the call to the dot executable.

The logic for the output format in pyreverse is as follows:

  1. First, we check if the given output format can be generated directly by pyreverse - this includes VCG (vcg), PlantUML (plantuml, puml), MermaidJS (mmd, html), and DOT (dot).
  2. If we receive any other output format, we generate an intermediate dot file (or .gv to be more exact, but with the same content as a .dot), and then feed it to the dot command to convert it to the given output format.

This way the user is able to directly specify an image format like png to create images directly (if Graphviz or any other form of the dot command is installed).

But I agree that this message is really confusing. It would be better if we don't just output the dot error message directly but rather build our own, and make it clearer which output formats are really supported.

@DudeNr33 DudeNr33 added pyreverse Related to pyreverse component Minor 💅 Polishing pylint is always nice and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Mar 22, 2022
@DudeNr33 DudeNr33 self-assigned this Mar 22, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.13.0 milestone Mar 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Minor 💅 Polishing pylint is always nice pyreverse Related to pyreverse component
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants