Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#43 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cpp, python
Área
testing-qa

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Python
Estrellas
0
Forks
3
Merge medio
18 h 24 min
PR fusionados (30 d)
16

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de eclipse-score/coverage_tool

Todos los issues de eclipse-score/coverage_tool

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.