-
Notifications
You must be signed in to change notification settings - Fork 892
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
Split UP007 Union and Optional to two individual rules #11379
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,41 @@ | |||
import typing |
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.
Can I suggest a test case of the form List[Optional[str, int]]
?
To be sure the rule detect also nested Optional
. Or it is already the case? :)
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.
Thanks for the suggestion, I've added a test case for nested Optional
. A test case for nested Union
was already there, so I didn't modify that.
Resolves #4858
Summary
Drop Optional support from UP007 in preview mode
Add new rule in preview for use of Optional
Add documentation about the transition to both rules -> I have added some documentation regarding this to the
rustdoc
, @zanieb do you want me to add this somewhere else too?Test Plan
cargo test