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: I35d3ba19f100c4f2f0a924af86454a5fabeae03c
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/blobs-ipmid/blobs.hpp b/blobs-ipmid/blobs.hpp
index f394953..c6ebaad 100644
--- a/blobs-ipmid/blobs.hpp
+++ b/blobs-ipmid/blobs.hpp
@@ -181,13 +181,13 @@
{
#endif
- /**
- * All Blob handlers need to implement this method. It is called after
- * loading the library to then get a handle to the blob handler.
- *
- * @return a unique pointer to your blob handler instance.
- */
- std::unique_ptr<blobs::GenericBlobInterface> createHandler();
+/**
+ * All Blob handlers need to implement this method. It is called after
+ * loading the library to then get a handle to the blob handler.
+ *
+ * @return a unique pointer to your blob handler instance.
+ */
+std::unique_ptr<blobs::GenericBlobInterface> createHandler();
#ifdef __cplusplus
}
diff --git a/example/example.hpp b/example/example.hpp
index 7ceebd6..38abc7b 100644
--- a/example/example.hpp
+++ b/example/example.hpp
@@ -12,11 +12,11 @@
{
#endif
- /**
- * This method must be declared as extern C for blob manager to lookup the
- * symbol.
- */
- std::unique_ptr<blobs::GenericBlobInterface> createHandler();
+/**
+ * This method must be declared as extern C for blob manager to lookup the
+ * symbol.
+ */
+std::unique_ptr<blobs::GenericBlobInterface> createHandler();
#ifdef __cplusplus
}
diff --git a/manager.cpp b/manager.cpp
index b462c82..ba019d4 100644
--- a/manager.cpp
+++ b/manager.cpp
@@ -245,10 +245,9 @@
GenericBlobInterface* BlobManager::getHandler(const std::string& path)
{
/* Find a handler. */
- auto h = std::find_if(handlers.begin(), handlers.end(),
- [&path](const auto& iter) {
- return (iter->canHandleBlob(path));
- });
+ auto h = std::find_if(
+ handlers.begin(), handlers.end(),
+ [&path](const auto& iter) { return (iter->canHandleBlob(path)); });
if (h != handlers.end())
{
return h->get();
diff --git a/test/ipmi_open_unittest.cpp b/test/ipmi_open_unittest.cpp
index b938cbe..cdd4dc3 100644
--- a/test/ipmi_open_unittest.cpp
+++ b/test/ipmi_open_unittest.cpp
@@ -77,9 +77,9 @@
EXPECT_CALL(mgr, open(req.flags, StrEq(blobId), NotNull()))
.WillOnce(Invoke([&](uint16_t, const std::string&, uint16_t* session) {
- (*session) = returnedSession;
- return true;
- }));
+ (*session) = returnedSession;
+ return true;
+ }));
auto result = validateReply(openBlob(&mgr, request));
diff --git a/test/ipmi_sessionstat_unittest.cpp b/test/ipmi_sessionstat_unittest.cpp
index 3278f25..56171f2 100644
--- a/test/ipmi_sessionstat_unittest.cpp
+++ b/test/ipmi_sessionstat_unittest.cpp
@@ -64,10 +64,10 @@
EXPECT_CALL(mgr, stat(Matcher<uint16_t>(req.sessionId),
Matcher<BlobMeta*>(NotNull())))
.WillOnce(Invoke([&](uint16_t, BlobMeta* meta) {
- meta->blobState = blobState;
- meta->size = size;
- return true;
- }));
+ meta->blobState = blobState;
+ meta->size = size;
+ return true;
+ }));
auto result = validateReply(sessionStatBlob(&mgr, request));
@@ -105,9 +105,9 @@
EXPECT_CALL(mgr, stat(Matcher<uint16_t>(req.sessionId),
Matcher<BlobMeta*>(NotNull())))
.WillOnce(Invoke([&](uint16_t, BlobMeta* meta) {
- (*meta) = lmeta;
- return true;
- }));
+ (*meta) = lmeta;
+ return true;
+ }));
auto result = validateReply(sessionStatBlob(&mgr, request));
diff --git a/test/ipmi_stat_unittest.cpp b/test/ipmi_stat_unittest.cpp
index ab091ad..aab3a76 100644
--- a/test/ipmi_stat_unittest.cpp
+++ b/test/ipmi_stat_unittest.cpp
@@ -88,10 +88,10 @@
EXPECT_CALL(mgr, stat(Matcher<const std::string&>(StrEq(blobId)),
Matcher<BlobMeta*>(NotNull())))
.WillOnce(Invoke([&](const std::string&, BlobMeta* meta) {
- meta->blobState = blobState;
- meta->size = size;
- return true;
- }));
+ meta->blobState = blobState;
+ meta->size = size;
+ return true;
+ }));
auto result = validateReply(statBlob(&mgr, request));
@@ -131,9 +131,9 @@
EXPECT_CALL(mgr, stat(Matcher<const std::string&>(StrEq(blobId)),
Matcher<BlobMeta*>(NotNull())))
.WillOnce(Invoke([&](const std::string&, BlobMeta* meta) {
- (*meta) = lmeta;
- return true;
- }));
+ (*meta) = lmeta;
+ return true;
+ }));
auto result = validateReply(statBlob(&mgr, request));
diff --git a/test/process_unittest.cpp b/test/process_unittest.cpp
index 9d0d06c..c4273c4 100644
--- a/test/process_unittest.cpp
+++ b/test/process_unittest.cpp
@@ -213,8 +213,8 @@
std::vector<uint8_t> request(MAX_IPMI_BUFFER - 1);
uint32_t payloadLen = sizeof(uint16_t) + sizeof(uint8_t);
- IpmiBlobHandler h =
- [payloadLen](ManagerInterface*, std::span<const uint8_t>) {
+ IpmiBlobHandler h = [payloadLen](ManagerInterface*,
+ std::span<const uint8_t>) {
std::vector<uint8_t> output(payloadLen, 0);
output[2] = 0x56;
return ipmi::responseSuccess(output);
@@ -239,8 +239,8 @@
std::vector<uint8_t> request(MAX_IPMI_BUFFER - 1);
uint32_t payloadLen = sizeof(uint16_t) + sizeof(uint8_t);
- IpmiBlobHandler h =
- [payloadLen](ManagerInterface*, std::span<const uint8_t>) {
+ IpmiBlobHandler h = [payloadLen](ManagerInterface*,
+ std::span<const uint8_t>) {
std::vector<uint8_t> output(payloadLen, 0);
output[2] = 0x56;
return ipmi::responseSuccess(output);