Skip to content

all: fix all undefined doxygen groups#9264

Merged
miri64 merged 11 commits intoRIOT-OS:masterfrom
aabadie:pr/tools/doxy_check
Jun 11, 2018
Merged

all: fix all undefined doxygen groups#9264
miri64 merged 11 commits intoRIOT-OS:masterfrom
aabadie:pr/tools/doxy_check

Conversation

@aabadie
Copy link
Copy Markdown
Contributor

@aabadie aabadie commented Jun 1, 2018

Contribution description

This PR fixes #8972 by adding a doxygen groups checker script. This script is based on the gist provided by @kaspar030 and which is working very well.
I slightly adapted it to not take into account the vendor header files and to make it return the full list of non matching groups.

In the meantime, I fixed all issues raised by the script. But I think I'll split this PR in several parts to simplify the reviews:

  1. provide the check script alone, e.g not integrated in the CI
  2. provide a PR per top folder (boards, cpu, etc)
  3. enable the script in the CI

Issues/PRs references

fixes #8972 and based on #9266

@aabadie aabadie added Area: doc Area: Documentation Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Area: CI Area: Continuous Integration of RIOT components labels Jun 1, 2018
@aabadie aabadie requested a review from miri64 June 1, 2018 13:15
@aabadie aabadie changed the title dist/tools: add doxygen groups check script dist/tools: add doxygen groups checker script Jun 1, 2018
@aabadie aabadie force-pushed the pr/tools/doxy_check branch from 7c0fe4a to ba66b18 Compare June 1, 2018 13:49
@aabadie aabadie requested a review from kaspar030 June 1, 2018 14:01
@aabadie aabadie added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: tools Area: Supplementary tools labels Jun 1, 2018
@miri64
Copy link
Copy Markdown
Member

miri64 commented Jun 1, 2018

Can we divide this up into two PRs please? One introducing the script (but not wired hot yet, just silently warning in the output) and one fixing the warnings?

Also, since this is doc, why isn't this included into doccheck?

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 1, 2018

Can we divide this up into two PRs please?

Sure, that's what I wrote in the initial comment of this PR (well not exactly, but the idea was there)

since this is doc, why isn't this included into doccheck?

I thought it would be simpler to have it separate first. But I'm fine with merging the two once all grouping issues are fixed.

@aabadie aabadie force-pushed the pr/tools/doxy_check branch from ba66b18 to 094c4eb Compare June 1, 2018 19:35
@aabadie aabadie added the State: waiting for other PR State: The PR requires another PR to be merged first label Jun 1, 2018
@aabadie aabadie changed the title dist/tools: add doxygen groups checker script all: fix all undefined doxygen groups Jun 1, 2018
@aabadie aabadie added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jun 2, 2018
doc.txt Outdated

/**
* @defgroup tests Tests
* @brief Tests applications
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK those groups will be empty in the rendered doc. Do we really need them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all examples are using @ingroup examples and tests @ingroup tests. I know this is not nice but at least it silents the check script.
There are 3 solutions:

  1. Remove all @ingroup tests and @ingroup examples
  2. Ignore undefined examples and tests groups in the check script
  3. Define tests and examples groups and document them. If this solution is pushed a bit, we could have all examples and tests documented in doxygen (instead of READMEs).

I think 1. should be avoided because it will touch too many files and maybe one day it can be useful to have those groups defined.
2. is the simplest.
3. is IMHO technically and from a centralized documentation the best solution. But requires more work.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 3 does make little sense. While I prefer API documentation and usage documentation to be centralized, the READMEs of applications should be kept with the application for two reasons:

  1. One can easily open a README in command-line or their favorite editor/IDE while working with the example and does not need to open an extra browser window
  2. The context might get lost if the README is moved somewhere else

As such, I prefer 2, but instead of ignoring the groups I rather would ignore the directories (as e.g. the vendor headers).

Furthermore, I don't see the point of being so strict with group names in .c-files, as they are not parsed by doxygen, so they can't break the rendered doc (which was the whole point of my initial issue), so it might also be sensible to ignore .c-files altogether. But maybe I'm in the minority with this opinion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dropped the defined examples and tests groups. Will update #9266 with solution 2.

@@ -8,7 +8,7 @@

/**
* @defgroup lwip_arch_cc Compiler and processor description
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg_lwip_arch_cc?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but a bit out of the scope of this PR. If you insist, I can also change that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's less out of scope than the introduction of auto_init doc below since this PR is about group naming ;-).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, you insist ;)

@@ -8,7 +8,7 @@

/**
* @defgroup lwip_arch_sys_arch Architecture depentent definitions
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg_lwip_arch_sys_arch?

@@ -8,7 +8,7 @@

/**
* @defgroup lwip_opts lwIP options
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg_lwip_opts?

Copy link
Copy Markdown
Contributor Author

@aabadie aabadie Jun 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all lwip pkg groups are fixed

* directory for more details.
*
* @ingroup auto_init
* @ingroup sys_autoinit
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below: shouldn't it rather be sys_auto_init?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the initially defined sys_autoinit, I'll use your suggestion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name changed

* This module contains all netif drivers that support auto-initialization.
*/

