mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-06 12:06:45 +00:00
🚨 Develop: 完全使用 ruff 替代 isort 与 black (#3151)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
from nonebot import on_message
|
||||
from nonebot.matcher import Matcher
|
||||
from nonebot.adapters import Event, Message
|
||||
from nonebot.params import ArgStr, Received, EventMessage, LastReceived
|
||||
from nonebot.matcher import Matcher
|
||||
from nonebot.params import ArgStr, EventMessage, LastReceived, Received
|
||||
|
||||
test_handle = on_message()
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
from typing import Annotated
|
||||
|
||||
from nonebot.adapters import Message
|
||||
from nonebot.params import Arg, ArgStr, ArgPlainText
|
||||
from nonebot.params import Arg, ArgPlainText, ArgStr
|
||||
|
||||
|
||||
async def arg(key: Message = Arg()) -> Message:
|
||||
@ -34,6 +34,6 @@ async def annotated_prior_arg(key: Annotated[str, ArgStr("foo")] = ArgPlainText(
|
||||
|
||||
|
||||
async def annotated_multi_arg(
|
||||
key: Annotated[Annotated[str, ArgStr("foo")], ArgPlainText()]
|
||||
key: Annotated[Annotated[str, ArgStr("foo")], ArgPlainText()],
|
||||
):
|
||||
return key
|
||||
|
@ -1,4 +1,4 @@
|
||||
from typing import Union, TypeVar
|
||||
from typing import TypeVar, Union
|
||||
|
||||
from nonebot.adapters import Bot
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from typing import Annotated
|
||||
from dataclasses import dataclass
|
||||
from typing import Annotated
|
||||
|
||||
import anyio
|
||||
from pydantic import Field
|
||||
@ -74,13 +74,13 @@ async def annotated_class_depend(c: Annotated[ClassDependency, Depends()]):
|
||||
|
||||
# test dependency priority
|
||||
async def annotated_prior_depend(
|
||||
x: Annotated[int, Depends(lambda: 2)] = Depends(dependency)
|
||||
x: Annotated[int, Depends(lambda: 2)] = Depends(dependency),
|
||||
):
|
||||
return x
|
||||
|
||||
|
||||
async def annotated_multi_depend(
|
||||
x: Annotated[Annotated[int, Depends(lambda: 2)], Depends(dependency)]
|
||||
x: Annotated[Annotated[int, Depends(lambda: 2)], Depends(dependency)],
|
||||
):
|
||||
return x
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
from typing import Union, TypeVar
|
||||
from typing import TypeVar, Union
|
||||
|
||||
from nonebot.adapters import Event, Message
|
||||
from nonebot.params import EventToMe, EventType, EventMessage, EventPlainText
|
||||
from nonebot.params import EventMessage, EventPlainText, EventToMe, EventType
|
||||
|
||||
|
||||
async def event(e: Event) -> Event:
|
||||
|
@ -1,8 +1,8 @@
|
||||
from typing import Union, TypeVar
|
||||
from typing import TypeVar, Union
|
||||
|
||||
from nonebot.adapters import Event
|
||||
from nonebot.matcher import Matcher
|
||||
from nonebot.params import Received, LastReceived
|
||||
from nonebot.params import LastReceived, Received
|
||||
|
||||
|
||||
async def matcher(m: Matcher) -> Matcher:
|
||||
|
@ -1,24 +1,24 @@
|
||||
from re import Match
|
||||
|
||||
from nonebot.typing import T_State
|
||||
from nonebot.adapters import Message
|
||||
from nonebot.params import (
|
||||
Command,
|
||||
Keyword,
|
||||
Endswith,
|
||||
RegexStr,
|
||||
Fullmatch,
|
||||
RegexDict,
|
||||
CommandArg,
|
||||
RawCommand,
|
||||
RegexGroup,
|
||||
Startswith,
|
||||
CommandStart,
|
||||
CommandWhitespace,
|
||||
Endswith,
|
||||
Fullmatch,
|
||||
Keyword,
|
||||
RawCommand,
|
||||
RegexDict,
|
||||
RegexGroup,
|
||||
RegexMatched,
|
||||
RegexStr,
|
||||
ShellCommandArgs,
|
||||
ShellCommandArgv,
|
||||
CommandWhitespace,
|
||||
Startswith,
|
||||
)
|
||||
from nonebot.typing import T_State
|
||||
|
||||
|
||||
async def state(x: T_State) -> T_State:
|
||||
|
@ -1,9 +1,9 @@
|
||||
from typing import Optional
|
||||
|
||||
from nonebot.typing import T_State
|
||||
from nonebot.adapters import Bot, Event, Message
|
||||
from nonebot.matcher import Matcher
|
||||
from nonebot.params import Arg, Depends
|
||||
from nonebot.adapters import Bot, Event, Message
|
||||
from nonebot.typing import T_State
|
||||
|
||||
|
||||
def dependency():
|
||||
|
@ -1,24 +1,24 @@
|
||||
from datetime import datetime, timezone
|
||||
|
||||
from nonebot.adapters import Event
|
||||
from nonebot.matcher import Matcher
|
||||
from nonebot import (
|
||||
CommandGroup,
|
||||
MatcherGroup,
|
||||
on,
|
||||
on_type,
|
||||
on_regex,
|
||||
on_notice,
|
||||
on_command,
|
||||
on_keyword,
|
||||
on_message,
|
||||
on_request,
|
||||
on_endswith,
|
||||
on_fullmatch,
|
||||
on_keyword,
|
||||
on_message,
|
||||
on_metaevent,
|
||||
on_startswith,
|
||||
on_notice,
|
||||
on_regex,
|
||||
on_request,
|
||||
on_shell_command,
|
||||
on_startswith,
|
||||
on_type,
|
||||
)
|
||||
from nonebot.adapters import Event
|
||||
from nonebot.matcher import Matcher
|
||||
|
||||
|
||||
async def rule() -> bool:
|
||||
|
Reference in New Issue
Block a user