kinow / protobuf-uml-diagram

Create UML diagrams from Protobuf compiled .proto files using Python
https://github.com/kinow/protobuf-uml-diagram
Apache License 2.0
72 stars 12 forks source link

Allow users to choose the name strategy of fields #79

Closed kinow closed 11 months ago

kinow commented 11 months ago

Closes #78 related to #75

In https://github.com/kinow/protobuf-uml-diagram/issues/10 we changed how names of fields were chosen, as there could be fields with the same name, but that meant/were different things. Instead, we started using the field full name (i.e. Airplace.wing, Chicken.wing instead of just wing).

In this pull request we allow users to change that behavior if they are sure that will not cause any issues, or if they prefer for aesthetics.

Thanks to @danjohles for reporting it.

-Bruno

codecov-commenter commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f63166e) 100.00% compared to head (77aae0c) 100.00%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #79 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 1 1 Lines 99 108 +9 Branches 15 16 +1 ========================================= + Hits 99 108 +9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kinow commented 11 months ago

Just pending unit tests, changelog entry, docs. Tested with the sample protobuf from the docs.

protobuf_uml_diagram.py --proto test_data/issue_10.proto --output /tmp

#or 

protobuf_uml_diagram.py --proto test_data/issue_10.proto --output /tmp --full_names=true

issue_10_pb2

$ protobuf_uml_diagram.py --proto test_data/issue_10.proto --output /tmp --full_names=False

issue_10_pb2

The difference is the new parameter --full_names=true|True|False|false|<default=true>.