-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
71 lines (60 loc) · 1.6 KB
/
Copy path.clang-format
File metadata and controls
71 lines (60 loc) · 1.6 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
---
Language: Cpp
BasedOnStyle: LLVM
# Indentation
IndentWidth: 4
TabWidth: 4
UseTab: Never
ContinuationIndentWidth: 4
IndentCaseLabels: false
IndentCaseBlocks: false
IndentPPDirectives: BeforeHash
PPIndentWidth: 2
# Column limit
ColumnLimit: 80
# Braces — K&R (Attach)
BreakBeforeBraces: Attach
InsertBraces: true
# Short statements
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
# Alignment — the key setting for continuation parameter alignment
AlignAfterOpenBracket: Align
AlignConsecutiveDeclarations: false
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
BinPackArguments: true
BinPackParameters: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowAllArgumentsOnNextLine: false
# Pointer style
PointerAlignment: Right
# Spaces
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInParentheses: false
SpaceAfterCStyleCast: false
SpacesBeforeTrailingComments: 1
# Includes — auto-sort within semantic groups
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^"cfgpack/'
Priority: 1
- Regex: '^"'
Priority: 2
- Regex: '^<'
Priority: 3
# Comments — do not reflow (preserves section dividers)
ReflowComments: false
# Blank lines
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: false
# Penalties — strongly prefer not breaking function return types to a new line
PenaltyReturnTypeOnItsOwnLine: 10000
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyBreakAssignment: 100