forked from dartsim/dart
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
167 lines (163 loc) · 5.18 KB
/
.clang-format
File metadata and controls
167 lines (163 loc) · 5.18 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# https://releases.llvm.org/9.0.0/tools/clang/docs/ClangFormatStyleOptions.html
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 80
CommentPragmas: ""
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros: [foreach, Q_FOREACH]
# Sort headers by main include file (implicit priority 0),
# then project and private includes, then system headers
IncludeCategories:
# Project-relative headers (with quotes) - ordered by specificity
- Regex: '^"helpers\/GTestUtils\.h(pp)?"$' # core test utility (most specific)
Priority: 1
- Regex: '^"helpers\/common_helpers\.h(pp)?"$' # common test helpers
Priority: 2
- Regex: '^"helpers\/dynamics_helpers\.h(pp)?"$' # dynamics test helpers
Priority: 3
- Regex: '^"helpers\/.*\.h(pp)?"$' # other test helpers
Priority: 4
- Regex: '^".*\.h(pp)?"$' # other project headers
Priority: 5
# DART library headers (with angle brackets) - ordered from high-level to low-level
- Regex: '^<dart\/config\.hpp>$' # config first
Priority: 10
- Regex: '^<dart\/simulation\/experimental\/fwd\.hpp>$' # simulation-experimental forward declarations
Priority: 11
- Regex: '^<dart\/simulation\/experimental\/.*\.h(pp)?>$' # other simulation-experimental headers
Priority: 12
- Regex: '^<dart\/test\/.*\.h(pp)?>$' # test utilities
Priority: 20
- Regex: '^<dart\/python\/.*\.h(pp)?>$' # bindings
Priority: 21
- Regex: '^<dart\/gui\/.*\.h(pp)?>$' # GUI layer
Priority: 22
- Regex: '^<dart\/utils\/.*\.h(pp)?>$' # utilities & parsers
Priority: 23
- Regex: '^<dart\/simulation\/.*\.h(pp)?>$' # simulation layer
Priority: 24
- Regex: '^<dart\/constraint\/.*\.h(pp)?>$' # constraints
Priority: 25
- Regex: '^<dart\/collision\/.*\.h(pp)?>$' # collision detection
Priority: 26
- Regex: '^<dart\/dynamics\/.*\.h(pp)?>$' # dynamics
Priority: 27
- Regex: '^<dart\/optimizer\/.*\.h(pp)?>$' # optimization
Priority: 28
- Regex: '^<dart\/lcpsolver\/.*\.h(pp)?>$' # LCP solver
Priority: 29
- Regex: '^<dart\/integration\/.*\.h(pp)?>$' # integration
Priority: 30
- Regex: '^<dart\/math\/.*\.h(pp)?>$' # math primitives
Priority: 31
- Regex: '^<dart\/common\/.*\.h(pp)?>$' # common/base utilities
Priority: 32
- Regex: '^<dart\/.*\.h(pp)?>$' # other DART headers
Priority: 40
- Regex: '^<dart\/external\/.*\.h(pp)?>$' # external dependencies
Priority: 50
# 3rd-party headers
- Regex: '^<.*\.h(pp)?>$'
Priority: 50
- Regex: '^<.*\/.*>$'
Priority: 50
# C++ standard library headers, then C
# C-prefix headers (including the full C++20 set) are matched by the "^<c.*>$" regex
- Regex: "^<charconv>$"
Priority: 100
- Regex: "^<chrono>$"
Priority: 100
- Regex: "^<compare>$"
Priority: 100
- Regex: "^<complex>$"
Priority: 100
- Regex: "^<concepts>$"
Priority: 100
- Regex: "^<condition_variable>$"
Priority: 100
- Regex: "^<coroutine>$"
Priority: 100
- Regex: "^<c.*>$" # C standard library headers
Priority: 110
- Regex: "^<([a-z|_]+)>$"
Priority: 100
- Regex: ".*"
Priority: 999
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentFunctionDeclarationAfterType: false
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ""
MacroBlockEnd: ""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: 2
UseTab: Never