-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
None
-
DaVinci 122, DaVinci 123, DaVinci 124
QDoc warning messages currently include absolute file paths emitted by the Location class (location.h/.cpp). The same source file therefore appears with different prefixes on different machines (for example, /Users/developer/project/src/myclass.cpp:42 on a laptop and /home/ci/workspace/src/myclass.cpp:42 in CI). These machine-specific paths make warning logs non-portable, undermine automated comparison of the logwarnings output between local and CI runs, and prevent meaningful trend tracking in version control without brittle path-normalization.
Proposal
Introduce a .qdocconf option named projectroot (alternatively repositoryroot). QDoc will resolve this setting to an absolute path internally. When it is present, the Location class should format warning messages using paths relative to this root; when it is absent, QDoc should keep the current absolute-path behavior. The implementation must integrate with the existing warning infrastructure, preserve line/column accuracy, and behave sensibly when a referenced file lies outside the configured root (e.g., by falling back to the absolute path). Interactions with existing path-related options such as sourcedirs and headerdirs should be considered to avoid surprises.
Current vs. expected output
Current:
{{/Users/developer/project/src/myclass.cpp:42: (qdoc) warning: Undocumented parameter 'value'
/home/ci/workspace/src/myclass.cpp:42: (qdoc) warning: Undocumented parameter 'value'}}
Expected when projectroot is set:
src/myclass.cpp:42: (qdoc) warning: Undocumented parameter 'value'
Acceptance & documentation
This change is complete when .qdocconf accepts the projectroot option; warnings use paths relative to that root across subdirectories; files outside the root continue to show absolute paths; accuracy of file, line, and column information is unchanged; and the QDoc documentation explains the new option and the fallback behavior.
- resulted from
-
QTBUG-138811 QDoc: Add warning log file generation
-
- Closed
-