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: I29bbedda64e636062b5bfb3628542039bdc60c2b
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index 00e2e25..d92a3f1 100644
--- a/.clang-format
+++ b/.clang-format
@@ -6,12 +6,14 @@
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
-AlignOperands: true
-AlignTrailingComments: true
+AlignOperands: Align
+AlignTrailingComments:
+ Kind: Always
+ OverEmptyLines: 1
AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
+AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
@@ -36,6 +38,7 @@
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
+BreakAfterAttributes: Never
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
@@ -75,9 +78,13 @@
- Regex: '.*'
Priority: 6
IndentCaseLabels: true
+IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
+InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
@@ -85,13 +92,19 @@
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 25
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+QualifierAlignment: Left
+ReferenceAlignment: Left
ReflowComments: true
+RequiresClausePosition: OwnLine
+RequiresExpressionIndentation: Keyword
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
@@ -111,7 +124,6 @@
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 4
-UseCRLF: false
UseTab: Never
...
diff --git a/src/ipmiblob/blob_handler.cpp b/src/ipmiblob/blob_handler.cpp
index 6f114e5..fb797ff 100644
--- a/src/ipmiblob/blob_handler.cpp
+++ b/src/ipmiblob/blob_handler.cpp
@@ -246,8 +246,8 @@
static constexpr std::size_t blobStateSize = sizeof(meta.blob_state);
static constexpr std::size_t metaSize = sizeof(meta.size);
static constexpr std::size_t metaOffset = blobStateSize + metaSize;
- static constexpr std::size_t minRespSize =
- metaOffset + sizeof(std::uint8_t);
+ static constexpr std::size_t minRespSize = metaOffset +
+ sizeof(std::uint8_t);
std::vector<std::uint8_t> resp;
try
diff --git a/src/ipmiblob/ipmi_errors.hpp b/src/ipmiblob/ipmi_errors.hpp
index 355debd..b17db3d 100644
--- a/src/ipmiblob/ipmi_errors.hpp
+++ b/src/ipmiblob/ipmi_errors.hpp
@@ -35,11 +35,9 @@
/* This will leave the code as 0, but by virtue of being an exception
* thrown, we'll know it was an error on the host-side.
*/
- explicit IpmiException(const std::string& message) : _message(message)
- {}
+ explicit IpmiException(const std::string& message) : _message(message) {}
- explicit IpmiException(int cc) : IpmiException(messageFromIpmi(cc), cc)
- {}
+ explicit IpmiException(int cc) : IpmiException(messageFromIpmi(cc), cc) {}
virtual const char* what() const noexcept override
{