-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
base: main
Are you sure you want to change the base?
Conversation
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.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3209 +/- ##
==========================================
- Coverage 97.09% 97.08% -0.01%
==========================================
Files 56 56
Lines 9684 9687 +3
Branches 1754 1754
==========================================
+ Hits 9403 9405 +2
- Misses 168 169 +1
Partials 113 113 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 could you fix the two Ruff errors (2 fixable with the |
Just use |
Updated test cases for find_outline_item method.
Remove redundant return statement in get_next method.
|
@stefan6419846 the |
|
I guess |
|
I have marked it as |
pypdf/_writer.py
Outdated
|
|
||
| clean(content, images, forms, text_filters) | ||
| page.replace_contents(content) | ||
| return [], [] # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the ignore here?
| o = cast(TreeObject, o["/Next"]) | ||
| else: | ||
| return None | ||
| raise PyPdfError("This line is theoretically unreachable.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need the pragma comment here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without, mypy gives this error:
pypdf/_writer.py:2235: error: No return value expected [return-value]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you commented on the wrong comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from this: Please prefer ignoring specify mypy issues instead of all.
RET503: Missing explicit "return" at the end of function able to return non-"None" value.