Suppressing Doxygen warnings
Asked Answered
I

4

21

Is there a way to suppress Doxygen from giving "not documented" warnings on particular files? My project has several automatically generated code headers that cause it to throw hundreds or thousands of errors that make it difficult to sift through.

Inflect answered 17/8, 2010 at 19:58 Comment(0)
P
17

You could use suppression tags in the generated files:

//! @cond Doxygen_Suppress
code
//! @endcond

You don't need the "Doxygen_Suppress" in there, but I like it for clarity.

There are more options in the doxygen FAQ

EDIT: Ok, I should have done my due diligence, I have an answer that is more appropriate to your situation. I believe you need to exclude the files entirely. Add this to your doxygen file:

# The EXCLUDE tag can be used to specify files and/or directories that should 
# excluded from the INPUT source files. This way you can easily exclude a 
# subdirectory from a directory tree whose root is specified with the INPUT tag.

EXCLUDE                = abc.cpp \
                         abc.h

The irony is I have had this problem and solved it, then forgot all about it... Brain must be full again.

I pulled this information from the doxygen Configuration page, but if you are lazy like me, just use the gui tool (doxywizard) and go through and select all the things you want and have it save the doxyfile for you.

Prognostic answered 17/8, 2010 at 20:35 Comment(3)
The generated files are blown away and recreated every time I make any changes to the project settings. The tool allows me to insert comments into the generated files, but they're all in a block, though open \conds seem to work. The worst offenders though (an IO map header that lists every single register and bit field of the processor) I can't do that with.Inflect
The open tags seem to be interfering with some of my code's documentation on second glance; #defines notably, but mostly documentation in the headers.Inflect
hopefully you have all generated files in a separate folder, so you can specify that folder instead of every individual file in EXCLUDE.Pluton
O
17

There's a config option for that, as stated in documentation

WARN_IF_UNDOCUMENTED

If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag will automatically be disabled.

Ostia answered 17/8, 2010 at 20:8 Comment(4)
Can I give it any sort of scope so it warns for my files and ignores others?Inflect
Hmmm.. doesn't look like you can. It's possible to exclude files entirely, but not to selectively supress warnings... :(Ostia
@hayden: you're right of course. I answered this shortly after joining SO, when I still didn't know exactly what makes a good answer here.Ostia
where do you put this option?Misconception
P
17

You could use suppression tags in the generated files:

//! @cond Doxygen_Suppress
code
//! @endcond

You don't need the "Doxygen_Suppress" in there, but I like it for clarity.

There are more options in the doxygen FAQ

EDIT: Ok, I should have done my due diligence, I have an answer that is more appropriate to your situation. I believe you need to exclude the files entirely. Add this to your doxygen file:

# The EXCLUDE tag can be used to specify files and/or directories that should 
# excluded from the INPUT source files. This way you can easily exclude a 
# subdirectory from a directory tree whose root is specified with the INPUT tag.

EXCLUDE                = abc.cpp \
                         abc.h

The irony is I have had this problem and solved it, then forgot all about it... Brain must be full again.

I pulled this information from the doxygen Configuration page, but if you are lazy like me, just use the gui tool (doxywizard) and go through and select all the things you want and have it save the doxyfile for you.

Prognostic answered 17/8, 2010 at 20:35 Comment(3)
The generated files are blown away and recreated every time I make any changes to the project settings. The tool allows me to insert comments into the generated files, but they're all in a block, though open \conds seem to work. The worst offenders though (an IO map header that lists every single register and bit field of the processor) I can't do that with.Inflect
The open tags seem to be interfering with some of my code's documentation on second glance; #defines notably, but mostly documentation in the headers.Inflect
hopefully you have all generated files in a separate folder, so you can specify that folder instead of every individual file in EXCLUDE.Pluton
T
2

In my automatically generated headers I just add the doxygen documentation into the auto-generation routine.

This means that nothing is left undocumented.

Torras answered 4/5, 2011 at 9:49 Comment(0)
M
0

If anyone is using Eclipse, I definitely suggest to open your file (*.doxyfile) with a text editor (note that eclipse open it with "Doxyfile Editor" by default).

So:

  • right click on your doxyfile and select "open-with"->"text editor"
  • search for WARN_IF_UNDOCUMENTED (setted 'YES' by default)
  • change in 'NO'.

Adding tags

//! @cond Doxygen_Suppress
code
//! @endcond

if you have many classes should be boring and hard.

Documentation for other configuration's options are available here.

Misconception answered 5/8, 2014 at 11:19 Comment(1)
Ok, so where's the extra input to the question, except that there is a special editor in eclipse to edit Doxyfiles? /me is tempted to down vote.Josi

© 2022 - 2024 — McMap. All rights reserved.