.clang-format 584 Bytes
Newer Older
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
Language:        Cpp
# 格式化风格,可以是LLVM, Google, Chromium, Mozilla, WebKit等,或者自定义
BasedOnStyle:  Google

# 缩进设置
IndentWidth:        2
TabWidth:           2
UseTab:             Never

# 换行相关设置
BreakBeforeBraces: Attach
AllowShortIfStatementsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false

# 类与结构体
DerivePointerAlignment: false
PointerAlignment: Left

# 包含文件的排序和分组
IncludeBlocks:   Preserve
SortIncludes:    true

# 控制最大行宽
ColumnLimit:     120