mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:10 +00:00
Format SetComp
(#5774)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Format `SetComp` like `ListComp`. ## Test Plan Derived from `ListComp`'s fixture.
This commit is contained in:
parent
daa4b72d5f
commit
e1c119fde3
6 changed files with 193 additions and 35 deletions
45
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/set_comp.py
vendored
Normal file
45
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/set_comp.py
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
{i for i in []}
|
||||
|
||||
{i for i in [1,]}
|
||||
|
||||
{
|
||||
a # a
|
||||
for # for
|
||||
c # c
|
||||
in # in
|
||||
e # e
|
||||
}
|
||||
|
||||
{
|
||||
# above a
|
||||
a # a
|
||||
# above for
|
||||
for # for
|
||||
# above c
|
||||
c # c
|
||||
# above in
|
||||
in # in
|
||||
# above e
|
||||
e # e
|
||||
# above if
|
||||
if # if
|
||||
# above f
|
||||
f # f
|
||||
# above if2
|
||||
if # if2
|
||||
# above g
|
||||
g # g
|
||||
}
|
||||
|
||||
{
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + [dddddddddddddddddd, eeeeeeeeeeeeeeeeeee]
|
||||
for
|
||||
ccccccccccccccccccccccccccccccccccccccc,
|
||||
ddddddddddddddddddd, [eeeeeeeeeeeeeeeeeeeeee, fffffffffffffffffffffffff]
|
||||
in
|
||||
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeffffffffffffffffffffffffggggggggggggggggggggghhhhhhhhhhhhhhothermoreeand_even_moreddddddddddddddddddddd
|
||||
if
|
||||
fffffffffffffffffffffffffffffffffffffffffff < gggggggggggggggggggggggggggggggggggggggggggggg < hhhhhhhhhhhhhhhhhhhhhhhhhh
|
||||
if
|
||||
gggggggggggggggggggggggggggggggggggggggggggg
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue