-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DEV: Remove ignore Ruff rule B028 #3214
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
B028: No explicit "stacklevel" keyword argument found.
B028: No explicit "stacklevel" keyword argument found.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3214 +/- ##
=======================================
Coverage 96.59% 96.59%
=======================================
Files 53 53
Lines 8948 8948
Branches 1648 1648
=======================================
Hits 8643 8643
Misses 183 183
Partials 122 122 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Do we have a test somewhere that the given stacklevel makes sense and exposes enough details for the user? |
No test for that within |
We have a merge conflict here. For what is correct with the code itself and what not, I will need to have a look at again in the next days. |
Besides the merge conflict, we should indeed change the stack level as well. From my testing, we need level 3. What we see for the different levels:
Properly testing this probably requires a subprocess call, as pytest usually messes with the emitted warnings and thus we are not able to verify the actual output directly. |
Good work. If I am understanding this correctly the Level 1 would rarely be helpful as it does not provide context (and maybe why the Ruff rule). Out of Level 2 and Level 3, we need Level 3? |
Yes, we should indeed use level 3 here. This makes sure that the user/developer relying on this functionality knows which call inside its code is responsible for this with the default message. Level 1 and 2 just point into pypdf itself and thus are of no real value. |
B028: No explicit "stacklevel" keyword argument found.
|
B028: No explicit "stacklevel" keyword argument found.