2

How can one run doxygen in "verification" mode? (parse all documentation, and emit warnings if so configured, but generate no output files).

I tried with the following doxygen configuration file:

DOXYFILE_ENCODING = UTF-8
QUIET = YES
INHERIT_DOCS = YES
EXTRACT_STATIC = YES
EXTRACT_PRIVATE = NO
WARN_NO_PARAMDOC = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_FORMAT = $file($line): $text
GENERATE_HTML = NO
GENERATE_LATEX = NO
INPUT += MySource.cs

Source file:

/// <summary>
/// My namespace documentation
/// </summary>
namespace MyNamespace
{
   /// <summary>
   /// My class documentation
   /// </summary>
   public class MyClass
   {
      /// <summary>
      /// My function documentation
      /// </summary>
      /// <param name="param">The parameter</param>
      /// <returns>My return value</returns>
      public bool MyFunction(string param)
      {
         return true;
      }
   }
}

This generates the following warning:

warning: No output formats selected! Set at least one of the main GENERATE_* options to YES.

which is a bit of a bummer since I want to set WARN_AS_ERROR = YES. But additionally I get additional errors like:

MyClass.cs(17):warning: parameters of member MyNamespace.MyClass.My
Function are not (all) documented
MyClass.cs(17):warning: return type of member MyNamespace.MyClass.M
yFunction is not documented

If I set GENERATE_HTML = YES however I have no warnings, so the documentation itself is fine. Am I doing something wrong or is this a bug?

albert
  • 8,285
  • 3
  • 19
  • 32

2 Answers2

0

Doxygen is not intended for just checking whether or not the documentation is complete. The purpose of doxygen is to generate documentation. Some error first appear when the complete documentation is generated / can be properly checked when the documentation is generated.

albert
  • 8,285
  • 3
  • 19
  • 32
  • Alright thanks, seems like i will have to select the fastest output than. (i run doxygen on build to catch documentation errors early on but when using many project the extra build time can add up rather quickly) – user9746424 May 06 '18 at 12:42
  • For other people faced with similar scenarios, also have a look at https://stackoverflow.com/questions/8247189/doxygen-is-slow – user9746424 May 06 '18 at 13:16
  • Still getting the same warnings about parameters and return type when using 'GENERATE_XML = YES' (or RTF), when using GENERATE_HTML = YES there are no warnings. So the warnings seem to depend on the output type? – user9746424 May 06 '18 at 14:51
  • Have you made any progress on the investigation yet? – user9746424 May 22 '18 at 11:54
  • Unfortunately I have not yet found time to look deeper into it. It is still on my, not so short, list. – albert May 22 '18 at 12:13
0

Workaround: Set the QUIET = YES and WARN_LOGFILE configuration option to a file, then parse the content of this file. The warning

warning: No output formats selected! Set at least one of the main GENERATE_* options to YES.

is not being printed to that file.