-
Notifications
You must be signed in to change notification settings - Fork 8
/
.clang-format
48 lines (47 loc) · 1.36 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
---
Language: Cpp
BasedOnStyle: WebKit
AlignAfterOpenBracket: Align
AlignEscapedNewlines: DontAlign
AlignOperands: Align
AllowAllParametersOfDeclarationOnNextLine: false
AlwaysBreakAfterReturnType: All
BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Allman
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '"util\.h"'
Priority: 0
SortPriority: -1
CaseSensitive: true
- Regex: '"[^/]*"'
Priority: 0
SortPriority: 1
CaseSensitive: true
- Regex: '".*"'
Priority: 2
CaseSensitive: true
- Regex: '<.*>'
Priority: 3
CaseSensitive: true
IndentCaseLabels: true
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 3
PointerAlignment: Right
SpaceAfterCStyleCast: true
SpaceBeforeParens: Always
WhitespaceSensitiveMacros:
# Avoid breaking formatting in the code parameter
- G_DEFINE_TYPE_WITH_CODE
# Buggy workaround to add exceptions to 'SpaceBeforeParens: Always' (see below)
- _
# Workaround to avoid some alignment bugs when adding a macro to WhitespaceSensitiveMacros,
# see https://github.com/llvm/llvm-project/issues/55443#issuecomment-1953268337
# This doesn't fix all alignment bugs though, so I'd rather make an exception only for '_',
# and not also for 'N_' or 'I_' for example.
# See also https://github.com/llvm/llvm-project/issues/82288
Macros:
- _(x)=x
...