summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorCYFS <[email protected]>2026-10-23 17:09:35 +0800
committerGitHub <[email protected]>2026-10-23 17:09:35 +0800
commita59e72fb5c2f272761a2813fc9bd9fe18eb29d7d (patch)
treebf7a71f0258553fe2ba876b43f3c3828326bdd20 /.clang-format
parent2f7aba80fbbe3e3e44997dfe9819665f01a82534 (diff)
[clang-format] Refine style rules with a thread.c formatting example (#11859)HEADmaster
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format18
1 files changed, 9 insertions, 9 deletions
diff --git a/.clang-format b/.clang-format
index ea0eac2783..559e7fa787 100644
--- a/.clang-format
+++ b/.clang-format
@@ -41,17 +41,17 @@ AlignConsecutiveShortCaseStatements:
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments:
- Kind: Leave
- OverEmptyLines: 1
+ Kind: Always
+ OverEmptyLines: 0
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: Inline
+AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
-AllowShortLambdasOnASingleLine: All
-AllowShortLoopsOnASingleLine: true
+AllowShortLambdasOnASingleLine: None
+AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
@@ -67,7 +67,7 @@ BraceWrapping:
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
- AfterExternBlock: false
+ AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
@@ -75,8 +75,8 @@ BraceWrapping:
AfterUnion: true
BeforeCatch: true
BeforeElse: true
- BeforeLambdaBody: false
- BeforeWhile: false
+ BeforeLambdaBody: true
+ BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
@@ -152,7 +152,7 @@ LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ""
MacroBlockEnd: ""
-MaxEmptyLinesToKeep: 2
+MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2