fix(mypy): 移除 7 处失效 type:ignore 修复 type-check baseline gate#75
Merged
Conversation
type-check job 的 mypy baseline gate 报 111 > 105。根因是 deepseek_gen.py 中 self.log_info/log_error(...) 上的 # type: ignore[attr-defined] 已失效 (log_info/log_error/log_warning 在 BaseAIGeneratorPlugin 基类有具体类型 定义,mypy 可解析),随 mypy/依赖版本漂移被判为 unused-ignore。 移除这 7 处失效 ignore,使错误数回落至 baseline 以下。该文件非本轮重构 改动,属预存 + 环境敏感问题。type-check job 为 continue-on-error,不阻塞。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
main 上
type-checkjob 的 mypy baseline gate 报111 > 105失败(job 为 continue-on-error,不阻塞合并,但显示红叉)。根因
deepseek_gen.py中self.log_info/log_error(...)上的# type: ignore[attr-defined]已失效——log_info/log_error/log_warning在BaseAIGeneratorPlugin基类有具体类型定义,mypy 能正常解析。随 mypy/依赖版本漂移,这些 ignore 被判为unused-ignore,错误数累积越过 baseline。该文件非本轮重构改动,属预存 + 环境敏感问题。
修复
移除 7 处失效
# type: ignore[attr-defined](log_* 调用),错误数回落 104 ≤ 105。验证
workflow_dispatch 在本分支跑全量 ci.yml:lint / test(3.11) / test(3.12) / type-check 全绿,
Mypy baseline OK (104 <= 105)。