Skip to content

DEV: Remove ignore Ruff rule RET503 #3209

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

DEV: Remove ignore Ruff rule RET503 #3209

wants to merge 10 commits into from

Conversation

j-t-1
Copy link
Contributor

@j-t-1 j-t-1 commented Mar 21, 2025

RET503: Missing explicit "return" at the end of function able to return non-"None" value.

j-t-1 added 4 commits March 21, 2025 12:18
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 96.52%. Comparing base (45a0885) to head (e1b86e3).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pypdf/_writer.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3209      +/-   ##
==========================================
- Coverage   96.53%   96.52%   -0.02%     
==========================================
  Files          53       53              
  Lines        8930     8933       +3     
  Branches     1642     1642              
==========================================
+ Hits         8621     8623       +2     
- Misses        186      187       +1     
  Partials      123      123              

☔ 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.

@@ -3105,6 +3106,7 @@ def find_outline_item(
o = cast(TreeObject, o["/Next"])
else:
return None
return
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two issues here:

  • We always return None - why does this check trigger at all?
  • If this is a valid case, we should have a test for it as well.

Copy link
Collaborator

@stefan6419846 stefan6419846 Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again, this might indeed be correct, but untested.

j-t-1 added 5 commits March 22, 2025 15:11
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.
@stefan6419846 stefan6419846 added the needs-test A test should be added before this PR is merged. label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-test A test should be added before this PR is merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants