-
Notifications
You must be signed in to change notification settings - Fork 310
Expand file tree
/
Copy path.clang-format
More file actions
104 lines (94 loc) · 3.12 KB
/
Copy path.clang-format
File metadata and controls
104 lines (94 loc) · 3.12 KB
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
---
# clang-format
#
BasedOnStyle: LLVM
# Indentation
IndentWidth: 8
TabWidth: 8
UseTab: Always
ContinuationIndentWidth: 4
IndentCaseLabels: false
IndentGotoLabels: false # goto labels at column 0
IndentPPDirectives: None # preprocessor at column 0 (BSD)
AccessModifierOffset: -8
NamespaceIndentation: None
# Braces
BreakBeforeBraces: Custom
BraceWrapping:
AfterFunction: true
AfterControlStatement: Never
AfterStruct: false
AfterEnum: false
BeforeElse: false
BeforeCatch: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeInheritanceComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
# Line width / wrapping
ColumnLimit: 80
AlwaysBreakAfterReturnType: TopLevelDefinitions # only for definitions (BSD)
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortCaseLabelsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakStringLiterals: true
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyReturnTypeOnItsOwnLine: 60
# Spacing
SpaceAfterCStyleCast: false # (type)expr
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements # space after if/for/while, not after func
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false # (type) not ( type )
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
SpaceAfterLogicalNot: false # !expr, not ! expr
SpaceBeforeAssignmentOperators: true # a = b
SpaceBeforeCpp11BracedList: true
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
Cpp11BracedListStyle: true # space inside { 1, 2 }
# Pointer / reference alignment
PointerAlignment: Right # char *p (BSD style)
ReferenceAlignment: Right
DerivePointerAlignment: false
# Include sorting
SortIncludes: false # BSD: preserve include order
IncludeBlocks: Preserve
# Comments
ReflowComments: false
CommentPragmas: '^[[:space:]]*///'
# Alignment (don't align, KNF)
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: false
AlignEscapedNewlines: Left
AlignOperands: false
AlignTrailingComments: false
AlignAfterOpenBracket: DontAlign
# Misc
FixNamespaceComments: true
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: false
PenaltyBreakAssignment: 2
ForEachMacros:
- vec_foreach
- ll_foreach
- LL_FOREACH
- LL_FOREACH_SAFE