dist/tools/doccheck: add check for undefined groups#9266
dist/tools/doccheck: add check for undefined groups#9266miri64 merged 1 commit intoRIOT-OS:masterfrom
Conversation
589aba2 to
7f7ac60
Compare
dist/tools/doccheck/check.sh
Outdated
| UNDEFINED_GROUPS=$( \ | ||
| for group in $(git grep '@ingroup' | grep -v vendor | grep -oE '[^ ]+$' | sort -u); \ | ||
| do \ | ||
| echo "$DEFINED_GROUPS" | grep -xq "$group" || echo "$group"; \ |
There was a problem hiding this comment.
Might it be possible to also include the filename here?
There was a problem hiding this comment.
I can look at that. Not sure how complex it is.
7f7ac60 to
b8cbfa2
Compare
After quite some fight with regexp and bash, I came up with something that works locally. |
dist/tools/doccheck/check.sh
Outdated
| DEFINED_GROUPS=$(git grep @defgroup -- '*.h' '*.txt' | \ | ||
| grep -v vendor | \ | ||
| grep -v examples | \ | ||
| grep -v tests | \ |
There was a problem hiding this comment.
Instead of all these line repetitions do:
exclude_filter() {
grep -v -e vendor -e examples -e tests
}And then use it like this in this instance
DEFINED_GROUPS=$(git grep @defgroup -- '*.h' '*.txt' | \
exclude_filter | \
grep -oE '@defgroup[ ]+[^ ]+' | \
grep -oE '[^ ]+$' | sort -u)also below of course
dist/tools/doccheck/check.sh
Outdated
|
|
||
| # Check all groups are defined | ||
| DEFINED_GROUPS=$(git grep @defgroup -- '*.h' '*.txt' | \ | ||
| grep -v vendor | \ |
There was a problem hiding this comment.
Indentation could go with the git above (but I guess we have no rule for that..)
dist/tools/doccheck/check.sh
Outdated
| grep -v tests | \ | ||
| grep -oE '[^ ]+$' | sort -u); \ | ||
| do \ | ||
| echo "$DEFINED_GROUPS" | grep -xq "$group" || echo "$group"; \ |
There was a problem hiding this comment.
Please use ${var} for all variables. Makes it easier to read (and AFAIK also more portable).
dist/tools/doccheck/check.sh
Outdated
| for group in $UNDEFINED_GROUPS; \ | ||
| do \ | ||
| echo -e "\n${CWARN}$group${CRESET} found in:"; \ | ||
| echo "$ALL_RAW_INGROUP" | grep " $group$" | sort -u | \ |
There was a problem hiding this comment.
I think we are on the saver side if you use \<${group}\> instead of ${group}$
dist/tools/doccheck/check.sh
Outdated
| do \ | ||
| echo -e "\n${CWARN}$group${CRESET} found in:"; \ | ||
| echo "$ALL_RAW_INGROUP" | grep " $group$" | sort -u | \ | ||
| awk '{ print "\t" substr($1, 1, length($1)-1) }'; \ |
There was a problem hiding this comment.
I think awk -F':' '{ print "\t" $1 }' is way easier to understand here ;-).
|
@miri64, requested changes applied. Thanks! |
|
@miri64, ok to squash here ? |
11f145c to
a6dc4b7
Compare
miri64
left a comment
There was a problem hiding this comment.
Yes, let me just give it a final test run before I ACK.
a6dc4b7 to
2f21e16
Compare
|
squashed |
|
@miri64, CI is green. I let you press the merge button. |
|
Done |
Contribution description
As requested in #9264, this PR update the doxygen check script with a check on undefined groups.
For the moment, it's run only if doxygen documentation passes without error and it always returns 0. The undefined groups are printed with a warning message at the beginning.
Issues/PRs references
Related to #9264 and #8972