已合并
fix: pre-commit code #199
RuiWang_创建于 8 天前
fix: pre-commit code #199
已合并
Pull Request已成功合入, 合并人@CANN-robot
(感谢 RuiWang_ 的贡献)8 天前 添加了label:cann-cla/yes
此处折叠了42条消息 查看更多
CANN-robot
8 天前 评论:
8 天前 评论:
The following label is not ready.
approved: Please wait for committers to review the code.


songchangxia
8 天前 评论:
8 天前 评论:
/lgtm
/approve


8 天前 添加了label:approved
8 天前 合入了pull request
当前PR是否有AI参与:
[x] 否
[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :
PR功能描述 / 为什么需要这个合入**:
让全仓代码通过 pre-commit 全套 hook(ruff check + ruff format + codespell + trailing-whitespace / end-of-file-fixer / check-yaml 等基础 hook),共涉及 255 个文件(+9975/-7615)。
修复内容分类
del cas_mmtimeout未定义(10 处 F821),提取_get_timeout()为变量# noqa__future__顺序;延迟导入加# noqaimport *展开为显式 importexcept:→except Exception:raise X→raise X from e(链式)/from None(有意屏蔽)import x as x(不改import *行为)_%格式化 → f-string(用 float()/str() 强转保留 printf 语义)!= True→~、模糊名l→ci、lambda→def、rstrip 多字符精确化codespell 修复
.gitcode/ISSUE_TEMPLATE/feature-request.yml:Backgroud→Background(真错字)dOut(数据术语 derivative output,误报)该PR关联的issue
(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #
希望检视人员了解:
except:→except Exception:+ 9 处from e/from None的异常处理变更(E722/B904,ruff 无自动修复,手动逐处确认语义安全),以及 10 处 hccl_cascade timeout bug 修复。--unsafe-fixes,这些删除/改名是手动执行并逐一确认变量确实未使用。%-14.18f→{float(x):<14.18f}(加 float() 强转,因为 ml_dtypes.int4 的 printf 会强转但 f-string:f不会),输出逐字节一致。__init__.py/ shim 模块的 F401 修复用import x as x而非__all__,完全不改from module import *行为。测试
executor_main为预存在的运行时依赖)文档更新
类型标签