🚨 Develop: 完全使用 ruff 替代 isort 与 black (#3151)

This commit is contained in:
Ju4tCode
2024-12-01 12:31:11 +08:00
committed by GitHub
parent 6dad4d2a74
commit 081dc8352d
83 changed files with 1815 additions and 1769 deletions

View File

@ -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

View File

@ -1,4 +1,4 @@
from typing import Union, TypeVar
from typing import TypeVar, Union
from nonebot.adapters import Bot

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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():