已关闭
[Bug-Report|缺陷反馈]: scripts/build_util.py 使用 dict() 而非字面量(ruff C408) #91
syy_3597创建于  8月17日关闭于  8月17日
syy_3597
8月17日 创建

Describe the current behavior / 问题描述 (Mandatory / 必填)

scripts/build_util.py:56 使用 dict() 构造空字典,违反 ruff C408 规则:

# scripts/build_util.py:54-56
def get_info_from_file(file_path):
    result = True
    tactic_info = dict()   # <--- 应改为 {}

dict() 调用比字面量 {} 更慢且不够 Pythonic,ruff C408 规则建议统一使用字面量。

Environment / 环境信息 (Mandatory / 必填)

不涉及特定环境

Describe the expected behavior / 预期结果 (Mandatory / 必填)

将 dict() 替换为 {}:

tactic_info = {}

Special notes for this issue/备注 (Optional / 选填)

改动仅 1 行,风险极低。

likedislike
east_yang成员
8月17日 评论:

已安排开发人员处理

likedislike
Eeast_yang成员
8月17日 将 east_yang 设为负责人
Ssyy_3597
8月17日 关联了pull request:fix: 修复 scripts/ 下 ruff 告警及 install_deps.sh dos2unix 问题
CANN-robotCANN-robot成员
8月17日 关闭了 issue
CANN-robotCANN-robot成员
8月17日 添加了label:resolved