-
Notifications
You must be signed in to change notification settings - Fork 27
/
.clang-format
39 lines (39 loc) · 1.17 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
---
# use default Google style, but with several differences
# for more detail, please refer to: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
BasedOnStyle: Google
IndentWidth: 4
---
Language: Cpp
# same level indent for class access level, eg: public
AccessModifierOffset: -4
# allow inline functions, short if statement, short loop on a single line
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
# not start new line for openinig brace:
# 1. enum, struct, union and class opening brace
# 2. else statement
# 3. catch statement
# start new line for opening brace:
# 1. function definition
# 2. namespace definition
BreakBeforeBraces: Custom
BraceWrapping:
AfterEnum: false
AfterStruct: false
AfterUnion: false
SplitEmptyFunction: false
BeforeElse: false
BeforeCatch: false
AfterFunction: true
AfterNamespace: true
AfterClass: true
# no line width limit
ColumnLimit: 0
KeepEmptyLinesAtTheStartOfBlocks: true
SortIncludes: true
SpacesBeforeTrailingComments: 1
# always break an open bracket, place closing bracket on a new line
AlignAfterOpenBracket: BlockIndent
SortIncludes: false