-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
80 lines (71 loc) · 1.79 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
---
# Language
Language: Cpp
Standard: Cpp11
# Indentation
IndentWidth: 4
ContinuationIndentWidth: 4
AccessModifierOffset: -4
IndentCaseLabels: false
NamespaceIndentation: None
# Spacing
UseTab: Never
SpaceBeforeParens: ControlStatements
SpacesBeforeTrailingComments: 1
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInCStyleCastParentheses: false
SpaceBeforeAssignmentOperators: true
MaxEmptyLinesToKeep: 2
# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
# Argument Packing
BinPackArguments: true
BinPackParameters: true
# Break handling
ColumnLimit: 100
BreakBeforeBraces: Mozilla
BreakBeforeBinaryOperators: NonAssignment
BreakConstructorInitializersBeforeComma: true
AlwaysBreakTemplateDeclarations: true
ConstructorInitializerAllOnOneLineOrOnePerLine: false
Cpp11BracedListStyle: true
# Break penalities
PenaltyBreakBeforeFirstCallParameter: 200
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 5
PenaltyReturnTypeOnItsOwnLine: 60
# Includes
SortIncludes: true
IncludeCategories:
# Match local headers
- Regex: '^"[[:alnum:]_]+\.h"$'
Priority: 1
# Match project headers
- Regex: '^"[[:alnum:]_]+/.+\.h"$'
Priority: 2
# Match Qt headers
- Regex: '^<Q[[:alnum:]_/]+>$'
Priority: 3
# Match other headers
- Regex: '.*'
Priority: 4
# Short blocks
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
# Set pointer format
DerivePointerAlignment: false
PointerAlignment: Left
...