-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
129 lines (117 loc) · 3.33 KB
/
.clang-format
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
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Indentation
IndentWidth: 4 # how many spaces to indent with
TabWidth: 4 # how many spaces count for a tab
UseTab: AlignWithSpaces # replace space indents with tabs
ColumnLimit: 100
IndentExternBlock: NoIndent
# Alignment and spacing
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Right
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: true
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
PadOperators: true
AlignFunctionPointers: true
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
# AlignEscapedNewlines: LeftWithLastLine
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
PointerAlignment: Left
QualifierAlignment: Left
ReferenceAlignment: Left
# Line breaks
# Generally force line breaks for easier debugging
AllowShortEnumsOnASingleLine: false
BreakAdjacentStringLiterals: true
BreakStringLiterals: false
BreakAfterAttributes: Always
BreakBeforeBinaryOperators: None # break after
BreakBeforeBraces: Attach # never break before braces
BreakBeforeTernaryOperators: true
# KeepEmptyLines:
# AtEndOfFile: false
# AtStartOfBlock: false
# AtStartOfFile: false
ReflowComments: true
SeparateDefinitionBlocks: Always
# Templates
# BreakTemplateDeclarations: Yes # break after template declaration
RequiresClausePosition: OwnLine
SpaceAfterTemplateKeyword: true
SpacesInAngles: Never
# Control statements
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: Empty # while loops
InsertBraces: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
# Switch case
# AllowShortCaseExpressionOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
IndentCaseBlocks: false
IndentCaseLabels: true
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
# AlignCaseArrows: true
AlignCaseColons: true
SpaceBeforeCaseColon: true
# Functions
AllowShortFunctionsOnASingleLine: Empty
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortLambdasOnASingleLine: Empty
BinPackArguments: false
BinPackParameters: false
IndentWrappedFunctionNames: false
# Preprocessor directives
IncludeBlocks: Preserve
SortIncludes: CaseSensitive
IndentPPDirectives: BeforeHash
# Classes
BreakConstructorInitializers: AfterColon
EmptyLineBeforeAccessModifier: LogicalBlock
EmptyLineAfterAccessModifier: Never
IndentAccessModifiers: false
PackConstructorInitializers: Never
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
# Namespaces
FixNamespaceComments: true
NamespaceIndentation: None
# Using declarations
SortUsingDeclarations: Lexicographic
# Spacing
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInSquareBrackets: false
Standard: Auto # Cpp11, Cpp14, Cpp17, Cpp20, Latest