All: Update formatting style
This commit is contained in:
125
.clang-format
125
.clang-format
@@ -1,22 +1,22 @@
|
|||||||
# Generated from CLion C/C++ Code Style settings
|
# --- Based on Qt Coding Style ---
|
||||||
BasedOnStyle: LLVM
|
BasedOnStyle: LLVM
|
||||||
|
|
||||||
|
# --- Bracket and Indentation Behavior ---
|
||||||
|
IndentWidth: 4
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
TabWidth: 4
|
||||||
|
ColumnLimit: 100
|
||||||
|
UseTab: Never
|
||||||
AccessModifierOffset: -4
|
AccessModifierOffset: -4
|
||||||
AlignAfterOpenBracket: Align
|
|
||||||
AlignConsecutiveAssignments: None
|
AlignAfterOpenBracket: BlockIndent
|
||||||
AlignOperands: DontAlign
|
|
||||||
AllowAllArgumentsOnNextLine: false
|
|
||||||
AllowAllParametersOfDeclarationOnNextLine: false
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
AllowShortBlocksOnASingleLine: Empty
|
|
||||||
AllowShortCaseLabelsOnASingleLine: false
|
|
||||||
AllowShortFunctionsOnASingleLine: None
|
|
||||||
AllowShortIfStatementsOnASingleLine: Never
|
|
||||||
AllowShortLambdasOnASingleLine: Empty
|
|
||||||
AllowShortLoopsOnASingleLine: false
|
|
||||||
AlwaysBreakAfterReturnType: None
|
|
||||||
AlwaysBreakTemplateDeclarations: Yes
|
|
||||||
BinPackArguments: false
|
|
||||||
BinPackParameters: false
|
BinPackParameters: false
|
||||||
|
BinPackArguments: false
|
||||||
BreakBeforeBraces: Custom
|
BreakBeforeBraces: Custom
|
||||||
|
BreakTemplateDeclarations: Yes
|
||||||
|
BreakBeforeBinaryOperators: All
|
||||||
BraceWrapping:
|
BraceWrapping:
|
||||||
AfterCaseLabel: false
|
AfterCaseLabel: false
|
||||||
AfterClass: true
|
AfterClass: true
|
||||||
@@ -31,41 +31,68 @@ BraceWrapping:
|
|||||||
IndentBraces: false
|
IndentBraces: false
|
||||||
SplitEmptyFunction: false
|
SplitEmptyFunction: false
|
||||||
SplitEmptyRecord: true
|
SplitEmptyRecord: true
|
||||||
BreakBeforeBinaryOperators: NonAssignment
|
|
||||||
BreakBeforeTernaryOperators: true
|
# --- Special: Lambdas and Short Things ---
|
||||||
BreakConstructorInitializers: BeforeComma
|
AllowShortFunctionsOnASingleLine: None
|
||||||
BreakInheritanceList: BeforeColon
|
AllowShortBlocksOnASingleLine: Never
|
||||||
ColumnLimit: 100
|
AllowShortEnumsOnASingleLine: false
|
||||||
CompactNamespaces: false
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
ContinuationIndentWidth: 4
|
AllowShortLambdasOnASingleLine: Inline
|
||||||
IndentCaseLabels: true
|
AllowAllArgumentsOnNextLine: false
|
||||||
IndentPPDirectives: None
|
|
||||||
IndentWidth: 4
|
# --- Spaces ---
|
||||||
InsertBraces: true
|
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
|
||||||
MaxEmptyLinesToKeep: 2
|
|
||||||
NamespaceIndentation: None
|
|
||||||
ObjCSpaceAfterProperty: false
|
|
||||||
ObjCSpaceBeforeProtocolList: true
|
|
||||||
PackConstructorInitializers: Never
|
|
||||||
PointerAlignment: Left
|
|
||||||
ReflowComments: true
|
|
||||||
SortIncludes: Never
|
|
||||||
SpaceAfterCStyleCast: false
|
|
||||||
SpaceAfterLogicalNot: false
|
|
||||||
SpaceAfterTemplateKeyword: false
|
|
||||||
SpaceBeforeAssignmentOperators: true
|
|
||||||
SpaceBeforeCpp11BracedList: true
|
|
||||||
SpaceBeforeCtorInitializerColon: true
|
|
||||||
SpaceBeforeInheritanceColon: false
|
|
||||||
SpaceBeforeParens: ControlStatements
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceAfterCStyleCast: false
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
SpaceBeforeCpp11BracedList: true
|
||||||
SpaceBeforeRangeBasedForLoopColon: true
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
SpaceInEmptyParentheses: false
|
|
||||||
SpacesBeforeTrailingComments: 2
|
SpacesBeforeTrailingComments: 2
|
||||||
SpacesInAngles: false
|
SpaceAfterTemplateKeyword: false
|
||||||
SpacesInCStyleCastParentheses: false
|
SpaceBeforeInheritanceColon: false
|
||||||
SpacesInContainerLiterals: false
|
|
||||||
SpacesInParentheses: false
|
# --- Alignment & Formatting Tweaks ---
|
||||||
SpacesInSquareBrackets: false
|
AlignConsecutiveAssignments:
|
||||||
TabWidth: 4
|
Enabled: false
|
||||||
UseTab: Never
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
AlignFunctionPointers: false
|
||||||
|
PadOperators: true
|
||||||
|
AlignConsecutiveDeclarations:
|
||||||
|
Enabled: false
|
||||||
|
AcrossEmptyLines: false
|
||||||
|
AcrossComments: false
|
||||||
|
AlignCompound: false
|
||||||
|
AlignFunctionPointers: false
|
||||||
|
PadOperators: true
|
||||||
|
AlignOperands: DontAlign
|
||||||
|
BreakConstructorInitializers: BeforeComma
|
||||||
|
PointerAlignment: Left
|
||||||
|
ReferenceAlignment: Left
|
||||||
|
|
||||||
|
# --- Comment Style ---
|
||||||
|
CommentPragmas: '^ IWYU pragma:'
|
||||||
|
|
||||||
|
# --- Namespace handling ---
|
||||||
|
NamespaceIndentation: None
|
||||||
|
|
||||||
|
# --- Others ---
|
||||||
|
SortIncludes: Never
|
||||||
|
IncludeBlocks: Preserve
|
||||||
|
MaxEmptyLinesToKeep: 2
|
||||||
|
IndentCaseLabels: true
|
||||||
|
InsertBraces: true
|
||||||
|
AlignEscapedNewlines: DontAlign
|
||||||
|
PPIndentWidth: 1
|
||||||
|
IndentPPDirectives: AfterHash
|
||||||
|
ReflowComments: true
|
||||||
|
|
||||||
|
# --- Penalties (Fine-tuning when to break lines) ---
|
||||||
|
PenaltyBreakAssignment: 80
|
||||||
|
PenaltyBreakBeforeFirstCallParameter: 1
|
||||||
|
PenaltyBreakComment: 60
|
||||||
|
PenaltyBreakFirstLessLess: 120
|
||||||
|
PenaltyBreakString: 1000
|
||||||
|
PenaltyBreakOpenParenthesis: 5
|
||||||
|
PenaltyExcessCharacter: 10
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 600
|
||||||
|
|||||||
Reference in New Issue
Block a user