AstrBot icon indicating copy to clipboard operation
AstrBot copied to clipboard

STEP 2 ⚓ pyupgrade+ruff check --fix

Open LIghtJUNction opened this issue 8 months ago • 4 comments

修复了 #XYZ

Motivation

Modifications

pyupgrade + ruff check --fix 安全的修改

Check

  • [ y] 我的 Commit Message 符合良好的规范
  • [y ] 我新增/修复/优化的功能经过良好的测试

好的,这是翻译成中文的 pull request 总结:

Sourcery 总结

使用 pyupgrade 将 Python 类型注解和代码风格升级到 Python 3.10+

增强功能:

  • 通过将 ListDict 替换为 listdict 来实现类型注解的现代化
  • 更新类型提示以使用新的 Python 3.10+ 联合类型语法
  • 通过删除冗余的编码参数来简化文件打开操作

日常维护:

  • 添加一个脚本来自动在整个项目中运行 pyupgrade
  • 通过标准化类型注解来提高代码一致性
Original summary in English

Summary by Sourcery

Upgrade Python type annotations and code style to Python 3.10+ using pyupgrade

Enhancements:

  • Modernize type annotations by replacing List and Dict with list and dict
  • Update type hints to use the new Python 3.10+ syntax for union types
  • Simplify file opening by removing redundant encoding parameters

Chores:

  • Add a script to automatically run pyupgrade across the project
  • Improve code consistency by standardizing type annotations

LIghtJUNction avatar Apr 19 '25 13:04 LIghtJUNction