forked from doxygen/doxygen
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.clang-format
More file actions
101 lines (86 loc) · 2.64 KB
/
.clang-format
File metadata and controls
101 lines (86 loc) · 2.64 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
# Style tries to match doxygen's source code style (not perfect)
BasedOnStyle: LLVM
# Do not reflow lines or comments; keeps existing wrapping/spacing.
ColumnLimit: 0
ReflowComments: false
# Preserve include order and grouping exactly as written.
SortIncludes: Never
IncludeBlocks: Preserve
SortUsingDeclarations: false
# Indentation
UseTab: Never
IndentWidth: 2
ContinuationIndentWidth: 2
NamespaceIndentation: None
IndentPPDirectives: None
IndentCaseLabels: false
IndentGotoLabels: false
IndentAccessModifiers : true
# Braces: Allman style (brace on next line for functions, classes, control).
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
# Access specifiers are indented like members in the file.
AccessModifierOffset: 0
EmptyLineBeforeAccessModifier: Never
# Short things on one line are common (e.g., inline ctor bodies).
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortLambdasOnASingleLine: All
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
# Initializer lists
BreakConstructorInitializers: AfterColon
AllowAllConstructorInitializersOnNextLine: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
# Spacing
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceBeforeSquareBrackets: false
SpaceAfterCStyleCast: false
# Pointer/reference binding matches code: `Type *name`, `Type &name`.
DerivePointerAlignment: false
PointerAlignment: Right
ReferenceAlignment: Right
# Keep existing alignment/columns where possible.
AlignTrailingComments: true
AlignOperands: true
AlignConsecutiveAssignments: AcrossEmptyLinesAndComments
AlignConsecutiveDeclarations: AcrossEmptyLinesAndComments
AlignConsecutiveMacros: None
AlignEscapedNewlines: DontAlign
AlignAfterOpenBracket: Align
BreakBeforeBinaryOperators: None
# Keep moderate vertical spacing, don't aggressively collapse empties.
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 2
# Avoid changing braced-init formatting in ways that could churn.
Cpp11BracedListStyle: false
# Avoid messing with some macros
WhitespaceSensitiveMacros:
- SRCLANGEXT
- ML_TYPE
- TSPEC0
- TSPEC
- ETYPE