-
Notifications
You must be signed in to change notification settings - Fork 0
/
formatter.clang-format
75 lines (72 loc) · 2.39 KB
/
formatter.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
74
75
{
# Google C/C++ Code Style settings
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# Author: Kehan Xue, kehan.xue (at) gmail.com
Language: Cpp,
BasedOnStyle: Google,
AccessModifierOffset: -1,
AlignAfterOpenBracket: Align,
AlignConsecutiveAssignments: None,
AlignOperands: Align,
AllowAllArgumentsOnNextLine: true,
AllowAllConstructorInitializersOnNextLine: true,
AllowAllParametersOfDeclarationOnNextLine: false,
AllowShortBlocksOnASingleLine: Empty,
AllowShortCaseLabelsOnASingleLine: true,
AllowShortFunctionsOnASingleLine: Inline,
AllowShortIfStatementsOnASingleLine: true, # To avoid conflict, set this "Never" and each "if statement" should include brace when coding
AllowShortLambdasOnASingleLine: Inline,
AllowShortLoopsOnASingleLine: true,
AlwaysBreakAfterReturnType: None,
AlwaysBreakTemplateDeclarations: Yes,
BinPackArguments: true,
BreakBeforeBraces: Custom,
BreakBeforeBinaryOperators: None,
BreakBeforeTernaryOperators: true,
BreakConstructorInitializers: BeforeColon,
BreakInheritanceList: BeforeColon,
ColumnLimit: 100,
CompactNamespaces: false,
ContinuationIndentWidth: 4,
Cpp11BracedListStyle: true,
DerivePointerAlignment: false, # Make sure the * or & align on the left
EmptyLineBeforeAccessModifier: LogicalBlock,
FixNamespaceComments: true,
IncludeBlocks: Preserve,
IndentCaseLabels: true,
IndentPPDirectives: None,
IndentWidth: 4,
KeepEmptyLinesAtTheStartOfBlocks: true,
MaxEmptyLinesToKeep: 1,
NamespaceIndentation: None,
ObjCSpaceAfterProperty: false,
ObjCSpaceBeforeProtocolList: true,
PointerAlignment: Left,
ReflowComments: false,
# SeparateDefinitionBlocks: Always, # Only support since clang-format 14
SpaceAfterCStyleCast: false,
SpaceAfterLogicalNot: false,
SpaceAfterTemplateKeyword: true,
SpaceBeforeAssignmentOperators: true,
SpaceBeforeCpp11BracedList: false,
SpaceBeforeCtorInitializerColon: true,
SpaceBeforeInheritanceColon: true,
SpaceBeforeParens: ControlStatements,
SpaceBeforeRangeBasedForLoopColon: true,
SpaceBeforeSquareBrackets: false,
SpaceInEmptyParentheses: false,
SpacesBeforeTrailingComments: 2,
SpacesInAngles: false,
SpacesInCStyleCastParentheses: false,
SpacesInContainerLiterals: false,
SpacesInParentheses: false,
SpaceBeforeCaseColon: false,
SpacesInSquareBrackets: false,
SpaceBeforeRangeBasedForLoopColon: false,
Standard: c++17,
TabWidth: 4,
AlignConsecutiveMacros: Consecutive,
AllowShortFunctionsOnASingleLine: None,
AlignTrailingComments: true,
UseTab: Never,
}