-
-
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
Enable Ruff Rule: Remove unneeded occurrences of the global keyword #10232
base: master
Are you sure you want to change the base?
Enable Ruff Rule: Remove unneeded occurrences of the global keyword #10232
Conversation
replaced global keyword with appropriate replacements
Working on the errors. |
[pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Removing ruff rule error and fixing function
…y4shri/openlibrary into 10196/refactor/re-enable-ruff-rules
for more information, see https://pre-commit.ci
@RayBB can you please check whether the db_parameters error is something to be solved on my end? The issue is that dbm.ndbm doesn't have open and error attributes and the parameters and I will have to edit reveal.py file for this. Not sure if I should do that. |
@techy4shri here's the approach I'd recommend:
For this PR we don't want to make big changes. Just address the simple cases and add an exception via noqa comments for anything that would require more work. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…y4shri/openlibrary into 10196/refactor/re-enable-ruff-rules
for more information, see https://pre-commit.ci
I have only edited the files as required till now so changes needed there. It shows the same error, db_parameters are not specified in the configuration . |
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 fixed the small issue with the data providers.
Great work on this one it is all looking good! :)
Now we just need staff to review and then merge.
Thanks a lot! Apologies for the trouble. I'll try not to repeat this mistake next time. |
Part of #10196
Refactor: Removed unneeded occurrences of the global keyword (13 instances) in 7 files to improve code clarity and maintainability.Technical
This PR removes the unneeded use of the global keyword identified by PLW0602 warnings in 7 files (13 instances).
The code has been audited to ensure functionality remains unaffected. These variables have been restructured to use local or appropriately scoped replacements.
There were quite a few depreciation errors but I left them as they were since they are not part of the issue I worked on like python depreciated methods and npm depreceated libraries.
Testing
ruff check .
to confirm no linting errors or warnings, including PLW0602 issues.pytest
, confirming no regressions were introduced.pre-commit run --all-files
to verify things.Screenshot
Stakeholders
@RayBB