Skip to content
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

(RUF012) Fixed mutable class Defaults- Task 3 #10284

Conversation

drona-gyawali
Copy link
Contributor

@drona-gyawali drona-gyawali commented Jan 6, 2025

Part of #10196
NOTE: These are NOT automated changes, they are done by hand

This PR addresses Part of RUF012 Rule - Task 3, implementing typing.ClassVar across 4 files with a total of 13 changes. The updates primarily focus on enhancing code quality and resolving linting issues (RUF012) related to mutable class attributes.

Technical

  • Updated mutable class attributes in 4 files to use typing.ClassVar for clarity and correctness.
  • Added ClassVar annotations to mutable class attributes to ensure they are treated as class-level attributes.
  • Ensured proper type hints for clarity and type safety.

Testing

Ran ruff check --select RUF012 to confirm no further warnings.

Screenshot

  • N/A

Stakeholders

@RayBB

Copy link
Collaborator

@RayBB RayBB left a comment

Choose a reason for hiding this comment

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

Looks great to me but I'll need to get a double check from staff :)

@RayBB RayBB added the Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. label Jan 7, 2025
@RayBB RayBB added Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] and removed Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. labels Jan 15, 2025
@github-actions github-actions bot removed the Needs: Submitter Input Waiting on input from the creator of the issue/pr [managed] label Jan 17, 2025
@drona-gyawali
Copy link
Contributor Author

Hi @RayBB , I made the changes according to your guidance. If there's anything that needs to be modified, please guide me.

Copy link
Collaborator

@RayBB RayBB left a comment

Choose a reason for hiding this comment

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

Just one question but otherwise this is on the right path!

Copy link
Collaborator

@RayBB RayBB left a comment

Choose a reason for hiding this comment

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

Great work on this one. I think we're ready for @cdrini to take a look.

Testing:

  • Adding books to bookshelf worked
  • Search autocomplete worked

@RayBB RayBB added the Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this. label Jan 18, 2025
@scottbarnes
Copy link
Collaborator

@drona-gyawali, it may be the case the the tests will pass after rebasing. It may also be the case that it won't help. However, it's likely worth a shot. See Updating your Pull Request if you need any help with that.

Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

Awesome thank you @drona-gyawali ! Looks good, just a point of feedback around the tuple type hints.

@RayBB RayBB requested a review from cdrini January 29, 2025 04:20
Copy link
Collaborator

@cdrini cdrini left a comment

Choose a reason for hiding this comment

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

lgtm! Thank you @drona-gyawali !

@cdrini cdrini merged commit 3f580a5 into internetarchive:master Jan 29, 2025
4 checks passed
@drona-gyawali drona-gyawali deleted the task-3/fix-ruf012-classvar-annotations branch February 18, 2025 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Affects: Developers Needs: Staff / Internal Reviewed a PR but don't have merge powers? Use this.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants