Open
【11月贡献大赛-缺陷修复】fix(analyse-coverage): [Bug] fix uncovered function line count, missing start_line TypeError, and list exit code in analyze_function_coverage.py #7332
【11月贡献大赛-缺陷修复】fix(analyse-coverage): [Bug] fix uncovered function line count, missing start_line TypeError, and list exit code in analyze_function_coverage.py #7332
Open
liuhongweiAdd on 3 hours ago
liuhongwei
liuhongwei
3 hours ago

关联 Issue

  • 无(社区自测发现的脚本缺陷修复)

改动说明

  • 修复 skills/common/analyse-coverage/scripts/analyze_function_coverage.py 中 calculate_function_lines() 对 0% 覆盖函数(executed_lines=[])误报 0 行及 start_line='N/A' 时抛出 TypeError 的问题。
  • 新增 _load_coverage_files() 与 _resolve_file_entry():捕获读取/JSON 解析异常并校验 files 映射,兼容 / 与 \ 路径分隔符查询。
  • 修复 list_all_functions() 在文件不存在或覆盖率 JSON 异常时返回 False 并在 main() 返回退出码 1。
  • 新增回归单元测试 skills/common/analyse-coverage/tests/test_analyze_function_coverage.py。

改动类型

自检清单

测试结果

python -m pytest -q skills/common/analyse-coverage/tests/test_analyze_function_coverage.py
# 3 passed in 0.26s
likedislike
Merge blocked
ascend-robotascend-robotCollaborators
3 hours ago Added label: ascend-cla/yes
ascend-robot
ascend-robotCollaborators
3 hours ago Comments:

Thanks for your pull-request.
The full list of commands accepted by me can be found at here.
You can get sig-info at here.
You can self-configure the PR merge rules for this repository. For more details, please refer to Here.


PR Approval Progress

⚠️ This PR does not yet meet the following requirements:lgtm (requires ≥ 2 person(s) per module)、approve (requires ≥ 1 person(s) per module)

Module Approval Details

module lgtm status approve status
sig-model-agent ❌ (0/2)(You can also ask: 林泽毅, 顾梦沁, 刘磊, 张玉橙, shaos-governance) ❌ (0/1)(You can also ask: 刘磊, 花新宇, 胡晓曼, 陈少宏, 林泽毅)

💡 Tip:

  • Committer can comment /approve or /lgtm
  • Commenting /approve implies both code review (lgtm) and intent to merge (approve)

CLA Signature Pass

liuhongwei-2026, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike