forked from FreeCAD/FreeCAD
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
98 lines (89 loc) · 2.41 KB
/
.clang-format
File metadata and controls
98 lines (89 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# --- Based on Qt Coding Style ---
BasedOnStyle: LLVM
# --- Bracket and Indentation Behavior ---
IndentWidth: 4
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
TabWidth: 4
ColumnLimit: 100
UseTab: Never
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AllowAllParametersOfDeclarationOnNextLine: false
BinPackParameters: false
BinPackArguments: false
BreakBeforeBraces: Custom
BreakTemplateDeclarations: Yes
BreakBeforeBinaryOperators: All
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterStruct: true
AfterControlStatement: Never
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
# --- Special: Lambdas and Short Things ---
AllowShortFunctionsOnASingleLine: None
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: Inline
AllowAllArgumentsOnNextLine: false
# --- Spaces ---
SpaceBeforeParens: ControlStatements
SpaceAfterCStyleCast: false
Cpp11BracedListStyle: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeRangeBasedForLoopColon: true
SpacesBeforeTrailingComments: 2
SpaceAfterTemplateKeyword: false
SpaceBeforeInheritanceColon: false
# --- Alignment & Formatting Tweaks ---
AlignConsecutiveAssignments:
Enabled: false
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