-
Notifications
You must be signed in to change notification settings - Fork 1
/
.clang-format
89 lines (81 loc) · 2.41 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
BasedOnStyle: LLVM
UseCRLF: false
UseTab: Never
IndentWidth: 4
ColumnLimit: 0
BreakBeforeBraces: Allman
# Force pointers to the type for C++.
DerivePointerAlignment: false
PointerAlignment: Left
# Align public/final/protected on the left.
AccessModifierOffset: -4
# From clang-format-11 there are more fine grained options for this setting.
AlignOperands: false
BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true
AllowAllConstructorInitializersOnNextLine: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
BreakConstructorInitializers: BeforeComma
ConstructorInitializerIndentWidth: 4
AllowShortFunctionsOnASingleLine: None
# If false, all arguments will either be all on the same line or will have one line each.
BinPackArguments: true
BinPackParameters: true
AlignAfterOpenBracket: AlwaysBreak
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
# Merge multiple #include blocks together and sort as one. Then split into groups based on category priority:
# 1. Associated file header (XYZ.hpp)
# 2. C system headers. (Priority: 1-2)
# 3. C++ standard library headers (Priority: 5)
# 4. third party library headers (Priority: 10)
# 5. your other project headers (Priority: 20-22 + 30)
# Note this could break the code, read: https://stackoverflow.com/questions/37927553/can-clang-format-break-my-code
IncludeBlocks: Regroup
IncludeCategories:
# Public Gaia headers.
- Regex: 'gaia\/'
Priority: 20
# Internal Gaia headers.
- Regex: 'gaia_internal\/'
Priority: 21
# Internal Gaia headers.
- Regex: 'gaia_spdlog\/'
Priority: 22
# Internal Gaia headers.
- Regex: 'gaia_spdlog_setup\/'
Priority: 22
# Third-party headers.
- Regex: '[flatbuffers|gtest|libexplain|llvm|pybind11|rocksdb|spdlog|tabulate]\/'
Priority: 10
SortPriority: 10
- Regex: 'backward'
Priority: 10
SortPriority: 11
- Regex: 'cpptoml'
Priority: 10
SortPriority: 12
- Regex: 'liburing'
Priority: 10
SortPriority: 13
- Regex: 'postgres'
Priority: 10
SortPriority: 14
- Regex: 'pg_'
Priority: 10
SortPriority: 15
# C system headers.
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<c.*'
Priority: 2
# C++ library headers.
- Regex: '^<.*'
Priority: 5
# Component-only headers.
- Regex: '.*'
Priority: 30
KeepEmptyLinesAtTheStartOfBlocks: true
SpaceAfterCStyleCast: false
ContinuationIndentWidth: 4
AlignTrailingComments: false