WARN_IF_UNDOCUMENTED
YES
EXTRACT_ALL
到
NO
。
WARN_IF_UNDOCUMENTED = YES
时。
实际行为:doxygen默默地跳过文件,没有任何文档,也不会发出警告。
下面的样本代码:
test_project/
├── src/
│ ├── documented_file.h
│ ├── partially_documented_file.c
│ ├── undocumented_file.h
│ ├── undocumented_file.c
├── Doxyfile
documented_file.h
/**
* @file documented_file.h
* @brief
* @author Your Name
* @date YYYY-MM-DD
*/
#ifndef DOCUMENTED_FILE_H
#define DOCUMENTED_FILE_H
/// A documented macro.
#define DOCUMENTED_MACRO 42
/// A documented function declaration.
void documented_function();
#endif // DOCUMENTED_FILE_H
-partlily_documented_file.c
/**
* @file partially_documented_file.c
* @brief
* @author Your Name
* @date YYYY-MM-DD
*/
#include "documented_file.h"
/// A documented function implementation.
void documented_function() {
// Function logic here
}
// An undocumented function implementation.
void undocumented_function() {
// Function logic here
}
Unnocumented_file.c
#include "undocumented_file.h"
void undocumented_function_in_header() {
// Function logic here
}
unnocumented_file.h
#ifndef UNDOCUMENTED_FILE_H
#define UNDOCUMENTED_FILE_H
#define UNDOCUMENTED_MACRO 0
void undocumented_function_in_header();
#endif // UNDOCUMENTED_FILE_H
doxyfile
# General configuration
PROJECT_NAME = "Test Project"
OUTPUT_DIRECTORY = ./doxygen_output
INPUT = ./src
FILE_PATTERNS = *.c *.h
RECURSIVE = YES
# Warnings
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_NO_PARAMDOC = YES
WARN_LOGFILE = doxygen_warnings.log
# Output formats
GENERATE_HTML = YES
GENERATE_LATEX = NO
# Code extraction
EXTRACT_ALL = NO
输出:doxygen_warnings.log
/workspace/src/partially_documented_file.c:13: warning: Member undocumented_function() (function) of file partially_documented_file.c is not documented.
我想要的输出
/workspace/src/undocumented_file.c: warning: no documentation found for file undocumented_file.c
/workspace/src/undocumented_file.h: warning: no documentation found for file undocumented_file.h
/workspace/src/partially_documented_file.c:13: warning: Member undocumented_function() (function) of file partially_documented_file.c is not documented.
运行我使用VSCODE任务和Dockerdockerfile
# Use an official Ubuntu image
FROM ubuntu:latest
# Install Doxygen and Graphviz
RUN apt-get update && \
apt-get install -y doxygen graphviz && \
rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /workspace
# Default command to run Doxygen when container starts
CMD ["doxygen", "/workspace/Doxyfile"]
.vscode/task.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Doxygen in Docker",
"type": "shell",
"command": "docker",
"args": [
"run",
"--rm",
"-v",
"${workspaceFolder}:/workspace",
"doxygen-container",
"doxygen", "/workspace/Doxyfile"
],
"group": "build",
"problemMatcher": []
}
]
}
多氧需要至少具有
@file filename.ext
(或\file
EXTRACT_ALL
YES
。但这带来了其他缺点。请参阅:多氧特殊命令:文件
我的解决方案是用专用脚本扫描文件,并检查文件中是否位于文件中。如果没有,我会在Doxygen能够在任何丢失的文档上报告之前返回文件需要标签的警告消息。 我的python解决方案: