Skip to content

Commit a42692e

Browse files
authored
fix: 修复插件元数据缺失时不报错的问题 (#350)
1 parent 31f3f0c commit a42692e

File tree

10 files changed

+1073
-794
lines changed

10 files changed

+1073
-794
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/lang/zh-CN/
1010
### Fixed
1111

1212
- 修复在评论议题后立即关闭拉取请求,拉取请求会被再次创建的问题
13+
- 修复插件元数据缺失时不报错的问题
1314

1415
## [4.2.3] - 2024-12-30
1516

src/providers/validation/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def plugin_test_metadata_validator(
317317
if context is None:
318318
raise PydanticCustomError("validation_context", "未获取到验证上下文")
319319

320-
if v is None:
320+
if not v:
321321
raise PydanticCustomError(
322322
"plugin.metadata",
323323
"插件无法获取到元数据",
@@ -383,7 +383,7 @@ class ValidationDict(BaseModel):
383383

384384
@property
385385
def valid(self) -> bool:
386-
return not self.errors
386+
return self.info is not None
387387

388388
@property
389389
def name(self) -> str:

0 commit comments

Comments
 (0)