Skip to content

Commit 5fb575a

Browse files
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: Ib459ac591ed3031de84d0239948d8daa583ef8a5 Signed-off-by: Patrick Williams <[email protected]>
1 parent 9493355 commit 5fb575a

File tree

9 files changed

+197
-201
lines changed

9 files changed

+197
-201
lines changed

.clang-format

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,30 @@ AllowAllParametersOfDeclarationOnNextLine: true
1414
AllowShortBlocksOnASingleLine: Empty
1515
AllowShortCaseLabelsOnASingleLine: false
1616
AllowShortFunctionsOnASingleLine: Empty
17-
AllowShortIfStatementsOnASingleLine: false
17+
AllowShortIfStatementsOnASingleLine: Never
18+
AllowShortLambdasOnASingleLine: true
1819
AllowShortLoopsOnASingleLine: false
1920
AlwaysBreakAfterReturnType: None
2021
AlwaysBreakBeforeMultilineStrings: false
2122
AlwaysBreakTemplateDeclarations: Yes
2223
BinPackArguments: true
2324
BinPackParameters: true
25+
BitFieldColonSpacing: None
2426
BraceWrapping:
2527
AfterCaseLabel: true
2628
AfterClass: true
2729
AfterControlStatement: true
2830
AfterEnum: true
31+
AfterExternBlock: true
2932
AfterFunction: true
3033
AfterNamespace: true
3134
AfterObjCDeclaration: true
3235
AfterStruct: true
3336
AfterUnion: true
34-
AfterExternBlock: true
3537
BeforeCatch: true
3638
BeforeElse: true
39+
BeforeLambdaBody: false
40+
BeforeWhile: false
3741
IndentBraces: false
3842
SplitEmptyFunction: false
3943
SplitEmptyRecord: false
@@ -48,17 +52,16 @@ BreakStringLiterals: false
4852
ColumnLimit: 80
4953
CommentPragmas: '^ IWYU pragma:'
5054
CompactNamespaces: false
51-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
5255
ConstructorInitializerIndentWidth: 4
5356
ContinuationIndentWidth: 4
5457
Cpp11BracedListStyle: true
55-
DeriveLineEnding: false
5658
DerivePointerAlignment: false
57-
PointerAlignment: Left
5859
DisableFormat: false
59-
ExperimentalAutoDetectBinPacking: false
6060
FixNamespaceComments: true
61-
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
61+
ForEachMacros:
62+
- foreach
63+
- Q_FOREACH
64+
- BOOST_FOREACH
6265
IncludeBlocks: Regroup
6366
IncludeCategories:
6467
- Regex: '^[<"](gtest|gmock)'
@@ -78,6 +81,7 @@ IncludeCategories:
7881
- Regex: '.*'
7982
Priority: 6
8083
IndentCaseLabels: true
84+
IndentExternBlock: NoIndent
8185
IndentRequiresClause: true
8286
IndentWidth: 4
8387
IndentWrappedFunctionNames: true
@@ -92,6 +96,7 @@ NamespaceIndentation: None
9296
ObjCBlockIndentWidth: 2
9397
ObjCSpaceAfterProperty: false
9498
ObjCSpaceBeforeProtocolList: true
99+
PackConstructorInitializers: BinPack
95100
PenaltyBreakAssignment: 25
96101
PenaltyBreakBeforeFirstCallParameter: 19
97102
PenaltyBreakComment: 300
@@ -100,12 +105,13 @@ PenaltyBreakString: 1000
100105
PenaltyExcessCharacter: 1000000
101106
PenaltyReturnTypeOnItsOwnLine: 60
102107
PenaltyIndentedWhitespace: 0
108+
PointerAlignment: Left
103109
QualifierAlignment: Left
104110
ReferenceAlignment: Left
105111
ReflowComments: true
106112
RequiresClausePosition: OwnLine
107113
RequiresExpressionIndentation: Keyword
108-
SortIncludes: true
114+
SortIncludes: CaseSensitive
109115
SortUsingDeclarations: true
110116
SpaceAfterCStyleCast: false
111117
SpaceAfterTemplateKeyword: true
@@ -117,7 +123,7 @@ SpaceBeforeParens: ControlStatements
117123
SpaceBeforeRangeBasedForLoopColon: true
118124
SpaceInEmptyParentheses: false
119125
SpacesBeforeTrailingComments: 1
120-
SpacesInAngles: false
126+
SpacesInAngles: Never
121127
SpacesInContainerLiterals: true
122128
SpacesInCStyleCastParentheses: false
123129
SpacesInParentheses: false

