-
Notifications
You must be signed in to change notification settings - Fork 1
/
.clang-format
78 lines (68 loc) · 2.6 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
# Common
BasedOnStyle: Google
# Indents
# Explicitly disabling column limit for clang-format
# Enforce a limit of 100 using cpplint
ColumnLimit: 0
IndentWidth: 4
TabWidth: 4
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
AccessModifierOffset: -4
# Include
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
SortPriority: 0
# C++ system headers (as of C++20).
- Regex: '^[<"](algorithm|any|array|atomic|bitset|cassert|ccomplex|cctype|cerrno|cfenv|cfloat|charconv|chrono|cinttypes|ciso646|climits|clocale|cmath|codecvt|complex|condition_variable|csetjmp|csignal|cstdalign|cstdarg|cstdbool|cstddef|cstdint|cstdio|cstdlib|cstring|ctgmath|ctime|cuchar|cwchar|cwctype|deque|exception|execution|filesystem|forward_list|fstream|functional|future|initializer_list|iomanip|ios|iosfwd|iostream|istream|iterator|limits|list|locale|map|memory|memory_resource|mutex|new|numeric|optional|ostream|queue|random|ratio|regex|scoped_allocator|set|shared_mutex|sstream|stack|stdexcept|streambuf|string|string_view|strstream|system_error|thread|tuple|type_traits|typeindex|typeinfo|unordered_map|unordered_set|utility|valarray|variant|vector|concepts|coroutine|compare|version|source_location|format|span|ranges|bit|numbers|syncstream|stop_token|semaphore|latch|barrier)[">]$'
Priority: 2
- Regex: '^<.*'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 4
SortPriority: 0
# The Google Style Guide only asks for consistency within a project
# Explicitly choose "int& foo"
DerivePointerAlignment: false
PointerAlignment: Left
# Breaks
BreakConstructorInitializers: AfterColon
BreakBeforeBinaryOperators: NonAssignment
KeepEmptyLinesAtTheStartOfBlocks: true
# One Line
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Inline
ConstructorInitializerAllOnOneLineOrOnePerLine: false
# Brace Breaks
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeWhile: true
AfterStruct: true
AfterUnion: false
BeforeLambdaBody: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: false
SplitEmptyNamespace: true
# Align
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
# Spaces
SpaceAfterTemplateKeyword: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always