/**
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes related to auto_init was a bit problematic. I went for the improvement of the initial doc and add the missing groups there. Do you have a better suggestion ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, forgot about this comment. Iff you insist to keep the doc improvement in this PR, please at least factor it out of 6f91bf8 into a separate commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please at least factor it out of 6f91bf8 into a separate commit.

done

#define CCM_ERR_INVALID_DATA_LENGTH (-3)
#define CCM_ERR_INVALID_LENGTH_ENCODING (-4)
#define CCM_ERR_INVALID_MAC_LENGTH (-5)
/** @} */
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, fixing the doxygen for this file is allowing the processing of doxygen in this file and, in the end, triggers a warning from doxygen because of undocumented defines. This change is fixing this. Do you want it in a separate commit ?

@aabadie aabadie force-pushed the pr/tools/doxy_check branch 7 times, most recently from d6f2153 to 279bc6d Compare June 7, 2018 17:46
@aabadie aabadie added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jun 7, 2018
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 7, 2018

Rebased, now that #9266 is merged.

@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 7, 2018

@miri64, are your concerns addressed here so I can squash ?

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the number of defects, I really prefer to move all doc enhancements to a separate PR, and only have the group renames in here.

* This feature can be enabled in any application by adding the `auto_init`
* module to the application Makefile:
*
* ```mk
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This syntax doesn't work in Doxygen. Try

~~~~~~~~~~~~~~~~~~~~~~~ {.mk}
USEMODULE += auto_init
~~~~~~~~~~~~~~~~~~~~~~~

instead if you like to enable syntax highlighting, otherwise remove the mk.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the commit related to that change. Will open a dedicated PR for that later.

* `auto_init` initializes any included module that provides auto
* initialization capabilities.
*
* Drivers or cpu peripherals that provides a SAUL adaption and net interfaces
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"network interfaces"

* initialization capabilities.
*
* Drivers or cpu peripherals that provides a SAUL adaption and net interfaces
* can be initialized automatically with auto_init.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`` around auto_init

* can be initialized automatically with auto_init.
*
* For high-level device drivers (@ref drivers), the default initialization
* parameters are taken from the `DRIVERS_params.h` files provided by the
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRIVER

* The modules will be initialized in the context of the main thread right
* before the main function gets called. Be aware that most modules expect to
* be initialized only once, so do not call a module's init function when using
* auto_init unless you know what you're doing.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`auto_init`, unless you know what you're doing.

* @ingroup sys_auto_init
* @brief Provides auto-initialization of SAUL drivers.
*
* This module contains all high-level drivers (sensor or actuators) that
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rephrase. This sentence makes little sense:

  • What are high-level drivers? Do you mean SAUL as a high-level interface to the drivers?
  • This module only allows for auto-initialization of those drivers using SAUL, and does not contain the drivers.

* @ingroup sys_auto_init
* @brief Provides auto-initialization of Netif drivers via GNRC.
*
* This module contains all netif drivers that support auto-initialization.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This module also doesn't contain any drivers, only enables their auto-initialization.

/**
* @defgroup sys_auto_init_gnrc_netif GNRC netif drivers auto-initialization
* @ingroup sys_auto_init
* @brief Provides auto-initialization of Netif drivers via GNRC.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Netif/network device drivers/. Ideally, link to drivers_netdev, e.g.

Provides auto-initialization for [network device drivers](@ref drivers_netdev) via GNRC.

Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another definitively unrelated thing.


/**
* @ingroup sys_crypto_modes
* @ingroup sys_crypto_mode_cbc
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you just use sys_crypto here, the introduction of the new groups below would not be required.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, fixed now.

*/

/**
* @defgroup sys_crypto_mode_cbc Cipher block chaining mode
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really completely unrelated. These files are perfectly fine to all be grouped in sys_crypto. If you disagree, please move this group introductions to a separate PR.

@aabadie aabadie force-pushed the pr/tools/doxy_check branch from 279bc6d to b193ad1 Compare June 7, 2018 19:27
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 11, 2018

@miri64, before this PR becomes unmaintainable, do you have other concerns ? I think I addressed all your comments and moved out the unrelated things.

@aabadie aabadie force-pushed the pr/tools/doxy_check branch from 39bb193 to 1e8866f Compare June 11, 2018 15:23
Copy link
Copy Markdown
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Locally tested ACK. Please squash!

@aabadie aabadie force-pushed the pr/tools/doxy_check branch from 1e8866f to 00828bb Compare June 11, 2018 17:12
@aabadie
Copy link
Copy Markdown
Contributor Author

aabadie commented Jun 11, 2018

squashed, let's wait for the CI.

@miri64
Copy link
Copy Markdown
Member

miri64 commented Jun 11, 2018

Travis fail is unrelated (and due to an old cppcheck version, I believe) => go

@miri64 miri64 merged commit 8fd85e1 into RIOT-OS:master Jun 11, 2018
@aabadie aabadie deleted the pr/tools/doxy_check branch June 11, 2018 20:01
@cladmi cladmi added this to the Release 2018.07 milestone Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: CI Area: Continuous Integration of RIOT components Area: doc Area: Documentation Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] doc: create top-level module checker

3 participants