From 9686a31419dcd020c9af0003125e8e438b85ee04 Mon Sep 17 00:00:00 2001 From: molanp <104612722+molanp@users.noreply.github.com> Date: Sat, 12 Jul 2025 00:05:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91refactor(config):=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=A8=A1=E5=9E=8Btype=E6=A0=A1=E9=AA=8C=20(#1974)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🚑refactor(config): 修复模型type校验 * :rotating_light: auto fix by pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- zhenxun/builtin_plugins/init/init_config.py | 2 +- zhenxun/configs/utils/models.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zhenxun/builtin_plugins/init/init_config.py b/zhenxun/builtin_plugins/init/init_config.py index 51a7da47..0c8d1a96 100644 --- a/zhenxun/builtin_plugins/init/init_config.py +++ b/zhenxun/builtin_plugins/init/init_config.py @@ -46,7 +46,7 @@ def _handle_config(plugin: Plugin, exists_module: list[str]): reg_config.value, help=reg_config.help, default_value=reg_config.default_value, - type=reg_config.type, + type=reg_config.type, # type: ignore arg_parser=reg_config.arg_parser, _override=False, ) diff --git a/zhenxun/configs/utils/models.py b/zhenxun/configs/utils/models.py index f60fdc92..1872d1ce 100644 --- a/zhenxun/configs/utils/models.py +++ b/zhenxun/configs/utils/models.py @@ -1,6 +1,6 @@ from collections.abc import Callable from datetime import datetime -from typing import Any, Literal, Type # noqa: UP035 +from typing import Any, Literal from nonebot.compat import model_dump from pydantic import BaseModel, Field @@ -65,7 +65,7 @@ class RegisterConfig(BaseModel): """配置注解""" default_value: Any | None = None """默认值""" - type: Type = str # noqa: UP006 + type: object = str """参数类型""" arg_parser: Callable | None = None """参数解析"""