-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Micha Reiser <micha@reiser.io>
- Loading branch information
1 parent
c3b506f
commit 519dbdf
Showing
13 changed files
with
373 additions
and
185 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/yield.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
l = [1,2,3,4] | ||
|
||
def foo(): | ||
yield l | ||
|
||
b = yield l | ||
|
||
c = [ | ||
(yield l) , ( | ||
yield l | ||
|
||
)] | ||
|
||
with ( | ||
# Some comment | ||
yield | ||
): | ||
pass | ||
|
||
if (yield): | ||
# comment | ||
pass | ||
|
||
|
||
(yield a, b) = (1, 2) | ||
|
||
# some comment | ||
for e in l : yield e # some comment | ||
|
||
for e in l: | ||
|
||
|
||
# some comment | ||
|
||
yield e | ||
|
||
# trail comment | ||
|
||
for e in l: | ||
# comment | ||
yield (((((((e))))))) # Too many parentheses | ||
# comment | ||
|
||
|
||
for ridiculouslylongelementnameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee in l: | ||
yield ridiculouslylongelementnameeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | ||
|
||
|
||
for x in l: #comment | ||
yield x + (2 * 4) # trailing comment | ||
|
||
while ( | ||
|
||
yield l | ||
): | ||
pass | ||
|
||
yield from (yield l) | ||
|
35 changes: 35 additions & 0 deletions
35
crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/yield_from.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
l = [1,2,3,4] | ||
|
||
|
||
def foo(): | ||
yield from l # some comment | ||
|
||
# weird indents | ||
yield\ | ||
from\ | ||
l | ||
# indented trailing comment | ||
|
||
a = yield from l | ||
|
||
with ( | ||
# Comment | ||
yield from l | ||
# Comment | ||
): | ||
pass | ||
|
||
c = [(yield from l) , ( | ||
yield from l | ||
|
||
)] | ||
|
||
while ( | ||
yield from l | ||
): | ||
pass | ||
|
||
yield ( | ||
yield from l | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 0 additions & 103 deletions
103
crates/ruff_python_formatter/tests/snapshots/black_compatibility@py_38__python38.py.snap
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.