diff options
author | William A. Kennington III <wak@google.com> | 2018-10-11 13:55:04 -0700 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2018-10-12 01:03:47 -0700 |
commit | d5f1d40f2ddf9234099b331e1d90c54ece0ee88b (patch) | |
tree | 41b69f239b5121ee39f7f2ca51453cfa6d62a44e /.clang-format-c++ | |
parent | b7c49b22ccb82add7874b30cd96931b0f19b20e0 (diff) | |
download | phosphor-mboxbridge-d5f1d40f2ddf9234099b331e1d90c54ece0ee88b.tar.gz phosphor-mboxbridge-d5f1d40f2ddf9234099b331e1d90c54ece0ee88b.zip |
clang-format: Pull the format rules from the openbmc/docs repo
This makes it consistent with other openbmc projects for c++ formatting.
Tested:
Run through the unit test suite.
Change-Id: I92030ce5b42de01360393687fb438faf26f36ac8
Signed-off-by: William A. Kennington III <wak@google.com>
Diffstat (limited to '.clang-format-c++')
-rw-r--r-- | .clang-format-c++ | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/.clang-format-c++ b/.clang-format-c++ index 309a9d6..ea71ad6 100644 --- a/.clang-format-c++ +++ b/.clang-format-c++ @@ -17,7 +17,7 @@ AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: false +AlwaysBreakTemplateDeclarations: true BinPackArguments: true BinPackParameters: true BraceWrapping: @@ -42,15 +42,29 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true -DerivePointerAlignment: true +DerivePointerAlignment: false PointerAlignment: Left DisableFormat: false ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^[<"](gtest|gmock)' + Priority: 5 + - Regex: '^"config.h"' + Priority: -1 + - Regex: '^".*\.hpp"' + Priority: 1 + - Regex: '^<.*\.h>' + Priority: 2 + - Regex: '^<.*' + Priority: 3 + - Regex: '.*' + Priority: 4 IndentCaseLabels: true IndentWidth: 4 -IndentWrappedFunctionNames: false +IndentWrappedFunctionNames: true KeepEmptyLinesAtTheStartOfBlocks: true MacroBlockBegin: '' MacroBlockEnd: '' @@ -65,9 +79,9 @@ PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Right ReflowComments: true -SortIncludes: false +SortIncludes: true +SortUsingDeclarations: true SpaceAfterCStyleCast: false SpaceBeforeAssignmentOperators: true SpaceBeforeParens: ControlStatements |