已开启
代码清理:trainer / models 行为中立的 clean code 整理 #252
xuxinglei创建于  6月25日
xuxinglei成员
6月25日 创建

该问题是怎么引起的?

静态检查门禁在 hyper_parallel/trainerhyper_parallel/modelsscripts/train_{lm,vl}.py 下扫描出一批行为中立的代码风格项(模块 __all__ 与 import 顺序、无需访问实例的方法可声明为 @staticmethodBaseTrainer 实例属性在 __init__ 外定义、dict[key] 未防御取值等),需做 clean code 整理,统一代码风格、提升可读性,不涉及功能逻辑变更

重现步骤

对上述目录跑静态检查门禁即可列出这些代码风格项。

报错信息

均为代码风格类项(import 顺序 / staticmethod / 类属性声明 / dict.get 等),行为中立,无运行期报错。

likedislike
Xxuxinglei成员
6月25日 关联了pull request:refactor: behavior-neutral code cleanup (backport of #911 to r1.0.0)
Lliu-yanwei6成员
6月27日 关联了pull request:clean code
Yyao_yf成员
6月27日 关联了pull request:refactor: fix pylint warnings across dtensor, shard, and platform modules
Yyao_yf成员
6月29日 关联了pull request:refactor: fix pylint warnings across dtensor, shard, and platform modules