style: cpp: update for clang-format-18
clang-format-18 changed the behavior for lambda formatting,
and by adjusting the penalties we think we can get a more
consistent formatting with a more natural indentation of lambdas.
Making these adjustments and will be reformatting all repositories
accordingly with clang-18.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I5e08687e696dd240402a2780158664b7113def0e
diff --git a/style/cpp/.clang-format b/style/cpp/.clang-format
index d43e884..28e3328 100644
--- a/style/cpp/.clang-format
+++ b/style/cpp/.clang-format
@@ -87,7 +87,7 @@
IndentWrappedFunctionNames: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: OuterScope
+LambdaBodyIndentation: Signature
LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
@@ -98,13 +98,14 @@
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 25
-PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakBeforeFirstCallParameter: 50
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
+PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
-PenaltyIndentedWhitespace: 0
+PenaltyIndentedWhitespace: 1
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left