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: I542db97d7dc7fe5b03ffedbbdbff968d4c1bb032
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/mainloop.cpp b/mainloop.cpp
index 9327e6d..e38b156 100644
--- a/mainloop.cpp
+++ b/mainloop.cpp
@@ -113,7 +113,7 @@
{
switch (iface.first)
{
- // clang-format off
+ // clang-format off
case InterfaceType::VALUE:
{
auto& valueIface =
diff --git a/test/fanpwm_unittest.cpp b/test/fanpwm_unittest.cpp
index 0c34ab2..112f3e5 100644
--- a/test/fanpwm_unittest.cpp
+++ b/test/fanpwm_unittest.cpp
@@ -44,7 +44,7 @@
[=](sd_bus*, const char*, const char*, const char** names) {
EXPECT_STREQ(property.c_str(), names[0]);
return 0;
- }));
+ }));
}
return;
@@ -142,9 +142,9 @@
IsNull(), StrEq("asdf"), StrEq(FanPwmIntf), NotNull()))
.WillOnce(
Invoke([&](sd_bus*, const char*, const char*, const char** names) {
- EXPECT_EQ(0, strncmp("Target", names[0], 6));
- return 0;
- }));
+ EXPECT_EQ(0, strncmp("Target", names[0], 6));
+ return 0;
+ }));
EXPECT_EQ(target, f.target(target));
}
diff --git a/test/sensor_unittest.cpp b/test/sensor_unittest.cpp
index a1026cc..dd57595 100644
--- a/test/sensor_unittest.cpp
+++ b/test/sensor_unittest.cpp
@@ -90,8 +90,8 @@
EXPECT_CALL(gMock, build(StrEq("chipA"), StrEq("5")))
.WillOnce(Invoke([&](const std::string&, const std::string&) {
- return std::move(handleMock);
- }));
+ return std::move(handleMock);
+ }));
/* Always calls GAIN and OFFSET, can use ON_CALL instead of EXPECT_CALL */
EXPECT_CALL(env::mockEnv, get(StrEq("GAIN_temp5"))).WillOnce(Return(""));