Skip to content

dist/tools/compile_commands: add -Wdocumentation for --clangd#22450

Merged
crasbe merged 1 commit into
RIOT-OS:masterfrom
maribu:tools/compile-commands/warn-doc
Jul 7, 2026
Merged

dist/tools/compile_commands: add -Wdocumentation for --clangd#22450
crasbe merged 1 commit into
RIOT-OS:masterfrom
maribu:tools/compile-commands/warn-doc

Conversation

@maribu

@maribu maribu commented Jul 7, 2026

Copy link
Copy Markdown
Member

Contribution description

In case the user called with --clangd, we should try to give the best linting experience to users. Adding -Wdocumentation is particularly helpful for writing Doxygen markup, as it will directly in the editor point out when e.g. @param <key> is not matching any of the arguments.

Testing procedure

Run make compile-commands, then open a header in a clangd enabled editor and rename a function parameter without changing the the corresponding @param. Now the editor should remind you to keep the parameter in sync.

Issues/PRs references

None

Declaration of AI-Tools / LLMs usage:

AI-Tools / LLMs that were used are:

  • none

@maribu maribu added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation 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 AI: None Stated AI was not (stated to be) used in this PR/Issue labels Jul 7, 2026
Comment thread dist/tools/compile_commands/compile_commands.py Outdated
pass

if args.clangd:
# Inject flags for better UX if compile commands are intended to be

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure what you mean with better UX?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

user experience

The first flag removes warnings about GCC-only flags like -mlong-jump for Xtensa. The second results in Doxygen markup being checked. The third disables warnings about missing __attribute__((deprecated))`` in case an @deprecated` is found in the Doxygen markup.

IMO we should add __attribute__((dreprecated)), but until we actually do that, the warning will be just noise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, I just wondered what "UX" means.

But perhaps you can add a comment to the Dr. Dre precated flag that it should be removed when __attribute__(Dr.Dreprecated)) are added to all relevant functions.

Perhaps we should also document the deprecation process somewhere, but that's not like a rabbit hole I feel like getting into today :/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Related: #18650

@riot-ci

riot-ci commented Jul 7, 2026

Copy link
Copy Markdown

Murdock results

✔️ PASSED

c10854e dist/tools/compile_commands: add -Wdocumentation for --clangd

Success Failures Total Runtime
1 0 1 01m:18s

Artifacts

@maribu maribu force-pushed the tools/compile-commands/warn-doc branch from d4318d3 to e7396f0 Compare July 7, 2026 08:13
@maribu maribu enabled auto-merge July 7, 2026 09:19
Comment thread dist/tools/compile_commands/compile_commands.py

@crasbe crasbe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good, please squash :)

In case the user called with `--clangd`, we should try to give the best
linting experience to users. Adding `-Wdocumentation` is particularly
helpful for writing Doxygen markup, as it will directly in the editor
point out when e.g. `@param <key>` is not matching any of the arguments.

Co-authored-by: crasbe <crasbe@gmail.com>
@maribu maribu force-pushed the tools/compile-commands/warn-doc branch from 955cae7 to c10854e Compare July 7, 2026 10:57
@crasbe crasbe disabled auto-merge July 7, 2026 12:05
@crasbe crasbe enabled auto-merge July 7, 2026 12:05
@crasbe crasbe added this pull request to the merge queue Jul 7, 2026
@crasbe

crasbe commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The check labels workflow won't run if you've enabled Automerge before the last squash. That's a consequence of the reduced triggering and therefore the reduced email spam 😅

Merged via the queue into RIOT-OS:master with commit b4f0de3 Jul 7, 2026
26 checks passed
@maribu maribu deleted the tools/compile-commands/warn-doc branch July 7, 2026 12:12
@maribu

maribu commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

Thx :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: None Stated AI was not (stated to be) used in this PR/Issue 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: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants