-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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