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

Apply ruff rule RUF012 #1414

Merged
merged 2 commits into from
May 19, 2024
Merged

Apply ruff rule RUF012 #1414

merged 2 commits into from
May 19, 2024

Conversation

DimitriPapadopoulos
Copy link
Contributor

@DimitriPapadopoulos DimitriPapadopoulos commented May 18, 2024

  • I have added a news fragment under changelog.d/ (if the patch affects the end users)

Summary of changes

Apply ruff rule RUF012

RUF012 Mutable class attributes should be annotated with `typing.ClassVar`

Gitr rid of mutable default values:

Fixes #1408.

Test plan

Tested by running

$ ruff check --extend-select RUF012
All checks passed!
$ 

@DimitriPapadopoulos DimitriPapadopoulos marked this pull request as ready for review May 18, 2024 11:47
@DimitriPapadopoulos
Copy link
Contributor Author

Other classes inheriting NamedTuple can be changed to dataclass in a different PR.

RUF012 Mutable class attributes should be annotated with `typing.ClassVar`
@huxuan huxuan enabled auto-merge (squash) May 19, 2024 13:04
@huxuan huxuan merged commit bab0ea6 into pypa:main May 19, 2024
11 checks passed
@DimitriPapadopoulos DimitriPapadopoulos deleted the RUF012 branch May 20, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Look into ruff rule RUF012
3 participants