-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
STY: Reorder methods in PdfReader and PdfWriter #2654
Conversation
Reorder to make more logical, and try to put similar methods in the classes in similar order. Put _repr_mimebundle_ last as it goes less with the other methods.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2654 +/- ##
=======================================
Coverage 94.97% 94.97%
=======================================
Files 50 50
Lines 8331 8331
Branches 1669 1669
=======================================
Hits 7912 7912
Misses 260 260
Partials 159 159 ☔ View full report in Codecov by Sentry. |
I'm very skeptical of reordering methods. It's not clear to be if this has any advantage, but the disadvantage is obvious: It becomes very hard to see which PR/commit introduced which line of code. Additionally, this PR will likely introduce merge conflicts with other PRs + it will be extremely cumbersome to review. I would close it. What are your thoughts @stefan6419846 / @pubpub-zz ? |
For me it does not really matter how the methods are ordered as the API docs and autocompletion of IDEs orders them anyway. And yes, this significantly complicates blaming. |
When I did the PR to have common code between PdfReader and PdfWriter, Some orders could have been optimized. I was open to improve this order however, I missed the impact on conflicts resolving and code blaming. I now agree that this will have bad impact.😔 |
This is a fair criticism and has much weighting. At a minimum method When completely new complementary methods are added to both PdfReader and PdfWriter we should try and put them at the end of the class, so the new ones have the same order. There is a need for having a table (in the documentation say) with rows showing analog methods from PdfReader and PdfWriter (with missing values when analogs do not exist). |
In my opinion it should be sufficient to enable the class docs for |
Closing due to the above discussions to favor a clean history over a perfect order. |
Did not think of this option. This is a good idea. |
The need for a clean ordering makes sense. I think the only exception is classes traditionally having |
Reorder to make more logical, and try to put similar methods in the classes in similar order. Put repr_mimebundle last as it goes less with the other methods.