clang-format: copy latest and re-format
clang-format-17 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Change-Id: I732e5e7e4a76173d0018b1cd540c3b9b4adee83e
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index d92a3f1..d43e884 100644
--- a/.clang-format
+++ b/.clang-format
@@ -14,26 +14,30 @@
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
-AllowShortIfStatementsOnASingleLine: false
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: true
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
+BitFieldColonSpacing: None
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
+ AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
- AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
+ BeforeLambdaBody: false
+ BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
@@ -48,17 +52,16 @@
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
-DeriveLineEnding: false
DerivePointerAlignment: false
-PointerAlignment: Left
DisableFormat: false
-ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
-ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+ForEachMacros:
+ - foreach
+ - Q_FOREACH
+ - BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^[<"](gtest|gmock)'
@@ -78,6 +81,7 @@
- Regex: '.*'
Priority: 6
IndentCaseLabels: true
+IndentExternBlock: NoIndent
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
@@ -92,6 +96,7 @@
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
+PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 25
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
@@ -100,12 +105,13 @@
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
+PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
ReflowComments: true
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: Keyword
-SortIncludes: true
+SortIncludes: CaseSensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
@@ -117,7 +123,7 @@
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
-SpacesInAngles: false
+SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
diff --git a/src/utils.cpp b/src/utils.cpp
index 09ed5d3..b583173 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -178,7 +178,7 @@
return std::find_if(assocs.begin(), assocs.end(),
[&psuInventoryPath](const auto& assoc) {
return psuInventoryPath == std::get<2>(assoc);
- }) != assocs.end();
+ }) != assocs.end();
}
any Utils::getPropertyImpl(sdbusplus::bus_t& bus, const char* service,
diff --git a/test/test_utils.cpp b/test/test_utils.cpp
index 668803e..383ed4b 100644
--- a/test/test_utils.cpp
+++ b/test/test_utils.cpp
@@ -42,17 +42,16 @@
// std::string
EXPECT_CALL(sdbusMock, sd_bus_message_read_basic(IsNull(), 's', _))
.WillOnce(Invoke([&](sd_bus_message*, char, void* p) {
- const char** s = static_cast<const char**>(p);
- // Read the first parameter, the string.
- *s = path0;
- return 0;
- }))
- .WillOnce(Invoke([&](sd_bus_message*, char, void* p) {
- const char** s = static_cast<const char**>(p);
- // Read the first parameter, the string.
- *s = path1;
- return 0;
- }));
+ const char** s = static_cast<const char**>(p);
+ // Read the first parameter, the string.
+ *s = path0;
+ return 0;
+ })).WillOnce(Invoke([&](sd_bus_message*, char, void* p) {
+ const char** s = static_cast<const char**>(p);
+ // Read the first parameter, the string.
+ *s = path1;
+ return 0;
+ }));
EXPECT_CALL(sdbusMock, sd_bus_message_exit_container(IsNull()))
.WillOnce(Return(0)); /* end of std::vector */