⬆️ auto update by pre-commit hooks (#2565)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ju4tCode <42488585+yanyongyu@users.noreply.github.com>
This commit is contained in:
pre-commit-ci[bot]
2024-02-06 12:48:23 +08:00
committed by GitHub
parent 07e6c3f977
commit 4dae23d3bb
37 changed files with 1498 additions and 1517 deletions

View File

@ -78,8 +78,7 @@ async def reject_preset(a: str = ArgStr(), b: str = ArgStr()):
test_overload = on_message()
class FakeEvent(Event):
...
class FakeEvent(Event): ...
@test_overload.got("a")

View File

@ -8,8 +8,7 @@ class Config(BaseModel):
custom: str = ""
class FakeAdapter(Adapter):
...
class FakeAdapter(Adapter): ...
__plugin_meta__ = PluginMetadata(

View File

@ -11,20 +11,17 @@ async def legacy_bot(bot):
return bot
async def not_legacy_bot(bot: int):
...
async def not_legacy_bot(bot: int): ...
class FooBot(Bot):
...
class FooBot(Bot): ...
async def sub_bot(b: FooBot) -> FooBot:
return b
class BarBot(Bot):
...
class BarBot(Bot): ...
async def union_bot(b: Union[FooBot, BarBot]) -> Union[FooBot, BarBot]:
@ -45,5 +42,4 @@ async def generic_bot_none(b: CB) -> CB:
return b
async def not_bot(b: Union[int, Bot]):
...
async def not_bot(b: Union[int, Bot]): ...

View File

@ -36,8 +36,7 @@ class ClassDependency:
y: int = Depends(gen_async)
class FooBot(Bot):
...
class FooBot(Bot): ...
async def sub_bot(b: FooBot) -> FooBot:

View File

@ -12,20 +12,17 @@ async def legacy_event(event):
return event
async def not_legacy_event(event: int):
...
async def not_legacy_event(event: int): ...
class FooEvent(Event):
...
class FooEvent(Event): ...
async def sub_event(e: FooEvent) -> FooEvent:
return e
class BarEvent(Event):
...
class BarEvent(Event): ...
async def union_event(e: Union[FooEvent, BarEvent]) -> Union[FooEvent, BarEvent]:
@ -46,8 +43,7 @@ async def generic_event_none(e: CE) -> CE:
return e
async def not_event(e: Union[int, Event]):
...
async def not_event(e: Union[int, Event]): ...
async def event_type(t: str = EventType()) -> str:

View File

@ -13,20 +13,17 @@ async def legacy_matcher(matcher):
return matcher
async def not_legacy_matcher(matcher: int):
...
async def not_legacy_matcher(matcher: int): ...
class FooMatcher(Matcher):
...
class FooMatcher(Matcher): ...
async def sub_matcher(m: FooMatcher) -> FooMatcher:
return m
class BarMatcher(Matcher):
...
class BarMatcher(Matcher): ...
async def union_matcher(
@ -49,8 +46,7 @@ async def generic_matcher_none(m: CM) -> CM:
return m
async def not_matcher(m: Union[int, Matcher]):
...
async def not_matcher(m: Union[int, Matcher]): ...
async def receive(e: Event = Received("test")) -> Event:

View File

@ -29,8 +29,7 @@ async def legacy_state(state):
return state
async def not_legacy_state(state: int):
...
async def not_legacy_state(state: int): ...
async def command(cmd: Tuple[str, ...] = Command()) -> Tuple[str, ...]:

View File

@ -19,5 +19,4 @@ async def complex_priority(
arg: Message = Arg(),
exception: Optional[Exception] = None,
default: int = 1,
):
...
): ...

View File

@ -202,8 +202,7 @@ matcher_on_regex = on_regex(
)
class TestEvent(Event):
...
class TestEvent(Event): ...
matcher_on_type = on_type(

View File

@ -99,8 +99,7 @@ async def test_adapter_server(driver: Driver):
async def handle_http(request: Request):
return Response(200, content="test")
async def handle_ws(ws: WebSocket):
...
async def handle_ws(ws: WebSocket): ...
adapter = FakeAdapter(driver)

View File

@ -34,19 +34,15 @@ def test_generic_check_issubclass():
def test_is_coroutine_callable():
async def test1():
...
async def test1(): ...
def test2():
...
def test2(): ...
class TestClass1:
async def __call__(self):
...
async def __call__(self): ...
class TestClass2:
def __call__(self):
...
def __call__(self): ...
assert is_coroutine_callable(test1)
assert not is_coroutine_callable(test2)
@ -62,8 +58,7 @@ def test_is_gen_callable():
async def test2():
yield
def test3():
...
def test3(): ...
class TestClass1:
def __call__(self):
@ -74,8 +69,7 @@ def test_is_gen_callable():
yield
class TestClass3:
def __call__(self):
...
def __call__(self): ...
assert is_gen_callable(test1)
assert not is_gen_callable(test2)
@ -92,8 +86,7 @@ def test_is_async_gen_callable():
def test2():
yield
async def test3():
...
async def test3(): ...
class TestClass1:
async def __call__(self):
@ -104,8 +97,7 @@ def test_is_async_gen_callable():
yield
class TestClass3:
async def __call__(self):
...
async def __call__(self): ...
assert is_async_gen_callable(test1)
assert not is_async_gen_callable(test2)