extensions/openpower-pels/data_interface.cpp

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,20 @@ DataInterface::DataInterface(sdbusplus::bus_t& bus) : _bus(bus)
140140
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
141141
bus, object_path::hostState, interface::bootProgress, "BootProgress",
142142
*this, [this](const auto& value) {
143-
this->_bootState = std::get<std::string>(value);
144-
auto status = Progress::convertProgressStagesFromString(
145-
std::get<std::string>(value));
143+
this->_bootState = std::get<std::string>(value);
144+
auto status = Progress::convertProgressStagesFromString(
145+
std::get<std::string>(value));
146146

147-
if ((status == Progress::ProgressStages::SystemInitComplete) ||
148-
(status == Progress::ProgressStages::OSRunning))
149-
{
150-
setHostUp(true);
151-
}
152-
else
153-
{
154-
setHostUp(false);
155-
}
156-
}));
147+
if ((status == Progress::ProgressStages::SystemInitComplete) ||
148+
(status == Progress::ProgressStages::OSRunning))
149+
{
150+
setHostUp(true);
151+
}
152+
else
153+
{
154+
setHostUp(false);
155+
}
156+
}));
157157

158158
// Watch the host PEL enable property
159159
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
@@ -165,22 +165,22 @@ DataInterface::DataInterface(sdbusplus::bus_t& bus) : _bus(bus)
165165
std::get<bool>(value));
166166
}
167167
this->_sendPELsToHost = std::get<bool>(value);
168-
}));
168+
}));
169169

170170
// Watch the BMCState property
171171
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
172172
bus, object_path::bmcState, interface::bmcState, "CurrentBMCState",
173173
*this, [this](const auto& value) {
174-
const auto& state = std::get<std::string>(value);
175-
this->_bmcState = state;
174+
const auto& state = std::get<std::string>(value);
175+
this->_bmcState = state;
176176

177-
// Wait for BMC ready to start watching for
178-
// plugs so things calm down first.
179-
if (BMC::convertBMCStateFromString(state) == BMC::BMCState::Ready)
180-
{
181-
startFruPlugWatch();
182-
}
183-
}));
177+
// Wait for BMC ready to start watching for
178+
// plugs so things calm down first.
179+
if (BMC::convertBMCStateFromString(state) == BMC::BMCState::Ready)
180+
{
181+
startFruPlugWatch();
182+
}
183+
}));
184184

185185
// Watch the chassis current and requested power state properties
186186
_properties.emplace_back(std::make_unique<InterfaceWatcher<DataInterface>>(
@@ -197,14 +197,14 @@ DataInterface::DataInterface(sdbusplus::bus_t& bus) : _bus(bus)
197197
{
198198
this->_chassisTransition = std::get<std::string>(trans->second);
199199
}
200-
}));
200+
}));
201201

202202
// Watch the CurrentHostState property
203203
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
204204
bus, object_path::hostState, interface::hostState, "CurrentHostState",
205205
*this, [this](const auto& value) {
206-
this->_hostState = std::get<std::string>(value);
207-
}));
206+
this->_hostState = std::get<std::string>(value);
207+
}));
208208

209209
// Watch the BaseBIOSTable property for the hmc managed attribute
210210
_properties.emplace_back(std::make_unique<PropertyWatcher<DataInterface>>(
@@ -223,7 +223,7 @@ DataInterface::DataInterface(sdbusplus::bus_t& bus) : _bus(bus)
223223
this->_hmcManaged = (*currentVal == "Enabled") ? true : false;
224224
}
225225
}
226-
}));
226+
}));
227227
}
228228

229229
DBusPropertyMap
@@ -924,7 +924,7 @@ void DataInterface::inventoryIfaceAdded(sdbusplus::message_t& msg)
924924
[](const auto& interfacePair) {
925925
return std::find(hotplugInterfaces.begin(), hotplugInterfaces.end(),
926926
interfacePair.first) != hotplugInterfaces.end();
927-
}) == interfaces.end())
927+
}) == interfaces.end())
928928
{
929929
return;
930930
}

0 commit comments

Comments
 (0)