g1331 / xiaomai-bot

以Graia Ariadne框架为基础的战地1QQ机器人
GNU General Public License v3.0
44 stars 6 forks source link

fix(ExceptionCatcher): 修复过时语法 #44

Closed g1331 closed 2 months ago

g1331 commented 2 months ago

Summary by Sourcery

通过更新字符串赋值和变量引用,修复 ExceptionCatcher 模块中的过时语法,以确保兼容性和正确性。

Bug 修复:

Original summary in English ## Summary by Sourcery Fix outdated syntax in the ExceptionCatcher module by updating string assignments and variable references to ensure compatibility and correctness. Bug Fixes: - Fix outdated syntax in the ExceptionCatcher module by updating string assignments and variable references.
sourcery-ai[bot] commented 2 months ago

审核指南由 Sourcery 提供

此拉取请求更新了 ExceptionCatcher 模块,以修复过时的语法并改进错误报告。更改包括更新通道元数据分配语法、纠正错误报告中的属性名称以及优化错误报告中的局部变量输出。

文件级更改

更改 详情 文件
更新通道元数据分配语法
  • 从 channel.meta 分配中的字符串值中移除括号
  • 简化为 channel.meta 字典分配值的语法
modules/required/exception_catcher/__init__.py
纠正错误报告中的属性名称
  • 将 'report.info.line' 更改为 'report.info.line_index'
  • 将 'report.info.code' 更改为 'report.info.codes'
modules/required/exception_catcher/__init__.py
优化错误报告中的局部变量输出
  • 更新包含局部变量在报告中的条件
  • 在检查变量存在时,将 'report.info.code' 更改为 'report.info.locals'
modules/required/exception_catcher/__init__.py

提示 - 通过在拉取请求中评论 `@sourcery-ai review` 来触发新的 Sourcery 审核。 - 通过直接回复审核评论继续与 Sourcery 的讨论。 - 您可以随时通过访问您的[仪表板](https://app.sourcery.ai)来更改审核设置: - 启用或禁用 Sourcery 生成的拉取请求摘要或审核指南; - 更改审核语言; - 如果您有任何问题或反馈,您可以随时[联系我们](mailto:support@sourcery.ai)。
Original review guide in English ## Reviewer's Guide by Sourcery This pull request updates the ExceptionCatcher module to fix outdated syntax and improve error reporting. The changes include updating the channel metadata assignment syntax, correcting attribute names in error reporting, and refining the local variable output in the error report. ### File-Level Changes | Change | Details | Files | | ------ | ------- | ----- | | Update channel metadata assignment syntax |
  • Remove parentheses from string values in channel.meta assignments
  • Simplify the syntax for assigning values to channel.meta dictionary
| `modules/required/exception_catcher/__init__.py` | | Correct attribute names in error reporting |
  • Change 'report.info.line' to 'report.info.line_index'
  • Change 'report.info.code' to 'report.info.codes'
| `modules/required/exception_catcher/__init__.py` | | Refine local variable output in error report |
  • Update the condition for including local variables in the report
  • Change 'report.info.code' to 'report.info.locals' when checking for variable presence
| `modules/required/exception_catcher/__init__.py` | ---
Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.