mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 05:25:17 +00:00
Use space
separator before parenthesiszed expressions in comprehensions with leading comments. (#12282)
This commit is contained in:
parent
d0298dc26d
commit
bd01004a42
4 changed files with 274 additions and 6 deletions
|
@ -105,3 +105,66 @@ aaaaaaaaaaaaaaaaaaaaa = [
|
|||
# Parenthesized targets and iterators.
|
||||
[x for (x) in y]
|
||||
[x for x in (y)]
|
||||
|
||||
|
||||
# Leading expression comments:
|
||||
y = [
|
||||
a
|
||||
for (
|
||||
# comment
|
||||
a
|
||||
) in (
|
||||
# comment
|
||||
x
|
||||
)
|
||||
if (
|
||||
# asdasd
|
||||
"askldaklsdnmklasmdlkasmdlkasmdlkasmdasd"
|
||||
!= "as,mdnaskldmlkasdmlaksdmlkasdlkasdm"
|
||||
and "zxcm,.nzxclm,zxnckmnzxckmnzxczxc" != "zxcasdasdlmnasdlknaslkdnmlaskdm"
|
||||
)
|
||||
if (
|
||||
# comment
|
||||
x
|
||||
)
|
||||
]
|
||||
|
||||
# Tuple target:
|
||||
y = [
|
||||
a
|
||||
for
|
||||
# comment
|
||||
a, b
|
||||
in x
|
||||
if True
|
||||
]
|
||||
|
||||
|
||||
y = [
|
||||
a
|
||||
for (
|
||||
# comment
|
||||
a, b
|
||||
)
|
||||
in x
|
||||
if True
|
||||
]
|
||||
|
||||
|
||||
y = [
|
||||
a
|
||||
for
|
||||
# comment
|
||||
a
|
||||
in
|
||||
# comment
|
||||
x
|
||||
if
|
||||
# asdasd
|
||||
"askldaklsdnmklasmdlkasmdlkasmdlkasmdasd"
|
||||
!= "as,mdnaskldmlkasdmlaksdmlkasdlkasdm"
|
||||
and "zxcm,.nzxclm,zxnckmnzxckmnzxczxc" != "zxcasdasdlmnasdlknaslkdnmlaskdm"
|
||||
if
|
||||
# comment
|
||||
x
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue