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: I0354bf7192c66505b2173aaece3525940a5caa06
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/functions.cpp b/functions.cpp
index 0ee20ec..24a099e 100644
--- a/functions.cpp
+++ b/functions.cpp
@@ -658,7 +658,7 @@
// subcommand to exit.
loop.exit(0);
}
- });
+ });
// now that we'll get a callback in the event of an InterfacesAdded signal
// (potentially containing
@@ -761,7 +761,7 @@
{
loop.exit(0);
}
- }));
+ }));
// The BIOS attribute table can only be updated if PLDM is running because
// PLDM is the one that exposes this property. Add a match to monitor when
@@ -795,7 +795,7 @@
loop.exit(0);
}
}
- }));
+ }));
InterfacesPropertiesMap interfacesAndProperties;
auto objects = getManagedObjects(bus, entityManagerServiceName,
diff --git a/item_updater_main.cpp b/item_updater_main.cpp
index 23f71b5..0aad740 100644
--- a/item_updater_main.cpp
+++ b/item_updater_main.cpp
@@ -77,21 +77,20 @@
app.add_subcommand("process-host-firmware",
"Point the host firmware at its data.")
->callback([&bus, &loop, &subcommandContext, extensionMap]() {
- auto hostFirmwareDirectory = "/media/hostfw/running"s;
- auto logCallback = [](const auto& path, auto& ec) {
- std::cerr << path << ": " << ec.message() << "\n";
- };
- subcommandContext.push_back(
- functions::process_hostfirmware::processHostFirmware(
- bus, extensionMap, std::move(hostFirmwareDirectory),
- std::move(logCallback), loop));
- }));
+ auto hostFirmwareDirectory = "/media/hostfw/running"s;
+ auto logCallback = [](const auto& path, auto& ec) {
+ std::cerr << path << ": " << ec.message() << "\n";
+ };
+ subcommandContext.push_back(
+ functions::process_hostfirmware::processHostFirmware(
+ bus, extensionMap, std::move(hostFirmwareDirectory),
+ std::move(logCallback), loop));
+ }));
static_cast<void>(
app.add_subcommand("update-bios-attr-table",
"Update the bios attribute table with the host "
"firmware data details.")
- ->callback(
- [&bus, &loop, &subcommandContext, extensionMap]() {
+ ->callback([&bus, &loop, &subcommandContext, extensionMap]() {
auto elementsJsonFilePath = "/usr/share/hostfw/elements.json"s;
auto subcommands = functions::process_hostfirmware::updateBiosAttrTable(
bus, extensionMap, std::move(elementsJsonFilePath), loop);
@@ -99,7 +98,7 @@
{
subcommandContext.push_back(subcommand);
}
- }));
+ }));
CLI11_PARSE(app, argc, argv);
diff --git a/utils.hpp b/utils.hpp
index a5882fc..313db32 100644
--- a/utils.hpp
+++ b/utils.hpp
@@ -13,8 +13,8 @@
extern "C"
{
- EVP_MD_CTX* EVP_MD_CTX_new(void);
- void EVP_MD_CTX_free(EVP_MD_CTX* ctx);
+EVP_MD_CTX* EVP_MD_CTX_new(void);
+void EVP_MD_CTX_free(EVP_MD_CTX* ctx);
}
namespace utils