-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Establish C++ coding guidelines #45195
Comments
Hey, just wanted to post here and let you know I haven't forgotten about this. I'm looking at the options and will post my thoughts about this as soon as I have formed a strong opinion. |
I think it might be worth to consider the styles supported by clang-tidy and check if one of them can be used, see https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options (below BasedOnStyle) |
OK, so a likely unpopular opinion. I've uploaded a |
@yperess Can you provide some examples/sample code in that style? It is hard to see what it looks like with just the |
Sure, here are some examples, it mostly revolves around having things on separate lines. It takes up more vertical space, but makes reviews easier and results in fewer merge conflicts.
|
FYI @cfriedt |
I added some comments in #41307, but IMHO, it makes sense to consolidate on |
In terms of linter ( It might also be good to mention |
C++ Core Guidelines, maintained by the Standard C++ Foundation certainly has my vote. Those guys really though it through.
This way it would be easy to find files that should not be included by C code. Just an idea. |
Introduction
Establish C++ coding guidelines to be used in the Zephyr repository, and implement means to enforce them.
Problem description
While we have multiple coding and style guideline checkers such as
checkpatch.pl
andguideline_check.py
for the C language, we do not for the C++ language. It is necessary to establish and enforce repository-wide C++ coding and style guidelines in order to ensure code quality and consistency.Proposed change
Guideline Candidates
(please feel free to edit this RFC and add any other guidelines that you think would be good for consideration)
Enforcement Tool Candidates
The text was updated successfully, but these errors were encountered: