Force Doxygen to pop warnings if uncommented C++ methods

Viewed 170

I am trying to make doxygen pop warnings for missing documentation with a C++ project. I tried to put in the Doxyfile

WARNINGS               = YES
EXTRACT_ALL = YES
EXTRACT_ANON_NSPACES   = YES

I also tried:

WARNINGS               = YES
EXTRACT_ALL = NO
EXTRACT_ANON_NSPACES   = YES
WARN_IF_UNDOCUMENTED   = YES
# (WARN_IF_UNDOCUMENTED is ignored if EXTRACT_ALL is enabled)

But nothing happens.

What I don't understand is that if I put uncomplete Doxygen comments on the printArgs method, I do get a warning saying that some parameters are not documented, but if I don't put the doxygen tags, I get no warnings.

Which Doxyfile field can enable this feature ? This is a minimal example, I want to use this warning feature in a Jenkins server to check that all methods and fields have been documented.

my code to test is very simple:

main.cpp

#include <iostream>
#include "test.h"

using namespace std;

int main(int argc, char **argv) 
{
    cout << "Hello World !" << endl;
    printArgs(argc, argv);

    return 0;
}

test.cpp

#include "test.h"
#include <iostream>

using namespace std;

void printArgs(int argc, char **argv)
{
    for (int i = 0; i < argc; i++)
    {
        cout << "Arg #" << argc << " : " << argv[i] << endl;
    }
}

test.h NOT generating warnings

#pragma once

void printArgs(int argc, char **argv);

test.h generating warnings (tag for 'argv' is missing)

#pragma once
/**
 * @brief 
 * 
 * @param argc 
 */
void printArgs(int argc, char **argv);

EDIT:

I found a solution that partially solves my problem:

From Doxygen's \file command documentation:

The documentation of global functions, variables, typedefs, and enums will only be included in the output if the file they are in is documented as well or if EXTRACT_ALL is set to YES.

And from the Doxyfile's WARN_IF_UNDOCUMENTED comment :

If EXTRACT_ALL is set to YES then this flag will automatically be disabled.

So what I want is having both EXTRACT_ALL and WARN_IF_UNDOCUMENTED set to true which is not possible.

I don't understand why it's not possible, and if someone has an explanation, I'd be grateful. The only work around for me was to put /** \file */ at the top of test.h.

This doesn't solve my problem fully because I want to track missing comments with this "feature" and the missing comments could be the /** \file */ as well and if it is the case I am screwed...

0 Answers
Related