Skip to content

Commit

Permalink
Update black tests (astral-sh#10166)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored and nkxxll committed Mar 4, 2024
1 parent 48157cb commit ff15186
Show file tree
Hide file tree
Showing 139 changed files with 5,480 additions and 1,389 deletions.
@@ -0,0 +1,82 @@
def foo():
"""
Docstring
"""

# Here we go
if x:

# This is also now fine
a = 123

else:
# But not necessary
a = 123

if y:

while True:

"""
Long comment here
"""
a = 123

if z:

for _ in range(100):
a = 123
else:

try:

# this should be ok
a = 123
except:

"""also this"""
a = 123


def bar():

if x:
a = 123


def baz():

# OK
if x:
a = 123

def quux():

new_line = here


class Cls:

def method(self):

pass


async def async_fn():

"""Docstring."""


@decorated
async def async_fn():

"""Docstring."""


def top_level(
a: int,
b: str,
) -> Whatever[Generic, Something]:

def nested(x: int) -> int:
pass
@@ -0,0 +1,81 @@
def foo():
"""
Docstring
"""

# Here we go
if x:

# This is also now fine
a = 123

else:
# But not necessary
a = 123

if y:

while True:

"""
Long comment here
"""
a = 123

if z:

for _ in range(100):
a = 123
else:

try:

# this should be ok
a = 123
except:

"""also this"""
a = 123


def bar():

if x:
a = 123


def baz():

# OK
if x:
a = 123


def quux():

new_line = here


class Cls:

def method(self):

pass


async def async_fn():
"""Docstring."""


@decorated
async def async_fn():
"""Docstring."""


def top_level(
a: int,
b: str,
) -> Whatever[Generic, Something]:

def nested(x: int) -> int:
pass
@@ -0,0 +1,11 @@
async def func() -> (int):
return 0


@decorated
async def func() -> (int):
return 0


async for (item) in async_iter:
pass
@@ -0,0 +1,11 @@
async def func() -> int:
return 0


@decorated
async def func() -> int:
return 0


async for item in async_iter:
pass
Expand Up @@ -45,17 +45,15 @@ def wat():
@deco2(with_args=True)
# leading 3
@deco3
def decorated1():
...
def decorated1(): ...


# leading 1
@deco1
# leading 2
@deco2(with_args=True)
# leading function comment
def decorated1():
...
def decorated1(): ...


# Note: this is fixed in
Expand All @@ -65,8 +63,7 @@ def decorated1():


# This comment should be split from `some_instruction` by two lines but isn't.
def g():
...
def g(): ...


if __name__ == "__main__":
Expand Down
Expand Up @@ -45,17 +45,15 @@ def wat():
@deco2(with_args=True)
# leading 3
@deco3
def decorated1():
...
def decorated1(): ...


# leading 1
@deco1
# leading 2
@deco2(with_args=True)
# leading function comment
def decorated1():
...
def decorated1(): ...


# Note: this is fixed in
Expand All @@ -65,8 +63,7 @@ some_instruction


# This comment should be split from `some_instruction` by two lines but isn't.
def g():
...
def g(): ...


if __name__ == "__main__":
Expand Down
@@ -0,0 +1,56 @@
if (
True
# sdf
):
print("hw")

if ((
True
# sdf
)):
print("hw")

if ((
# type: ignore
True
)):
print("hw")

if ((
True
# type: ignore
)):
print("hw")

if (
# a long comment about
# the condition below
(a or b)
):
pass

def return_true():
return (
(
True # this comment gets removed accidentally
)
)

def return_true():
return (True) # this comment gets removed accidentally


if (
# huh comment
(True)
):
...

if (
# huh
(
# comment
True
)
):
...
@@ -0,0 +1,53 @@
if (
True
# sdf
):
print("hw")

if (
True
# sdf
):
print("hw")

if (
# type: ignore
True
):
print("hw")

if (
True
# type: ignore
):
print("hw")

if (
# a long comment about
# the condition below
a
or b
):
pass


def return_true():
return True # this comment gets removed accidentally


def return_true():
return True # this comment gets removed accidentally


if (
# huh comment
True
):
...

if (
# huh
# comment
True
):
...
Expand Up @@ -104,7 +104,9 @@ def foo(wait: bool = True):
time.sleep(1) if wait else None


a = "".join((
"", # comment
"" if True else "",
))
a = "".join(
(
"", # comment
"" if True else "",
)
)
@@ -0,0 +1 @@
{"target_version": "py38"}

0 comments on commit ff15186

Please sign in to comment.