-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[ruff
] Implement mutable-fromkeys-value
(RUF024
)
#9597
Conversation
58bf244
to
e9410b9
Compare
Implement rule `mutable-fromkeys-value` (`RUF023`) with a fix marked as unsafe. Fix formatting in docs
e9410b9
to
6cd8382
Compare
|
Could you maybe use RUF024 for this? I'm using RUF023 for #9564 :) |
Oops, I will change it when I am back at my desk |
Can you also open an issue on this for flake8-bugbear? I'm sure they'd love to include this rule and it would make more sense with a reserved B error code. Other ruff rule suggestions have been added there and we usually migrate the rule alias. |
Ah nvm, there is an issue that has been open for a while: PyCQA/flake8-bugbear#387 |
mutable-fromkeys-value
(RUF023
)mutable-fromkeys-value
(RUF024
)
Thanks for renaming the PR @AlexWaygood, didn't realise I had missed that |
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.
Excellent work, thank you.
mutable-fromkeys-value
(RUF024
)ruff
] Implement mutable-fromkeys-value
(RUF024
)
Summary
Implement rule
mutable-fromkeys-value
(RUF023
).Autofixes
to
The fix is marked as unsafe as it changes runtime behaviour. It also uses
key
as the comprehension variable, which may not always be desired.Closes #4613.
Test Plan
cargo test