clang-format: copy latest and re-format
clang-format-16 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: Ia0b293ab6c60f99ee6695deb755b1195d3a68faf
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index 5f0cb09..d92a3f1 100644
--- a/.clang-format
+++ b/.clang-format
@@ -7,7 +7,9 @@
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: Align
-AlignTrailingComments: true
+AlignTrailingComments:
+ Kind: Always
+ OverEmptyLines: 1
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
@@ -36,6 +38,7 @@
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
+BreakAfterAttributes: Never
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
@@ -78,7 +81,10 @@
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
+InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
@@ -98,6 +104,7 @@
ReferenceAlignment: Left
ReflowComments: true
RequiresClausePosition: OwnLine
+RequiresExpressionIndentation: Keyword
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
@@ -117,7 +124,6 @@
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 4
-UseCRLF: false
UseTab: Never
...
diff --git a/inc/post_code.hpp b/inc/post_code.hpp
index 53aa320..ea9b4ce 100644
--- a/inc/post_code.hpp
+++ b/inc/post_code.hpp
@@ -74,49 +74,47 @@
PostCodePath + std::to_string(node),
"xyz.openbmc_project.State.Boot.Raw"),
[this](sdbusplus::message_t& msg) {
- std::string intfName;
- std::map<std::string, std::variant<postcode_t>> msgData;
- msg.read(intfName, msgData);
- // Check if it was the Value property that changed.
- auto valPropMap = msgData.find("Value");
- if (valPropMap != msgData.end())
- {
- this->savePostCodes(
- std::get<postcode_t>(valPropMap->second));
- }
+ std::string intfName;
+ std::map<std::string, std::variant<postcode_t>> msgData;
+ msg.read(intfName, msgData);
+ // Check if it was the Value property that changed.
+ auto valPropMap = msgData.find("Value");
+ if (valPropMap != msgData.end())
+ {
+ this->savePostCodes(std::get<postcode_t>(valPropMap->second));
+ }
}),
- propertiesChangedSignalCurrentHostState(
- bus,
- sdbusplus::bus::match::rules::propertiesChanged(
- HostStatePathPrefix + std::to_string(node),
- "xyz.openbmc_project.State.Host"),
- [this](sdbusplus::message_t& msg) {
- std::string intfName;
- std::map<std::string, std::variant<std::string>> msgData;
- msg.read(intfName, msgData);
- // Check if it was the Value property that changed.
- auto valPropMap = msgData.find("CurrentHostState");
- if (valPropMap != msgData.end())
+ propertiesChangedSignalCurrentHostState(
+ bus,
+ sdbusplus::bus::match::rules::propertiesChanged(
+ HostStatePathPrefix + std::to_string(node),
+ "xyz.openbmc_project.State.Host"),
+ [this](sdbusplus::message_t& msg) {
+ std::string intfName;
+ std::map<std::string, std::variant<std::string>> msgData;
+ msg.read(intfName, msgData);
+ // Check if it was the Value property that changed.
+ auto valPropMap = msgData.find("CurrentHostState");
+ if (valPropMap != msgData.end())
+ {
+ StateServer::Host::HostState currentHostState =
+ StateServer::Host::convertHostStateFromString(
+ std::get<std::string>(valPropMap->second));
+ if (currentHostState == StateServer::Host::HostState::Off)
+ {
+ if (this->postCodes.empty())
{
- StateServer::Host::HostState currentHostState =
- StateServer::Host::convertHostStateFromString(
- std::get<std::string>(valPropMap->second));
- if (currentHostState == StateServer::Host::HostState::Off)
- {
- if (this->postCodes.empty())
- {
- std::cerr << "HostState changed to OFF. Empty "
- "postcode log, keep boot cycle at "
- << this->currentBootCycleIndex
- << std::endl;
- }
- else
- {
- this->postCodes.clear();
- }
- }
+ std::cerr << "HostState changed to OFF. Empty "
+ "postcode log, keep boot cycle at "
+ << this->currentBootCycleIndex << std::endl;
}
- })
+ else
+ {
+ this->postCodes.clear();
+ }
+ }
+ }
+ })
{
phosphor::logging::log<phosphor::logging::level::INFO>(
"PostCode is created");