-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.clang-format
105 lines (98 loc) · 2.88 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
---
# 11.1.0
Language: Cpp
Standard: Auto
# identation
AccessModifierOffset: -2
UseTab: Never
ColumnLimit: 120
IndentWidth: 2
CommentPragmas: '^!'
IndentPPDirectives: AfterHash
IndentWrappedFunctionNames: true
NamespaceIndentation: All
IndentCaseLabels: false
# breaks
AlignOperands: true
AlwaysBreakTemplateDeclarations: Yes
AlwaysBreakBeforeMultilineStrings: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
PenaltyBreakAssignment: 10
# ctors
BreakConstructorInitializers: BeforeComma
ConstructorInitializerIndentWidth: 2
BreakInheritanceList: BeforeComma
# braces
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
# spaces
PointerAlignment: Left
SpaceAfterTemplateKeyword: false
SpacesBeforeTrailingComments: 2
SpaceBeforeInheritanceColon: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
# other
SortUsingDeclarations: false
FixNamespaceComments: true
# includes structure:
# optinal main include, may be local (use full path if possible)
# local includes (avoid if possible)
# includes from private libraries or impl includes from libraries (TODO: cleanup)
# includes from public libraries
# common includes (TODO: cleanup)
# third-party libraries
# qt/boost includes
# system includes
# std includes
SortIncludes: true
IncludeBlocks: Regroup
IncludeIsMainRegex: '$'
IncludeCategories:
# qt/boost
- Regex: '<(Qt|boost/).+>'
Priority: 6
# third-party includes
- Regex: '"3rdparty/.+"'
Priority: 5
# common includes
- Regex: '"(api_dynamic|byteorder|contract|error|error_tools|lazy|make_ptr|pointers|source_location|static_string|string_type|string_view|types)\.h"'
Priority: 4
# public libraries
- Regex: '"(analysis|async|binary(/compression)?|core|debug|devices|formats|io|l10n|math|module|parameters|platform(/(application|version))?|resource|sound|strings|time|tools)/[^/]+\.h"'
Priority: 3
# private libraries/impl includes
- Regex: '"(analysis|async|binary|core|debug|devices|formats|io|l10n|math|module|parameters|platform|resource|sound|strings|time|tools)/[^.]+\.h|zxtune.h"'
Priority: 2
# local includes or local libraries
- Regex: '".+\.h"'
Priority: 1
# std includes
- Regex: '<[_a-z0-9]+>'
Priority: 8
# system includes
- Regex: '<[/_a-z0-9]+\.h>'
Priority: 7