-
Notifications
You must be signed in to change notification settings - Fork 48
/
.clang-format
134 lines (122 loc) · 3.73 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
# Based on LLVM style with C++20 support
BasedOnStyle: LLVM
Language: Cpp
Standard: c++20
# Tab and indent settings
TabWidth: 4
IndentWidth: 4
UseTab: Never
ColumnLimit: 160
# Text line management
#LineEndingStyle: LF
MaxEmptyLinesToKeep: 2
InsertNewlineAtEOF: true
# Alignment settings
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
#AlignConsecutiveTableGenDefinitionColons:
# Enabled: true
# AcrossEmptyLines: true
# AcrossComments: false
AlignEscapedNewlines: Left
AlignTrailingComments:
Kind: Always
OverEmptyLines: 1
DerivePointerAlignment: false
PointerAlignment: Right
# Single-line statements settings
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
# Braces and wrapping settings
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: false
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
Cpp11BracedListStyle: false
# Line breaks and wrapping settings
#AllowAllParametersOfDeclarationOnNextLine: true
#AllowBreakBeforeNoexceptSpecifier: OnlyWithParen
AlwaysBreakAfterDefinitionReturnType: None # Keep return type on the same line if possible
AlwaysBreakAfterReturnType: None # Default value
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BreakAfterAttributes: Always
BreakBeforeBinaryOperators: None # Default value: No line break before binary operators
BreakBeforeConceptDeclarations: Always
BreakConstructorInitializers: AfterColon
BreakBeforeTernaryOperators: false # Default value
BreakConstructorInitializersBeforeComma: true
#BreakInheritanceList: AfterColon
BreakStringLiterals: false # Default value
PackConstructorInitializers: NextLineOnly
PenaltyReturnTypeOnItsOwnLine: 200 # Prefer keeping return type on the same line if possible
# Indentation settings
AccessModifierOffset: -4
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: AfterHash
IndentWrappedFunctionNames: false
LambdaBodyIndentation: Signature
NamespaceIndentation: Inner
# Spaces around statements settings
SpaceAfterCStyleCast: false # Default value
SpaceAfterTemplateKeyword: false # Default value
#SpaceAroundPointerQualifiers: Left
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false # Default value
SpacesInAngles: false # Default value
SpacesInCStyleCastParentheses: false # Default value
SpacesInContainerLiterals: false # Default value
SpacesInParentheses: false # Default value
SpacesInSquareBrackets: false # Default value
# Macros settings
#MacroBlockBegin: [regex -> EXC_TRY...]
#MacroBlockEnd:
#StatementMacros: [-> ASSERT?]
# Scopes settings
FixNamespaceComments: true
ShortNamespaceLines: 2
# Miscellaneous settings
SeparateDefinitionBlocks: Always
ReflowComments: false
# Include order
#IncludeBlocks: Regroup
#IncludeIsMainRegex: '$?'
IncludeCategories:
#TODO: main include!
- Regex: '"([A-Za-z0-9\/-_])+\.h"'
Priority: 1
- Regex: '"([A-Za-z0-9\/-_])+\.hpp"'
Priority: 2
- Regex: '<([A-Za-z0-9\/-_])+\.h>'
Priority: 10
- Regex: '<([A-Za-z0-9\/-_])+\.hpp>'
Priority: 20
- Regex: '<([A-Za-z0-9\/-_])+>'
Priority: 30
SortIncludes: false