Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Malformed justification YAML exits 1 instead of the no-verdict code 2

未关闭
#16 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
cli, testing-qa

调研方向

Start in score_coverage/justify.py at load_yaml(), then trace exception handling through _call_tool() and main() in score_coverage/generate_coverage_html.py. Reproduce the CLI with a valid report archive and YAML containing version: [. Done means the malformed YAML produces a useful diagnostic, exits 2, and has CLI regression coverage.

由索引模型根据 Issue 内容生成。

描述

bug

Found while reviewing the architecture documentation. Verified against upstream HEAD d99515b87bbe1dde89984403e9c330d640fc5d33 using synthetic report archives and the real generate_coverage_html CLI (no gate/justification mocks).

A YAML syntax error escapes the error handling in generate_coverage_html. Python terminates with exit 1 and a traceback, which is reserved for a successfully evaluated coverage result below the threshold.

Reproduction

Use an otherwise valid report zip and pass --yaml pointing to a file containing:

version: [

Invoke generate_coverage_html in a consumer workspace. The real CLI exits 1 with a PyYAML parser exception, rather than 2 with a controlled diagnostic. The report was successfully extracted before the failure.

Cause and expected behavior

justify.load_yaml() calls yaml.safe_load() before structural validation. _call_tool() translates only nonzero SystemExit; main() catches only GenerateError. The parser exception therefore escapes both boundaries.

Translate YAML parse errors into the no-verdict path, preserving a useful file/location diagnostic. Add CLI regression coverage asserting exit 2. Related input/output exceptions should be audited against the same contract, but only the YAML syntax case was reproduced here.

This violates tool_req__coverage_gate_exit_codes and tool_req__coverage_gate_no_verdict.

Relevant code
主要语言
Python
星标
0
派生
3
平均合并
18 小时 24 分钟
30 天内合并 PR
16

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

eclipse-score/coverage_tool 的其他 Issue

查看 eclipse-score/coverage_tool 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。