Skip to content

MAINT: Remove unused variables #3088

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

Merged
merged 1 commit into from
Jan 28, 2025
Merged

MAINT: Remove unused variables #3088

merged 1 commit into from
Jan 28, 2025

Conversation

j-t-1
Copy link
Contributor

@j-t-1 j-t-1 commented Jan 27, 2025

Specifically CUSTOM_RTL_MIN, CUSTOM_RTL_MAX, and CUSTOM_RTL_SPECIAL_CHARS.

Specifically CUSTOM_RTL_MIN, CUSTOM_RTL_MAX, and CUSTOM_RTL_SPECIAL_CHARS.
@j-t-1
Copy link
Contributor Author

j-t-1 commented Jan 27, 2025

As these are global varibles, deleting them may not be the correct thing to do. This PR will need checking by someone who understands this function well.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.50%. Comparing base (52f974a) to head (0f1d3f4).
Report is 107 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3088   +/-   ##
=======================================
  Coverage   96.50%   96.50%           
=======================================
  Files          52       52           
  Lines        8807     8807           
  Branches     1612     1612           
=======================================
  Hits         8499     8499           
  Misses        183      183           
  Partials      125      125           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefan6419846
Copy link
Collaborator

stefan6419846 commented Jan 27, 2025

Are they really unused? https://github.com/search?q=repo%3Apy-pdf%2Fpypdf%20CUSTOM_RTL_MIN&type=code indicates otherwise.

Edit: It seems like at least in pypdf._page they are unused indeed. We should document the relevant change to pypdf._page (id est the commit moving the usages to the new module) here nevertheless before merging this.

@stefan6419846 stefan6419846 added on-hold PR requests that need clarification before they can be merged.A comment must give details and removed on-hold PR requests that need clarification before they can be merged.A comment must give details labels Jan 27, 2025
@j-t-1
Copy link
Contributor Author

j-t-1 commented Jan 27, 2025

Text extraction is hard, as described in our docs. At the moment I do not understand how this function works, and will need to read the PDF specification as well. I think we need to focus resources on trying to reduce its complexity, which is currently 54 using tool.ruff.lint.mccabe.

@stefan6419846
Copy link
Collaborator

There already is #3010 for tracking this, although from my side there will not change much in the short term as it just works.

In the light of your last comment, how do you propose to go forward with this PR?

@j-t-1
Copy link
Contributor Author

j-t-1 commented Jan 28, 2025

Did not know about the issue.

Doing what you did and searching the codebase for the variables, they are only used in tests. Happy with this PR as is.

The function may by necessity be this complex. I will try in future PRs to make it more readable even if just comments.

@stefan6419846
Copy link
Collaborator

Judging from the git blame, the relevant change happened in #1683 and thus is just an oversight from the refactoring.

@stefan6419846 stefan6419846 merged commit b945472 into py-pdf:main Jan 28, 2025
16 checks passed
@j-t-1 j-t-1 deleted the global branch January 28, 2025 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants