-
Notifications
You must be signed in to change notification settings - Fork 39
/
.clang-format
61 lines (54 loc) · 1.47 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#this file is used by clang-format to autoformat matx source code
#
# The clang-format is part of llvm toolchain.
# It need to install llvm and clang to format source code style.
#
# The basic usage is,
# clang-format -i -style=file PATH/TO/SOURCE/CODE
#
# The -style=file implicit use ".clang-format" file located in one of
# parent directory.
# The -i means inplace change.
#
# The document of clang-format is
# http://clang.llvm.org/docs/ClangFormat.html
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
IndentWidth: 2
TabWidth: 2
UseTab: Never
Language: Cpp
Standard: Cpp11
BasedOnStyle: Google
# indent
AccessModifierOffset: -1 # The private/protected/public has no indent in class
ContinuationIndentWidth: 4
# align
BreakBeforeTernaryOperators: true
BreakBeforeBinaryOperators: false
ColumnLimit: 100
# short block
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
# other
AllowAllParametersOfDeclarationOnNextLine: true
BinPackParameters: false
BinPackArguments: false
DerivePointerAlignment: false
PointerAlignment: Left
# clang-format 3.9+
SortIncludes: true
IncludeBlocks: Preserve
BreakStringLiterals: false
ReflowComments: true
IncludeCategories:
- Regex: '^<.*\.h(pp)?>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
...