History log of /openbmc/docs/cpp-style-and-conventions.md (Results 1 – 23 of 23)
Revision Date Author Comments
# 0666ef8a 12-Jul-2023 Patrick Williams <patrick@stwcx.xyz>

c++: change desired language to C++23

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I7c69cbf4da5409c7fd105b946d10536e69c6c618


# b4cf1288 27-Mar-2023 Zev Weiss <zev@bewilderbeest.net>

cpp-style: Elaborate on cases for using explicitly-sized types

Explicitly-sized types (uintX_t and friends) are sometimes specified in
non-hardware interfaces we don't control, so using such types f

cpp-style: Elaborate on cases for using explicitly-sized types

Explicitly-sized types (uintX_t and friends) are sometimes specified in
non-hardware interfaces we don't control, so using such types for
variables used with such interfaces can be appropriate.

Signed-off-by: Zev Weiss <zev@bewilderbeest.net>
Change-Id: I6dd09c93b978f8bb9b8748eb4a0c39537f82f0f3

show more ...


# f4febd00 08-Dec-2022 Patrick Williams <patrick@stwcx.xyz>

prettier: re-format

Prettier is enabled in openbmc-build-scripts on Markdown, JSON, and YAML
files to have consistent formatting for these file types. Re-run the
formatter on the whole repository.

prettier: re-format

Prettier is enabled in openbmc-build-scripts on Markdown, JSON, and YAML
files to have consistent formatting for these file types. Re-run the
formatter on the whole repository.

Change-Id: I35ec9c19ae581e4dd00b515c1bba3a9c1862eeb1
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# b86de0f1 04-May-2022 Patrick Williams <patrick@stwcx.xyz>

cpp-style: removed 'not implemented'

There was a 'not implemented' statement about some of the CI testing
which has actually been in place for years. Update the document to
catch it up to the curre

cpp-style: removed 'not implemented'

There was a 'not implemented' statement about some of the CI testing
which has actually been in place for years. Update the document to
catch it up to the current state of the art.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I4d955801a7dae1b2e16eb2bb36603b6956801e10

show more ...


# 2f52b0a3 10-Nov-2021 Patrick Williams <patrick@stwcx.xyz>

clang-format: force unix newlines

In order to help avoid dos-style newlines from being introduced to the
codebase, force the clang-format style to use unix-style newlines.

