CODING_CONVENTIONS.md: Add IWYU policy#20570
Conversation
|
Having that done is in no way a precondition to adopting this convention, but relevant to whether we can uphold the convention: Is it realistic to have this enforced by CI? (Otherwise I fear it will be a frequently missed point in both PRs and reviews). |
|
I think this is only relevant for hardware abstraction APIs, e.g. periph drivers and IRQ APIs. So I don't really expect new offenders to merged at a rate faster than I can fix. I don't think that adding the pragmas can be enforcement. But having the code IWYU clean could be enforced by the CI, which would indirectly enforce suppression of false positives. But getting there will be more work than a few minutes of spare in-betweeen on a Sunday afternoon... I might tackle that in a few months. Sounds like a sensible thing to aim for. |
mguetschow
left a comment
There was a problem hiding this comment.
LGTM as a coding convention, but would be good to get feedback from more experienced RIOT contributors.
|
Nice |
This makes an implicit agreement that code should include the headers is uses, no more and no less, explicit. It also recommends using tooling (such as clangd) and adding IWUY pragma comments to aid those tools in common cases they otherwise would provide false positives. Co-authored-by: chrysn <[email protected]>
e13ceeb to
ffeb46f
Compare
|
Thx a bunch! |
Contribution description
This makes an implicit agreement that code should include the headers is uses, no more and no less, explicit.
It also recommends using tooling (such as clangd) and adding IWUY pragma comments to aid those tools in common cases they otherwise would provide false positives.
Testing procedure
Read the changed coding conventions and confirm that this is what we want to do.
Issues/PRs references
None