dimanche 17 septembre 2017

Doxygen in C: check format/style

I want to keep consistent Doxygen format/style in my project. In example:

/**
 * @brief Brief description.
 * 
 * Longer description.........................
 * perhaps multi-line.
 * 
 * - List of things.
 * - List of things.
 *
 * @samestuff Foo.
 * @samestuff Bar.
 *
 * @otherstuff Asdf.
 *
 * [...]
 */

Is there a tool to check correct format/style? In example:

  • All lines have a maximum length.
  • First line is always /**.
  • Last line is always */.
  • There is always a @brief.
  • All intermediate lines starts with * (one space before and after the *).
  • List items have one space after -.
  • Different @whatever are separated with a blank line.
  • All paragraphs or list items end with ..

Ideally it would also:

  • Check that there is a @return if the function returns non void.
  • Check all parameters have a @param.

I am not interested in a tool to check this particular set of rules, but a tool to check a particular set of rules. That means, I do not mind adhering to one or another set of rules, but I would love to adhere to one and include this verification in the CI tests, so that we all write the code with the same style (I already have some checker for code style, but have not found a checker for doxygen comment style).

Aucun commentaire:

Enregistrer un commentaire