`De

clang-format: force unix newlines

In order to help avoid dos-style newlines from being introduced to the
codebase, force the clang-format style to use unix-style newlines.

`DeriveLineEnding: false`:
- This disables automatic newline style detection by clang-format.

`UseCRLF: false`:
- Since detection is disabled, this enforces unix-style (LF).

Also, add a remark in the cpp-style document to codify the expectation
that unix-style newlines are used.

Tested: Apply changes to sdbusplus, run 'unix2dos' on a source file, and
confirm file is reverted to unix-style with 'clang-format'.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ie8f0cd956a3c52cd14891c06a0b61507f5829aaf

show more ...


# 1679c264 14-Apr-2021 Patrick Williams <patrick@stwcx.xyz>

cpp: bump desired C++ standard to C++20

C++20 has been final for over 6 months now and has sufficient
compiler support in the compilers we use. Bump the documentation
to specify we

cpp: bump desired C++ standard to C++20

C++20 has been final for over 6 months now and has sufficient
compiler support in the compilers we use. Bump the documentation
to specify we should be using C++20 now.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I1917b24a8e225393daf81249ce1ab8e804882eef

show more ...


# 200e9db1 03-Feb-2021 Josh Lehan <krellan@google.com>

Update recommended C++ version standard

Updating the text from recommending C++ 14/17 to C++ 17/20.
This better matches the current reality.

Signed-off-by: Josh Lehan <krellan@g

Update recommended C++ version standard

Updating the text from recommending C++ 14/17 to C++ 17/20.
This better matches the current reality.

Signed-off-by: Josh Lehan <krellan@google.com>
Change-Id: I771731dde64c9731d3a69b7be6014ea2aa4301e4

show more ...


# ddb9f2ca 10-Jun-2020 Jeremy Kerr <jk@ozlabs.org>

cpp-style: fix conflicting enum advice

Under the Types section, we have:

Structs, classes, enums, and typed template parameters should all be
in UpperCamelCase.

and

cpp-style: fix conflicting enum advice

Under the Types section, we have:

Structs, classes, enums, and typed template parameters should all be
in UpperCamelCase.

and then in Constants:

Constants and enums should be named like variables in lowerCamelCase.

It looks like the latter is supposed to refer to enum members, rather
than the enum declaration. This change clarifies the constants section.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Change-Id: I2a96c2901a4840a4dd6b18395353e4054a221900

show more ...


# 84ef2aa2 20-Oct-2018 Patrick Venture <venture@google.com>

cpp-style-and-conventions: fix wrong case in example

Class names are UpperCamelCase.

Change-Id: Ic7d9432ec8458ef6e54070b0af445a9be10f1c9a
Signed-off-by: Patrick Venture <venture

cpp-style-and-conventions: fix wrong case in example

Class names are UpperCamelCase.

Change-Id: Ic7d9432ec8458ef6e54070b0af445a9be10f1c9a
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# 0dcc430a 24-Sep-2018 Patrick Venture <venture@google.com>

add .clang-format exemplars

Adds .clang-format for cpp and javascript

Change-Id: I8a7ed63be54a3f44ef448cf603ee2a8643436afd
Signed-off-by: Patrick Venture <venture@google.com>


# 4f7b4b6d 21-Sep-2018 Gunnar Mills <gmills@us.ibm.com>

cpp-style-and-conventions.md: Remove astyle

The astyle command listed formatted the code in a way that varied
quite a bit from our coding style. Leaving this command could
confuse us

cpp-style-and-conventions.md: Remove astyle

The astyle command listed formatted the code in a way that varied
quite a bit from our coding style. Leaving this command could
confuse users into thinking they could use astyle for C++ code.
With clang-format being enforced by CI, best to remove astyle and
stick with clang-format.

Change-Id: I5f80048e037fc2768f07702ade22031a802a002a
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# 635c9052 10-Sep-2018 Adriana Kobylak <anoo@us.ibm.com>

clang-format: Sort using statements

Make using order consistent where used. There aren't any in this
project, but this should be used more widely by openbmc projects.

Change-Id:

clang-format: Sort using statements

Make using order consistent where used. There aren't any in this
project, but this should be used more widely by openbmc projects.

Change-Id: I5e2395f480cbf76e1d3e006b1ab648da5aa39aec
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# d6bb472a 10-Sep-2018 Adriana Kobylak <anoo@us.ibm.com>

clang-format: always break template declarations

To better match the defined openbmc style defined here:
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#types

clang-format: always break template declarations

To better match the defined openbmc style defined here:
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#types
template <typename T>
class foo
{
using type = std::decay_t<T>;
};

Change-Id: I87640f5cea5935bbee2546526ebad9ccfcf34726
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# 44a6f9b8 07-Sep-2018 Gunnar Mills <gmills@us.ibm.com>

clang-format: Remove 2nd PointerAlignment

PointerAlignment was in the .clang-format example twice.

PointerAlignment: Left follows the style defined here:
https://github.com/open

clang-format: Remove 2nd PointerAlignment

PointerAlignment was in the .clang-format example twice.

PointerAlignment: Left follows the style defined here:
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#additional-whitespace
foo(T& bar, const S* baz); /// Correct.
foo(T &bar, const S *baz); /// Incorrect.

Also, set DerivePointerAlignment to false so clang-format looks
at PointerAlignment instead of "If true, analyze the formatted
file for the most common alignment of & and *. Pointer
and reference alignment styles are going to be updated
according to the preferences found in the file."

Change-Id: If33c8842c7e4dc8e03c0ced3a8ba814958daa8a1
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# 9f34110a 28-Aug-2018 Patrick Venture <venture@google.com>

add header ordering section to style guide

Adds a section to the style guide defining a header inclusion order for
header files and source files.

Change-Id: Ieb723380bbab257b98b

add header ordering section to style guide

Adds a section to the style guide defining a header inclusion order for
header files and source files.

Change-Id: Ieb723380bbab257b98b319cda999cf0e9c1ef389
Signed-off-by: Patrick Venture <venture@google.com>

show more ...


# f62262b3 26-Mar-2018 Adriana Kobylak <anoo@us.ibm.com>

cpp-style: Add format-code.sh to clang section

With commit https://gerrit.openbmc-project.xyz/#/c/9480/
support for a format-code.sh script is being added to CI.
Add it to the docume

cpp-style: Add format-code.sh to clang section

With commit https://gerrit.openbmc-project.xyz/#/c/9480/
support for a format-code.sh script is being added to CI.
Add it to the documentation for users to take advantage of.

Change-Id: I11c56c94c3110a7279db72caf55738d88fc35302
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# f1b07cec 08-Apr-2018 Gunnar Mills <gmills@us.ibm.com>

Move Python Formatting to contributing.md

Moved the Python Formatting section from cpp-style-and-conventions
to contributing. cpp-style-and-conventions is meant for C++ code
only.

Move Python Formatting to contributing.md

Moved the Python Formatting section from cpp-style-and-conventions
to contributing. cpp-style-and-conventions is meant for C++ code
only.

Change-Id: I23b1fcd5dd9a98a2e1085501a476b24556461031
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>

show more ...


# 2ce295b0 28-Feb-2018 Adriana Kobylak <anoo@us.ibm.com>

cpp-style: Set IndentWrappedFunctionNames to true

Change IndentWrappedFunctionNames to true in the .clang-format
example to indent function definitions that don't fit in a
single lin

cpp-style: Set IndentWrappedFunctionNames to true

Change IndentWrappedFunctionNames to true in the .clang-format
example to indent function definitions that don't fit in a
single line.

Before:
RequestedActivations
requestedActivation(RequestedActivations value) override;

After:
RequestedActivations
requestedActivation(RequestedActivations value) override;

Change-Id: I92e31b0b7af80b2c974f5a63a622d461f02bb802
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>

show more ...


# cb449077 31-Jan-2018 Gunnar Mills <gmills@us.ibm.com>

Add information about enforcing default ignore rules

Change-Id: I63d552afa1c916586c03618d52ed64ed86575994
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>


# 76d8f7f7 22-Jan-2018 Andrew Geissler <geissonator@yahoo.com>

Update for clang-format and pycodestyle

The CI infrastructure recently added support to validate the
code being put up for review is formatted correctly according
to the repo specifi

Update for clang-format and pycodestyle

The CI infrastructure recently added support to validate the
code being put up for review is formatted correctly according
to the repo specific .clang-format(c/c++) and setup.cfg(python)
files located in the root directory of the repository.

Change-Id: I1484b3c11ee30a48f5b2d94c4f78b5acb8bb9a57
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>

show more ...


# 56d79455 21-Nov-2017 Ed Tanous <ed.tanous@intel.com>

Update coding style to allow use of Boost

This follows the discussion on the mailing list titled "Use of Boost in
OpenBMC"

Change-Id: I156a17086e411287e7c7182cdb65ea620e280950

Update coding style to allow use of Boost

This follows the discussion on the mailing list titled "Use of Boost in
OpenBMC"

Change-Id: I156a17086e411287e7c7182cdb65ea620e280950
Signed-off-by: Ed Tanous <ed.tanous@intel.com>

show more ...


# 45da6196 25-Jan-2017 Patrick Williams <patrick@stwcx.xyz>

cpp-style: Special note on acronyms

There was a discussion in code reviews on how acronyms should be
handled. In DBus interfaces, we have used UpperCamelCase through-out
and therefo

cpp-style: Special note on acronyms

There was a discussion in code reviews on how acronyms should be
handled. In DBus interfaces, we have used UpperCamelCase through-out
and therefore acronyms are always UPPERCASE in DBus interfaces
specifically. There was an attempt to carry this forward into C++
style, which caused a contradiction between acronyms-always-uppercase
and variables-are-lower-case. Clarify this to indicate that acronyms
should always be same-case and are UPPER or lower depending on the
context.

Change-Id: I5bf19595ba38405d1d5d629f8ce854bbc47af8cf
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...


# 31f951b3 07-Nov-2016 Patrick Williams <patrick@stwcx.xyz>

cpp-style: define style guidelines in-depth

The original set of C++ style guidelines were arguably insufficient
for teams of diverse backgrounds. Attempt to formalize these guidelines

cpp-style: define style guidelines in-depth

The original set of C++ style guidelines were arguably insufficient
for teams of diverse backgrounds. Attempt to formalize these guidelines
and specify in more depth.

Change-Id: I22253f7b9de91d693c33d55d612c3555fa5b219f
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

show more ...