Classify included headers without executable code as declaration-only, not no-data
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 领域
- testing-qa
调研方向
Start with select_files in reporter.py and its declaration-only naming rule, then check how the scope aspect records compiled objects. Run the reporter on a workspace with Watchdog.hpp (included by WatchdogImpl_UT.cpp, no companion source) and read the unmapped_files.txt output. Done when that header is reported as declaration-only, no-data keeps only files no unit compiled or included, unit tests cover both cases, and the manual's unmapped-files section describes the rule.
由索引模型根据 Issue 内容生成。
描述
Observation
unmapped_files.txt lists score/launch_manager/src/daemon/src/watchdog/details/Watchdog.hpp (lifecycle) as no-data, although WatchdogImpl_UT.cpp includes it and its tests run. The header holds only constexpr constants and includes, no function, so clang emits no coverage region for it and llvm-cov cannot list it. There is nothing to measure; the file belongs in the harmless declaration-only category.
Not a bug in the measurement: no coverage is lost. The category is wrong.
Why
select_files in reporter.py recognises declaration-only by a naming rule: a header without data whose same-stem source has data (foo.h next to a compiled foo.cpp). A header with no companion source, such as a constants-only or interface-only header, cannot be told apart from a header nothing includes, because a header without functions leaves no trace in the objects. It falls into no-data, the category that is meant to flag real gaps.
Proposal
Use the compiler's own knowledge of which headers were included:
- With
-MD/.ddependency files (Bazel's.doutputs ofCppCompileactions) or theshowIncludes-style data, the scope aspect can record the set of headers each translation unit included. - The reporter then classifies an unmapped header that appears in any compiled unit's include set as
declaration-only(included, nothing executable), and leavesno-datafor headers no unit included.
Alternative, cheaper but weaker: scan the header text for function definitions ({ bodies outside class/namespace declarations) and classify headers without any as declaration-only. Heuristic and fragile with templates and macros; the dependency-file route is exact.
Acceptance
Watchdog.hpp-style headers (included, no functions, no same-stem source) are reported asdeclaration-only.no-datakeeps only files no translation unit in the run compiled or included.- Unit test for both cases; end-to-end workspace gets one constants-only header without a companion source.
- Manual's unmapped-files section describes the rule.
- 主要语言
- Python
- 星标
- 0
- 派生
- 3
- 平均合并
- 18 小时 24 分钟
- 30 天内合并 PR
- 16
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
eclipse-score/coverage_tool 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
eclipse-score/coverage_tool#27 ·
维护者通常 1 天内回复
-
testing
难度 5/5 一周以上 新手友好度 22/100
eclipse-score/coverage_tool#42 ·
维护者通常 1 天内回复
-
testing
难度 3/5 半天 新手友好度 20/100
eclipse-score/coverage_tool#41 ·
维护者通常 1 天内回复
-
testing
难度 4/5 3-5 天 新手友好度 35/100
eclipse-score/coverage_tool#39 ·
维护者通常 1 天内回复
-
switch from pylint to basedpyright可能已有人在做 @kirankumar-H-V 于 14 天前认领。 未关闭quality
难度 4/5 3-5 天 新手友好度 35/100
eclipse-score/coverage_tool#30 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 eclipse-score/coverage_tool 的全部 Issue
相似的 Issue
-
type-bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
push_gh-pages fails on master branch on forks可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭good first issue infrastructure
难度 2/5 1-3 小时 新手友好度 76/100
kuznia-rdzeni/coreblocks#1135 ·
-
good first issue server
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
documentation priority: high
难度 2/5 1-3 小时 新手友好度 78/100
a-lex-s/mealie-telegram-bot#54 ·
维护者通常 1 天内回复