From 849cc24968f104bbfc6dfebe396b94f6a91d840f Mon Sep 17 00:00:00 2001 From: Snowykami Date: Fri, 13 Dec 2024 18:53:47 +0800 Subject: [PATCH] :art: Apply black formatting --- .pre-commit-config.yaml | 14 +++++++------- .../tools/marshoai_megakits/mk_common.py | 14 ++++++-------- .../tools/marshoai_meogirl/mg_introduce.py | 2 +- pyproject.toml | 7 +++++-- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc2b5fec..c7f117c7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,10 +16,10 @@ repos: hooks: - id: mypy - # - repo: https://github.com/pre-commit/pre-commit-hooks - # rev: v4.0.1 - # hooks: - # - id: trailing-whitespace - # - id: end-of-file-fixer - # - id: check-yaml - # - id: check-added-large-files + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files diff --git a/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_common.py b/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_common.py index c049703a..2fa46cc2 100644 --- a/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_common.py +++ b/nonebot_plugin_marshoai/tools/marshoai_megakits/mk_common.py @@ -14,7 +14,6 @@ async def random_turntable(upper: int, lower: int): return random.randint(lower, upper) - async def number_calc(a: str, b: str, op: str) -> str: """Number Calc @@ -26,20 +25,19 @@ async def number_calc(a: str, b: str, op: str) -> str: Returns: str: _description_ """ - a, b = float(a), float(b) # type: ignore + a, b = float(a), float(b) # type: ignore match op: case "+": - return str(a + b) # type: ignore + return str(a + b) # type: ignore case "-": - return str(a - b) # type: ignore + return str(a - b) # type: ignore case "*": - return str(a * b) # type: ignore + return str(a * b) # type: ignore case "/": - return str(a / b) # type: ignore + return str(a / b) # type: ignore case "**": - return str(a**b) # type: ignore + return str(a**b) # type: ignore case "%": return str(a % b) case _: return "未知运算符" - \ No newline at end of file diff --git a/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_introduce.py b/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_introduce.py index f79da62f..40bb1566 100644 --- a/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_introduce.py +++ b/nonebot_plugin_marshoai/tools/marshoai_meogirl/mg_introduce.py @@ -67,7 +67,7 @@ async def introduce(msg: str): from . import mg_search context = await mg_search.search(msg, 1) - keyword = re.search(r".*?\n", context, flags=re.DOTALL).group()[:-1] # type: ignore + keyword = re.search(r".*?\n", context, flags=re.DOTALL).group()[:-1] # type: ignore logger.success(f'搜索完成, 打开"{keyword}"') return await introduce(keyword) diff --git a/pyproject.toml b/pyproject.toml index 0eec78be..35bf913a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,10 @@ dynamic = ["version"] description = "Nonebot2插件,调用Azure OpenAI等AI服务实现猫娘聊天" readme = "README.md" requires-python = "<4.0,>=3.10" -authors = [{ name = "Asankilp", email = "asankilp@outlook.com" }] +authors = [ + { name = "Asankilp", email = "asankilp@outlook.com" }, + {name="LiteyukiStudio", email = "support@liteyuki.icu"} +] dependencies = [ "nonebot2>=2.2.0", "nonebot-plugin-alconna>=0.48.0", @@ -56,4 +59,4 @@ dev = [ "nonebot-adapter-onebot>=2.4.6", "mypy>=1.13.0", "black>=24.10.0", -] \ No newline at end of file +]