-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
134 lines (119 loc) · 3.16 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
130
131
132
133
134
---
# .clang-format 16
# Project
Language: Cpp
Standard: c++20
ColumnLimit: 120
# Indentation
AccessModifierOffset: -4
BitFieldColonSpacing: Both
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentCaseBlocks: false
IndentExternBlock: Indent
IndentPPDirectives: BeforeHash
IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: true
TabWidth: 4
UseTab: Never
# Alignment
AlignAfterOpenBracket: BlockIndent
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AlignOperands: DontAlign
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
# Allow
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortLambdasOnASingleLine: All
# Break
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeConceptDeclarations: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakBeforeBinaryOperators: None
BreakInheritanceList: AfterColon
BreakStringLiterals: true
SeparateDefinitionBlocks: Always
# Initializers & arguments
BinPackArguments: false
BinPackParameters: false
PackConstructorInitializers: Never
ConstructorInitializerIndentWidth: 4
Cpp11BracedListStyle: false
# Braces
BreakBeforeBraces: Allman
# Namespaces
CompactNamespaces: false
FixNamespaceComments: true
NamespaceIndentation: All
# Empty lines
EmptyLineBeforeAccessModifier: Always
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
# Sorting
IncludeBlocks: Regroup
IncludeCategories:
# Test headers
- Priority: 1
Regex: '<(catch2|gtest).*>'
# "Header.h", "Header.hpp" etc.
- Priority: 2
Regex: '^\"(.+)\"$'
# Core Library
- Priority: 3
Regex: '^<Core\/'
# C++ standard headers
- Priority: 4
Regex: '<[[:alnum:]_-]+>'
SortIncludes: CaseSensitive
SortUsingDeclarations: true
# Pointer & Reference Alignment
DerivePointerAlignment: false
PointerAlignment: Left
ReferenceAlignment: Pointer
# Comments
ReflowComments: false
# Spaces
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Line endings
LineEnding: LF
InsertNewlineAtEOF: true
# Qualifiers (const, volatile, static, etc)
QualifierAlignment: Custom
QualifierOrder: ['static', 'inline', 'constexpr', 'const', 'volatile', 'type']
...