Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 163b3c0

Browse files
committed
fix: add formatter
1 parent 9311ae8 commit 163b3c0

File tree

3 files changed

+462
-312
lines changed

3 files changed

+462
-312
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Google C/C++ Code Style settings
2+
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
3+
# Author: Kehan Xue, kehan.xue (at) gmail.com
4+
5+
Language: Cpp
6+
BasedOnStyle: Google
7+
AccessModifierOffset: -1
8+
AlignAfterOpenBracket: Align
9+
AlignConsecutiveAssignments: None
10+
AlignOperands: Align
11+
AllowAllArgumentsOnNextLine: true
12+
AllowAllConstructorInitializersOnNextLine: true
13+
AllowAllParametersOfDeclarationOnNextLine: false
14+
AllowShortBlocksOnASingleLine: Empty
15+
AllowShortCaseLabelsOnASingleLine: false
16+
AllowShortFunctionsOnASingleLine: Inline
17+
AllowShortIfStatementsOnASingleLine: Never # To avoid conflict, set this "Never" and each "if statement" should include brace when coding
18+
AllowShortLambdasOnASingleLine: Inline
19+
AllowShortLoopsOnASingleLine: false
20+
AlwaysBreakAfterReturnType: None
21+
AlwaysBreakTemplateDeclarations: Yes
22+
BinPackArguments: true
23+
BreakBeforeBraces: Custom
24+
BraceWrapping:
25+
AfterCaseLabel: false
26+
AfterClass: false
27+
AfterStruct: false
28+
AfterControlStatement: Never
29+
AfterEnum: false
30+
AfterFunction: false
31+
AfterNamespace: false
32+
AfterUnion: false
33+
AfterExternBlock: false
34+
BeforeCatch: false
35+
BeforeElse: false
36+
BeforeLambdaBody: false
37+
IndentBraces: false
38+
SplitEmptyFunction: false
39+
SplitEmptyRecord: false
40+
SplitEmptyNamespace: false
41+
BreakBeforeBinaryOperators: None
42+
BreakBeforeTernaryOperators: true
43+
BreakConstructorInitializers: BeforeColon
44+
BreakInheritanceList: BeforeColon
45+
ColumnLimit: 80
46+
CompactNamespaces: false
47+
ContinuationIndentWidth: 4
48+
Cpp11BracedListStyle: true
49+
DerivePointerAlignment: false # Make sure the * or & align on the left
50+
EmptyLineBeforeAccessModifier: LogicalBlock
51+
FixNamespaceComments: true
52+
IncludeBlocks: Preserve
53+
IndentCaseLabels: true
54+
IndentPPDirectives: None
55+
IndentWidth: 2
56+
KeepEmptyLinesAtTheStartOfBlocks: true
57+
MaxEmptyLinesToKeep: 1
58+
NamespaceIndentation: None
59+
ObjCSpaceAfterProperty: false
60+
ObjCSpaceBeforeProtocolList: true
61+
PointerAlignment: Left
62+
ReflowComments: false
63+
# SeparateDefinitionBlocks: Always # Only support since clang-format 14
64+
SpaceAfterCStyleCast: false
65+
SpaceAfterLogicalNot: false
66+
SpaceAfterTemplateKeyword: true
67+
SpaceBeforeAssignmentOperators: true
68+
SpaceBeforeCpp11BracedList: false
69+
SpaceBeforeCtorInitializerColon: true
70+
SpaceBeforeInheritanceColon: true
71+
SpaceBeforeParens: ControlStatements
72+
SpaceBeforeRangeBasedForLoopColon: true
73+
SpaceBeforeSquareBrackets: false
74+
SpaceInEmptyParentheses: false
75+
SpacesBeforeTrailingComments: 2
76+
SpacesInAngles: false
77+
SpacesInCStyleCastParentheses: false
78+
SpacesInContainerLiterals: false
79+
SpacesInParentheses: false
80+
SpacesInSquareBrackets: false
81+
Standard: c++11
82+
TabWidth: 4
83+
UseTab: Never

0 commit comments

Comments
 (0)