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 to skip sorting of attribute and method names #8776

Open
yantaozhao opened this issue Jun 14, 2023 · 5 comments
Open
Labels
Enhancement ✨ Improvement to a component Needs PR This issue is accepted, sufficiently specified and now needs an implementation pyreverse Related to pyreverse component

Comments

@yantaozhao
Copy link

Current problem

pyreverse output uml with class member names sorted.

Desired solution

do not sort class member names

Additional context

No response

@yantaozhao yantaozhao added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Jun 14, 2023
@Pierre-Sassoulas Pierre-Sassoulas changed the title pyreverse do NOT sort attribute and method names pyreverse sort attribute and method names and it shouldn't Jun 14, 2023
@Pierre-Sassoulas Pierre-Sassoulas added Proposal 📨 Needs decision 🔒 Needs a decision before implemention or rejection and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Jun 14, 2023
@DudeNr33
Copy link
Collaborator

I feel like this is a very subjective thing if sorting is desired or not. So I would like to vote for this:

🚀 keep the sorting
🎉 don't sort, use the order of definition from source code

@Pierre-Sassoulas
Copy link
Member

Maybe another possibility would be to add an option to be able to do both ?

@yantaozhao
Copy link
Author

Maybe another possibility would be to add an option to be able to do both ?

Agree. It would be better to add an option to let the user decide.

@jacobtylerwalls jacobtylerwalls added the pyreverse Related to pyreverse component label Jun 14, 2023
@DudeNr33 DudeNr33 changed the title pyreverse sort attribute and method names and it shouldn't pyreverse: add option to skip sorting of attributea and method names Aug 31, 2023
@DudeNr33 DudeNr33 added Enhancement ✨ Improvement to a component Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Proposal 📨 Needs decision 🔒 Needs a decision before implemention or rejection labels Aug 31, 2023
@DudeNr33
Copy link
Collaborator

For additional context: Completely removing the sorting would also be problematic for the existing unit tests, as they require deterministic output.

@nickdrozd
Copy link
Collaborator

Testing requires deterministic output, but not alphabetical sorting. Sorting by code order would be just as testable. Obtaining that order will be a little trickier, depending on the existing sources of nondeterminism (sets, dictionaries, etc).

Sorting by code order will require some work on somebody's part (somebody other than me, because I don't care either way 😎).

@DudeNr33 DudeNr33 changed the title pyreverse: add option to skip sorting of attributea and method names pyreverse: add option to skip sorting of attribute and method names Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component Needs PR This issue is accepted, sufficiently specified and now needs an implementation pyreverse Related to pyreverse component
Projects
None yet
Development

No branches or pull requests

5 participants