-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
73 lines (72 loc) · 2.31 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
# See https://clang.llvm.org/docs/ClangFormatStyleOptions.html for more explanation of each parameter.
AlignAfterOpenBracket: Align # use ContinuationIndentWidth
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false # When the line is too long, align all parameters on the open bracket
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Allman
BreakBeforeInheritanceComma: true
BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 160
CompactNamespaces: true
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
IncludeBlocks: Regroup # Regroup to include order defined in IncludeCategories
IncludeCategories:
# Test framework
- Regex: "^<[gtest|gmock].*.h>"
Priority: 1
# System headers
- Regex: "^<[a-z0-9_]*.h>"
Priority: 2
# C++ headers
- Regex: "^<[a-z0-9_]*>"
Priority: 3
- Regex: ".*"
Priority: 4
IndentCaseLabels: false
IndentWidth: 2
Language: Cpp
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
# from Mozilla
PenaltyBreakAssignment: 40
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200 # set higher
PointerAlignment: Middle
QualifierAlignment: Custom
QualifierOrder: ['inline', 'static', 'type', 'const', 'constexpr', 'volatile' ]
SortIncludes: CaseInsensitive
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
UseTab: Never