Skip to content

Commit 2f94ff0

Browse files
committed
initial commit
0 parents  commit 2f94ff0

62 files changed

Lines changed: 7402 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Google C++ Style Guide 代码格式化配置
2+
# 基于 clang-format 的 Google 预设风格
3+
4+
BasedOnStyle: Google
5+
6+
# 语言设置
7+
Language: Cpp
8+
9+
# 缩进设置
10+
IndentWidth: 2
11+
TabWidth: 2
12+
UseTab: Never
13+
ContinuationIndentWidth: 4
14+
15+
# 列宽
16+
ColumnLimit: 120
17+
18+
# 指针和引用对齐
19+
PointerAlignment: Left
20+
ReferenceAlignment: Left
21+
22+
# 命名空间
23+
NamespaceIndentation: None
24+
FixNamespaceComments: true
25+
26+
# 括号样式
27+
AllowShortIfStatementsOnASingleLine: false
28+
AllowShortLoopsOnASingleLine: false
29+
AllowShortFunctionsOnASingleLine: Empty
30+
AllowShortBlocksOnASingleLine: false
31+
AllowShortCaseLabelsOnASingleLine: false
32+
33+
# 括号
34+
BraceWrapping:
35+
AfterClass: true
36+
AfterControlStatement: true
37+
AfterEnum: true
38+
AfterFunction: true
39+
AfterNamespace: false
40+
AfterStruct: true
41+
AfterUnion: true
42+
AfterExternBlock: false
43+
BeforeCatch: true
44+
BeforeElse: true
45+
BeforeWhile: false
46+
IndentBraces: false
47+
SplitEmptyFunction: true
48+
SplitEmptyRecord: true
49+
SplitEmptyNamespace: true
50+
51+
# 包含文件排序
52+
SortIncludes: true
53+
IncludeBlocks: Regroup
54+
55+
# 空格
56+
SpaceAfterCStyleCast: false
57+
SpaceAfterTemplateKeyword: true
58+
SpaceBeforeAssignmentOperators: true
59+
SpaceBeforeCpp11BracedList: false
60+
SpaceBeforeCtorInitializerColon: true
61+
SpaceBeforeInheritanceColon: true
62+
SpaceBeforeParens: ControlStatements
63+
SpaceBeforeRangeBasedForLoopColon: true
64+
SpaceInEmptyParentheses: false
65+
SpacesBeforeTrailingComments: 2
66+
SpacesInAngles: false
67+
SpacesInCStyleCastParentheses: false
68+
SpacesInContainerLiterals: true
69+
SpacesInParentheses: false
70+
SpacesInSquareBrackets: false
71+
72+
# 换行
73+
AlwaysBreakAfterReturnType: None
74+
AlwaysBreakBeforeMultilineStrings: false
75+
BreakBeforeBinaryOperators: None
76+
BreakBeforeBraces: Attach
77+
BreakBeforeTernaryOperators: true
78+
BreakConstructorInitializersBeforeComma: false
79+
BreakAfterJavaFieldAnnotations: false
80+
BreakStringLiterals: true
81+
82+
# 其他
83+
AlignAfterOpenBracket: Align
84+
AlignConsecutiveAssignments: false
85+
AlignConsecutiveDeclarations: false
86+
AlignEscapedNewlines: Right
87+
AlignOperands: true
88+
AlignTrailingComments: true
89+
BinPackArguments: true
90+
BinPackParameters: true
91+
CompactNamespaces: false
92+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
93+
DerivePointerAlignment: false
94+
DisableFormat: false
95+
ExperimentalAutoDetectBinPacking: false
96+
ForEachMacros:
97+
- foreach
98+
- Q_FOREACH
99+
- BOOST_FOREACH
100+
IncludeIsMainRegex: '([-_](test|unittest))?$'
101+
IndentCaseLabels: true
102+
IndentPPDirectives: None
103+
KeepEmptyLinesAtTheStartOfBlocks: false
104+
MacroBlockBegin: ''
105+
MacroBlockEnd: ''
106+
MaxEmptyLinesToKeep: 1
107+
PenaltyBreakAssignment: 2
108+
PenaltyBreakBeforeFirstCallParameter: 1
109+
PenaltyBreakComment: 300
110+
PenaltyBreakFirstLessLess: 120
111+
PenaltyBreakString: 1000
112+
PenaltyBreakTemplateDeclaration: 10
113+
PenaltyExcessCharacter: 1000000
114+
PenaltyReturnTypeOnItsOwnLine: 200
115+
ReflowComments: true
116+
SortUsingDeclarations: true
117+
Standard: Auto
118+

.clangd

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# clangd 配置文件
2+
# clangd 会自动查找项目根目录的 .clang-format 文件用于格式化
3+
# 无需显式配置 Format 选项
4+
5+
# 诊断设置
6+
Diagnostics:
7+
UnusedIncludes: Strict
8+
MissingIncludes: None # 禁用缺失头文件的警告(因为很多类型通过基类头文件间接包含)
9+
10+
# 索引设置
11+
Index:
12+
Background: Build
13+
14+
# 代码补全设置
15+
Completion:
16+
AllScopes: true
17+
18+
# 内联提示设置
19+
InlayHints:
20+
Enabled: true
21+
ParameterNames: true
22+
DeducedTypes: false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.pyc
2+
.claude

0 commit comments

Comments
 (0)