-
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
Format DictComp
expression
#5771
Conversation
+ for ( | ||
+ k, | ||
+ v, | ||
+ ) in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension |
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.
Note the generators formatting.
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.
cc: @davidszotten
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.
You mean the parentheses around the tuple and that it expands over multiple lines? We probably need to use the StripInsideForLoop
layout here as well (unrelated to your PR)
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
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.
Nice! Thank you.
+ for ( | ||
+ k, | ||
+ v, | ||
+ ) in this_is_a_very_long_variable_which_will_cause_a_trailing_comma_which_breaks_the_comprehension |
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.
You mean the parentheses around the tuple and that it expands over multiple lines? We probably need to use the StripInsideForLoop
layout here as well (unrelated to your PR)
## Summary Format `DictComp` like `ListComp` from astral-sh#5600. It's not 100%, but I figured maybe it's worth starting to explore. ## Test Plan Added ruff fixture based on `ListComp`'s.
Summary
Format
DictComp
likeListComp
from #5600. It's not 100%, but I figured maybe it's worth starting to explore.Test Plan
Added ruff fixture based on
ListComp
's.