-
Notifications
You must be signed in to change notification settings - Fork 681
/
.clang-format
44 lines (39 loc) · 1.35 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
# For more information, see:
#
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
BasedOnStyle: GNU
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AllowAllParametersOfDeclarationOnNextLine: false
AlwaysBreakAfterReturnType: AllDefinitions
BinPackParameters: false
BreakBeforeBraces: GNU
IndentWidth: 2
PointerAlignment: Right
UseTab: Never
SpaceBeforeParens: Always
SpaceAfterLogicalNot: true
SpaceAfterCStyleCast: true
# Our column limit is more around 80 characters but we want to avoid
# this rule to be over-agressive. So for clang-format, let's use a
# higher limit. Then let's put some biggish penalties on breaking on
# assignment, or parentheses, or other similar cases. Actually with such
# limits, if clang-format really ends up re-formatting, there might be
# something better to do code-wise (i.e. we might be in an akwardly
# over-nested block case).
ColumnLimit: 80
PenaltyBreakAssignment: 60
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyBreakOpenParenthesis: 40
PenaltyExcessCharacter: 1
# Strings are more often longer by usage, so let's give these slightly
# more space to breath.
PenaltyBreakString: 60
PenaltyReturnTypeOnItsOwnLine: 50