-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
57 lines (48 loc) · 1.43 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
# Documentation:
# https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# CLion setup guide:
# https://www.jetbrains.com/help/clion/clangformat-as-alternative-formatter.html#clion-support
---
BasedOnStyle: Chromium
IndentWidth: 4
---
Language: Cpp
ColumnLimit: 100
# Always break after an open bracket, if the parameters don’t fit on a single line.
AlignAfterOpenBracket: AlwaysBreak
# Function call’s arguments will either be all on the same line or will have one line each.
BinPackArguments: false
BinPackParameters: false
AllowAllArgumentsOnNextLine: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterControlStatement: MultiLine
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
BeforeLambdaBody: true
# while (true) { continue; }
AllowShortBlocksOnASingleLine: Always
AllowShortLambdasOnASingleLine: Inline
# case 1: return 2;
AllowShortCaseLabelsOnASingleLine: true
IndentCaseBlocks: false
IndentCaseLabels: false
AlignOperands: false
ContinuationIndentWidth: 4
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: false
IndentAccessModifiers: false
AccessModifierOffset: -4
PenaltyIndentedWhitespace: 10
PenaltyBreakAssignment: 100
PenaltyReturnTypeOnItsOwnLine: 100
PenaltyBreakBeforeFirstCallParameter: 0
PenaltyBreakOpenParenthesis: 200