-
Notifications
You must be signed in to change notification settings - Fork 15
/
.clang-format
119 lines (102 loc) · 3.09 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
---
Language: Cpp
Standard: Latest
BasedOnStyle: LLVM
# int * a and int & a
PointerAlignment: Middle
ReferenceAlignment: Pointer
SpaceAroundPointerQualifiers: Both
# Don't touch position of "const int *" vs "int const *"
QualifierAlignment: Leave
ColumnLimit: 100
# Indentation width related flags
IndentWidth: 2
TabWidth: 2
UseTab: Never
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IndentCaseBlocks: false
IndentCaseLabels: false
IndentExternBlock: NoIndent
NamespaceIndentation: None
# Newline rules
InsertNewlineAtEOF: true
LineEnding: LF
MaxEmptyLinesToKeep: 1
# Collection of all brace wrapping rules
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterExternBlock: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false # Allow empty functions to have {} body
SplitEmptyRecord: true
SplitEmptyNamespace: true
# Inserting space settings, pretty much all of these are default
SpaceAfterTemplateKeyword: false
# vector<int>{1, 2, 3}
SpaceBeforeCpp11BracedList: false
# if (...), but func();
SpaceBeforeParens: ControlStatements
# for (auto it : myList) {
SpaceBeforeRangeBasedForLoopColon: true
# vector<int>
SpacesInAngles: Never
# class X
# {
# public:
# int field;
AccessModifierOffset: -2
AlignEscapedNewlines: Left
AlignOperands: AlignAfterOperator
BreakBeforeBinaryOperators: NonAssignment
# if arguments or parameters overflow, give them a line each
BinPackArguments: false
BinPackParameters: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
# If parameters/arguments don't fit on a single line, put the first parameter on the next line
AlignAfterOpenBracket: AlwaysBreak
# Always give constructor initializers their own line
PackConstructorInitializers: Never
# Avoid exceptions for short blocks
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: false
# We like to do [[nodiscard]] int
BreakAfterAttributes: Never
# const int &
# MyFunction()
AlwaysBreakAfterReturnType: All
AlwaysBreakTemplateDeclarations: Yes
# Makes initializer lists a bit more spacious { 1, 2, 3 }
Cpp11BracedListStyle: false
# false: do not add // jlm::rvsdg::delta to the closing curly bracket
FixNamespaceComments: false
# Allow multiple alphabetically sorted include blocks
IncludeBlocks: Preserve
# Only have one category, use alphabetical sorting within each include block
IncludeCategories:
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '^(Test)?'
SortIncludes: CaseInsensitive
SortUsingDeclarations: LexicographicNumeric
ReflowComments: true
# Changed from "Leave", forces space between definitions (functions, classes, structs)
SeparateDefinitionBlocks: Always