Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Classify included headers without executable code as declaration-only, not no-data

Đang mở
#43 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp, python
Lĩnh vực
testing-qa

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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/.d dependency files (Bazel's .d outputs of CppCompile actions) or the showIncludes-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 leaves no-data for 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 as declaration-only.
  • no-data keeps 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.
Ngôn ngữ chính
Python
Star
0
Fork
3
Merge trung bình
18 giờ 24 phút
Pull request đã merge (30 ngày)
16

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-score/coverage_tool

Tất cả issue của eclipse-score/coverage_tool

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.