Skip to content

chore: auto ann fix by ruff#4903

Merged
Soulter merged 9 commits intoAstrBotDevs:masterfrom
Dt8333:chore-ann-prefix
Feb 8, 2026
Merged

chore: auto ann fix by ruff#4903
Soulter merged 9 commits intoAstrBotDevs:masterfrom
Dt8333:chore-ann-prefix

Conversation

@Dt8333
Copy link
Member

@Dt8333 Dt8333 commented Feb 6, 2026

减少 #3181 未来review的工作量

Modifications / 改动点

使用ruff自动修复部分显然的ANN错误。

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果


Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Dt8333, your pull request is larger than the review limit of 150000 diff characters


async def _check_plugin_dept_update(self, target_plugin: str | None = None):
async def _check_plugin_dept_update(
self, target_plugin: str | None = None
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo 检查

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

也许需要明确一下这个函数返回值含义

return ret

def unzip(self):
def unzip(self) -> NoReturn:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo 修正

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么会……有这个未实现的函数?

raise NotImplementedError

async def update(self):
async def update(self) -> NoReturn:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo 修正

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么会……有这个未实现的函数?

@Dt8333 Dt8333 marked this pull request as ready for review February 6, 2026 07:57
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 6, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @Dt8333, your pull request is larger than the review limit of 150000 diff characters

@dosubot
Copy link

dosubot bot commented Feb 6, 2026

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added the area:core The bug / feature is about astrbot's core, backend label Feb 6, 2026
@safe1ine
Copy link

safe1ine commented Feb 6, 2026

@MonkeyCode-AI review 一下

@MonkeyCode-AI
Copy link

MonkeyCode-AI 正在分析任务...

Copy link

@MonkeyCode-AI MonkeyCode-AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我是 MonkeyCode AI 编程助手,你可以在 GitHub 仓库的 PR 中 at @MonkeyCode-AI 来呼唤我。

任务执行细节请参考: https://monkeycode-ai.com/tasks/public?id=46bbd46a-0bf1-4e16-8ba9-8d083c84a196

代码审查结果

整体为 ruff 自动补全类型注解与少量格式化,绝大多数属于静态类型改进,但存在少量高风险“只改签名不改实现/接口契约”的变更需要回退或补充验证。

✨ 代码亮点

  • 大规模补全返回类型注解(尤其是 async 函数 -> None)能显著降低 ANN 类问题与未来 review 成本
  • 对多处 repr/str/len/bool 等魔术方法补全返回类型,有助于类型检查与 IDE 推断
🚨 Critical ⚠️ Warning 💡 Suggestion
2 0 0

@Soulter
Copy link
Member

Soulter commented Feb 7, 2026

处理一下conflicts吧

@Dt8333
Copy link
Member Author

Dt8333 commented Feb 7, 2026

Resolved

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 8, 2026
@Soulter Soulter merged commit 7dd95d8 into AstrBotDevs:master Feb 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core The bug / feature is about astrbot's core, backend lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants