Skip to content
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 preprocessor directive formatting #20866

Merged

Conversation

maribu
Copy link
Member

@maribu maribu commented Sep 18, 2024

Contribution description

This explicitly spells out what informally has been the coding convention for some time on preprocessor directives, making it more transparent and easier to find.

This is particularly useful as the code base has at least three different styles. Deducing what actually is the current policy would require a details look at how the style has changed over time, rather than being obvious from a quick grep over the code base.

Testing procedure

Check that the wording is clear and easy to understand and that the policy matches what we actually do. (E.g. look at ztimer, as this is a rather new component that has received lots of reviewing.)

Issues/PRs references

#20864 (comment)

@github-actions github-actions bot added the Area: doc Area: Documentation label Sep 18, 2024
@maribu
Copy link
Member Author

maribu commented Sep 18, 2024

Note: I'm not adding an "API change" label, as this is intended to really just document what is current policy anyway, rather than changing things. It would be good to confirm that this is indeed the implicit policy now, though.

Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

Thanks for writing that down! I agree with the reasoning and am in favor of adding it, but don't feel in the position to acknowledge this being an implicit convention in the past.

CODING_CONVENTIONS.md Outdated Show resolved Hide resolved
@dylad
Copy link
Member

dylad commented Sep 18, 2024

Let's give this PR a few days to gather feedback.
Looks good to me.

@miri64 miri64 added the Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation label Sep 18, 2024
@Teufelchen1
Copy link
Contributor

👍

@Enoch247
Copy link
Contributor

The convention described, seems to match that of the newer code that I have looked at. I agree that the convention is a logical choice. Also the wording and examples seem clear to me.

I don't seem to have sufficient permission to approve, but I would if I could.

This explicitly spells out what informally has been the coding
convention for some time on preprocessor directives, making it
more transparent and easier to find.

This is particularly useful as the code base has at least three
different styles. Deducing what actually is the current policy
would require a details look at how the style has changed over
time, rather than being obvious from a quick `grep` over the
code base.
@maribu
Copy link
Member Author

maribu commented Sep 23, 2024

squashed

@maribu maribu force-pushed the CODING_CONVENTIONS.md/indent-pp-directives branch from 869b56d to f431aab Compare September 23, 2024 15:10
Copy link
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

I guess this was enough time for others to raise their voice :)

@mguetschow mguetschow added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 24, 2024
@riot-ci
Copy link

riot-ci commented Sep 24, 2024

Murdock results

✔️ PASSED

f431aab CODING_CONVENTIONS.md: Add preprocessor directive formatting

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

Artifacts

@maribu maribu added this pull request to the merge queue Sep 24, 2024
Merged via the queue into RIOT-OS:master with commit 4e17dba Sep 24, 2024
27 checks passed
@maribu maribu deleted the CODING_CONVENTIONS.md/indent-pp-directives branch September 24, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: doc Area: Documentation 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.

7 participants