diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2016-07-20 17:25:53 -0500 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2016-07-20 17:28:57 -0500 |
commit | 017f58c133a26de158c7adb758d01b64172929c4 (patch) | |
tree | b24f46baaf34e02e8296a7ac4a03e6bc4b344b2f /contributing.md | |
parent | 2e8a2141f87d49510faf012cea7a17a2839e02bf (diff) | |
download | openbmc-docs-017f58c133a26de158c7adb758d01b64172929c4.tar.gz openbmc-docs-017f58c133a26de158c7adb758d01b64172929c4.zip |
contributing: Add style for C++
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Diffstat (limited to 'contributing.md')
-rw-r--r-- | contributing.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/contributing.md b/contributing.md index 5d64b32..070f63c 100644 --- a/contributing.md +++ b/contributing.md @@ -71,6 +71,29 @@ This style can mostly be verified with 'astyle' as follows: astyle --style=linux --indent=tab=8 --indent=force-tab=8 +### C++ + +Being an extensive and complicated language, there are often differences of +opinions on "good" and "bad" C++ code. The following are the approaches +favored within the OpenBMC projects: + + 1. Favor syntax and techniques from the latest available C++ standard, + currently C++14. + 2. Rely on well-recognized opinions on best practices: + 1. C++ Core Guidelines - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md + 2. Effective Modern C++ - http://www.aristeia.com/books.html + 3. Give preference to style decisions from the Google C++ Style Guide - + https://google.github.io/styleguide/cppguide.html + +In order to meet the chosen style for C++ code, files should pass through +'astyle' unchanged when called as follows: + + astyle --style=allman --add-brackets --convert-tabs --max-code-length=80 \ + --indent=spaces=4 --indent-classes --indent-switches --indent-labels \ + --indent-preproc-define --min-conditional-indent=0 --pad-oper \ + --pad-header --unpad-paren --break-after-logical \ + --align-pointer=type --align-reference=type + Submitting changes ------------------ |