Skip to content

Commit 2796c53

Browse files
committed
restructure project
1 parent 1ae2551 commit 2796c53

Some content is hidden

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

44 files changed

+11247
-208
lines changed

.clang-format

+123-66
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,178 @@
11
---
2-
Language: Cpp
3-
# BasedOnStyle: WebKit
4-
AccessModifierOffset: -4
5-
AlignAfterOpenBracket: DontAlign
2+
Language: Cpp
3+
# BasedOnStyle: Chromium
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: false
67
AlignConsecutiveAssignments: false
8+
AlignConsecutiveBitFields: false
79
AlignConsecutiveDeclarations: false
8-
AlignEscapedNewlines: Right
9-
AlignOperands: false
10+
AlignEscapedNewlines: DontAlign
11+
AlignOperands: DontAlign
1012
AlignTrailingComments: false
13+
AllowAllArgumentsOnNextLine: true
14+
AllowAllConstructorInitializersOnNextLine: false
1115
AllowAllParametersOfDeclarationOnNextLine: true
12-
AllowShortBlocksOnASingleLine: false
16+
AllowShortEnumsOnASingleLine: false
17+
AllowShortBlocksOnASingleLine: Empty
1318
AllowShortCaseLabelsOnASingleLine: false
14-
AllowShortFunctionsOnASingleLine: All
15-
AllowShortIfStatementsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: Inline
20+
AllowShortLambdasOnASingleLine: All
21+
AllowShortIfStatementsOnASingleLine: Never
1622
AllowShortLoopsOnASingleLine: false
1723
AlwaysBreakAfterDefinitionReturnType: None
1824
AlwaysBreakAfterReturnType: None
19-
AlwaysBreakBeforeMultilineStrings: false
20-
AlwaysBreakTemplateDeclarations: MultiLine
21-
BinPackArguments: true
22-
BinPackParameters: true
25+
AlwaysBreakBeforeMultilineStrings: true
26+
AlwaysBreakTemplateDeclarations: Yes
27+
BinPackArguments: false
28+
BinPackParameters: false
2329
BraceWrapping:
24-
AfterClass: false
25-
AfterControlStatement: false
26-
AfterEnum: false
27-
AfterFunction: true
28-
AfterNamespace: false
30+
AfterCaseLabel: false
31+
AfterClass: true
32+
AfterControlStatement: MultiLine
33+
AfterEnum: true
34+
AfterFunction: true
35+
AfterNamespace: true
2936
AfterObjCDeclaration: false
30-
AfterStruct: false
31-
AfterUnion: false
32-
AfterExternBlock: false
33-
BeforeCatch: false
34-
BeforeElse: false
35-
IndentBraces: false
37+
AfterStruct: true
38+
AfterUnion: true
39+
AfterExternBlock: true
40+
BeforeCatch: false
41+
BeforeElse: false
42+
BeforeLambdaBody: true
43+
BeforeWhile: false
44+
IndentBraces: false
3645
SplitEmptyFunction: true
3746
SplitEmptyRecord: true
3847
SplitEmptyNamespace: true
39-
BreakBeforeBinaryOperators: All
40-
BreakBeforeBraces: WebKit
41-
BreakBeforeInheritanceComma: false
42-
BreakInheritanceList: BeforeColon
48+
BreakBeforeBinaryOperators: NonAssignment
49+
BreakBeforeBraces: Custom
50+
# BreakBeforeInheritanceComma: true
51+
BreakInheritanceList: BeforeComma
4352
BreakBeforeTernaryOperators: true
44-
BreakConstructorInitializersBeforeComma: false
53+
BreakConstructorInitializersBeforeComma: true
4554
BreakConstructorInitializers: BeforeComma
46-
BreakAfterJavaFieldAnnotations: false
55+
BreakAfterJavaFieldAnnotations: true
4756
BreakStringLiterals: true
48-
ColumnLimit: 0
49-
CommentPragmas: '^ IWYU pragma:'
57+
ColumnLimit: 80
58+
CommentPragmas: '^ IWYU pragma:'
5059
CompactNamespaces: false
5160
ConstructorInitializerAllOnOneLineOrOnePerLine: false
5261
ConstructorInitializerIndentWidth: 4
5362
ContinuationIndentWidth: 4
54-
Cpp11BracedListStyle: false
63+
Cpp11BracedListStyle: true
64+
DeriveLineEnding: false
5565
DerivePointerAlignment: false
56-
DisableFormat: false
66+
DisableFormat: false
5767
ExperimentalAutoDetectBinPacking: false
58-
FixNamespaceComments: false
68+
FixNamespaceComments: true
5969
ForEachMacros:
6070
- foreach
6171
- Q_FOREACH
6272
- BOOST_FOREACH
63-
IncludeBlocks: Preserve
73+
IncludeBlocks: Regroup
6474
IncludeCategories:
65-
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
66-
Priority: 2
67-
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
68-
Priority: 3
69-
- Regex: '.*'
70-
Priority: 1
71-
IncludeIsMainRegex: '(Test)?$'
72-
IndentCaseLabels: false
73-
IndentPPDirectives: None
74-
IndentWidth: 4
75+
# Standard library headers come before anything else
76+
- Regex: '^<[a-z_]+>'
77+
Priority: -1
78+
- Regex: '^<.+\.h(pp)?>'
79+
Priority: 1
80+
- Regex: '^<.*'
81+
Priority: 2
82+
- Regex: '.*'
83+
Priority: 3
84+
IncludeIsMainRegex: ''
85+
IncludeIsMainSourceRegex: ''
86+
IndentCaseLabels: true
87+
IndentCaseBlocks: false
88+
IndentGotoLabels: true
89+
IndentPPDirectives: AfterHash
90+
IndentExternBlock: NoIndent
91+
IndentWidth: 2
7592
IndentWrappedFunctionNames: false
76-
JavaScriptQuotes: Leave
93+
InsertTrailingCommas: Wrapped
94+
JavaScriptQuotes: Double
7795
JavaScriptWrapImports: true
78-
KeepEmptyLinesAtTheStartOfBlocks: true
96+
KeepEmptyLinesAtTheStartOfBlocks: false
7997
MacroBlockBegin: ''
80-
MacroBlockEnd: ''
98+
MacroBlockEnd: ''
8199
MaxEmptyLinesToKeep: 1
82-
NamespaceIndentation: Inner
83-
ObjCBinPackProtocolList: Auto
84-
ObjCBlockIndentWidth: 4
85-
ObjCSpaceAfterProperty: true
100+
NamespaceIndentation: None
101+
ObjCBinPackProtocolList: Never
102+
ObjCBlockIndentWidth: 2
103+
ObjCBreakBeforeNestedBlockParam: true
104+
ObjCSpaceAfterProperty: false
86105
ObjCSpaceBeforeProtocolList: true
87106
PenaltyBreakAssignment: 2
88-
PenaltyBreakBeforeFirstCallParameter: 19
107+
PenaltyBreakBeforeFirstCallParameter: 1
89108
PenaltyBreakComment: 300
90109
PenaltyBreakFirstLessLess: 120
91110
PenaltyBreakString: 1000
92111
PenaltyBreakTemplateDeclaration: 10
93112
PenaltyExcessCharacter: 1000000
94-
PenaltyReturnTypeOnItsOwnLine: 60
113+
PenaltyReturnTypeOnItsOwnLine: 200
95114
PointerAlignment: Left
96-
ReflowComments: true
97-
SortIncludes: true
115+
RawStringFormats:
116+
- Language: Cpp
117+
Delimiters:
118+
- cc
119+
- CC
120+
- cpp
121+
- Cpp
122+
- CPP
123+
- 'c++'
124+
- 'C++'
125+
CanonicalDelimiter: ''
126+
BasedOnStyle: google
127+
- Language: TextProto
128+
Delimiters:
129+
- pb
130+
- PB
131+
- proto
132+
- PROTO
133+
EnclosingFunctions:
134+
- EqualsProto
135+
- EquivToProto
136+
- PARSE_PARTIAL_TEXT_PROTO
137+
- PARSE_TEST_PROTO
138+
- PARSE_TEXT_PROTO
139+
- ParseTextOrDie
140+
- ParseTextProtoOrDie
141+
- ParseTestProto
142+
- ParsePartialTestProto
143+
CanonicalDelimiter: ''
144+
BasedOnStyle: google
145+
ReflowComments: true
146+
SortIncludes: true
98147
SortUsingDeclarations: true
99148
SpaceAfterCStyleCast: false
100-
SpaceAfterTemplateKeyword: true
149+
SpaceAfterLogicalNot: false
150+
SpaceAfterTemplateKeyword: false
101151
SpaceBeforeAssignmentOperators: true
102152
SpaceBeforeCpp11BracedList: true
103153
SpaceBeforeCtorInitializerColon: true
104154
SpaceBeforeInheritanceColon: true
105-
SpaceBeforeParens: ControlStatements
155+
SpaceBeforeParens: ControlStatementsExceptForEachMacros
106156
SpaceBeforeRangeBasedForLoopColon: true
157+
SpaceInEmptyBlock: false
107158
SpaceInEmptyParentheses: false
108-
SpacesBeforeTrailingComments: 1
109-
SpacesInAngles: false
110-
SpacesInContainerLiterals: true
159+
SpacesBeforeTrailingComments: 2
160+
SpacesInAngles: false
161+
SpacesInConditionalStatement: false
162+
SpacesInContainerLiterals: false
111163
SpacesInCStyleCastParentheses: false
112164
SpacesInParentheses: false
113165
SpacesInSquareBrackets: false
114-
Standard: Cpp11
166+
SpaceBeforeSquareBrackets: false
167+
Standard: Auto
115168
StatementMacros:
116169
- Q_UNUSED
117170
- QT_REQUIRE_VERSION
118-
TabWidth: 8
119-
UseTab: Never
171+
TabWidth: 8
172+
UseCRLF: false
173+
UseTab: Never
174+
WhitespaceSensitiveMacros:
175+
- STRINGIZE
176+
- PP_STRINGIZE
177+
- BOOST_PP_STRINGIZE
120178
...
121-

.clang-tidy

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
# Enable ALL the things! Except not really
3+
# misc-non-private-member-variables-in-classes: the options don't do anything
4+
Checks: "*,\
5+
-google-readability-todo,\
6+
-altera-unroll-loops,\
7+
-fuchsia-*,\
8+
fuchsia-multiple-inheritance,\
9+
-llvm-header-guard,\
10+
-llvm-include-order,\
11+
-llvmlibc-*,\
12+
-misc-non-private-member-variables-in-classes"
13+
WarningsAsErrors: ''
14+
CheckOptions:
15+
- key: 'bugprone-argument-comment.StrictMode'
16+
value: 'true'
17+
# Prefer using enum classes with 2 values for parameters instead of bools
18+
- key: 'bugprone-argument-comment.CommentBoolLiterals'
19+
value: 'true'
20+
- key: 'bugprone-misplaced-widening-cast.CheckImplicitCasts'
21+
value: 'true'
22+
- key: 'bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression'
23+
value: 'true'
24+
- key: 'bugprone-suspicious-string-compare.WarnOnLogicalNotComparison'
25+
value: 'true'
26+
- key: 'readability-simplify-boolean-expr.ChainedConditionalReturn'
27+
value: 'true'
28+
- key: 'readability-simplify-boolean-expr.ChainedConditionalAssignment'
29+
value: 'true'
30+
- key: 'readability-uniqueptr-delete-release.PreferResetCall'
31+
value: 'true'
32+
- key: 'cppcoreguidelines-init-variables.MathHeader'
33+
value: '<cmath>'
34+
- key: 'cppcoreguidelines-narrowing-conversions.PedanticMode'
35+
value: 'true'
36+
- key: 'readability-else-after-return.WarnOnUnfixable'
37+
value: 'true'
38+
- key: 'readability-else-after-return.WarnOnConditionVariables'
39+
value: 'true'
40+
- key: 'readability-inconsistent-declaration-parameter-name.Strict'
41+
value: 'true'
42+
- key: 'readability-qualified-auto.AddConstToQualified'
43+
value: 'true'
44+
- key: 'readability-redundant-access-specifiers.CheckFirstDeclaration'
45+
value: 'true'
46+
# These seem to be the most common identifier styles
47+
- key: 'readability-identifier-naming.AbstractClassCase'
48+
value: 'lower_case'
49+
- key: 'readability-identifier-naming.ClassCase'
50+
value: 'lower_case'
51+
- key: 'readability-identifier-naming.ClassConstantCase'
52+
value: 'lower_case'
53+
- key: 'readability-identifier-naming.ClassMemberCase'
54+
value: 'lower_case'
55+
- key: 'readability-identifier-naming.ClassMethodCase'
56+
value: 'lower_case'
57+
- key: 'readability-identifier-naming.ConstantCase'
58+
value: 'lower_case'
59+
- key: 'readability-identifier-naming.ConstantMemberCase'
60+
value: 'lower_case'
61+
- key: 'readability-identifier-naming.ConstantParameterCase'
62+
value: 'lower_case'
63+
- key: 'readability-identifier-naming.ConstantPointerParameterCase'
64+
value: 'lower_case'
65+
- key: 'readability-identifier-naming.ConstexprFunctionCase'
66+
value: 'lower_case'
67+
- key: 'readability-identifier-naming.ConstexprMethodCase'
68+
value: 'lower_case'
69+
- key: 'readability-identifier-naming.ConstexprVariableCase'
70+
value: 'lower_case'
71+
- key: 'readability-identifier-naming.EnumCase'
72+
value: 'lower_case'
73+
- key: 'readability-identifier-naming.EnumConstantCase'
74+
value: 'lower_case'
75+
- key: 'readability-identifier-naming.FunctionCase'
76+
value: 'lower_case'
77+
- key: 'readability-identifier-naming.GlobalConstantCase'
78+
value: 'lower_case'
79+
- key: 'readability-identifier-naming.GlobalConstantPointerCase'
80+
value: 'lower_case'
81+
- key: 'readability-identifier-naming.GlobalFunctionCase'
82+
value: 'lower_case'
83+
- key: 'readability-identifier-naming.GlobalPointerCase'
84+
value: 'lower_case'
85+
- key: 'readability-identifier-naming.GlobalVariableCase'
86+
value: 'lower_case'
87+
- key: 'readability-identifier-naming.InlineNamespaceCase'
88+
value: 'lower_case'
89+
- key: 'readability-identifier-naming.LocalConstantCase'
90+
value: 'lower_case'
91+
- key: 'readability-identifier-naming.LocalConstantPointerCase'
92+
value: 'lower_case'
93+
- key: 'readability-identifier-naming.LocalPointerCase'
94+
value: 'lower_case'
95+
- key: 'readability-identifier-naming.LocalVariableCase'
96+
value: 'lower_case'
97+
- key: 'readability-identifier-naming.MacroDefinitionCase'
98+
value: 'UPPER_CASE'
99+
- key: 'readability-identifier-naming.MemberCase'
100+
value: 'lower_case'
101+
- key: 'readability-identifier-naming.MethodCase'
102+
value: 'lower_case'
103+
- key: 'readability-identifier-naming.NamespaceCase'
104+
value: 'lower_case'
105+
- key: 'readability-identifier-naming.ParameterCase'
106+
value: 'lower_case'
107+
- key: 'readability-identifier-naming.ParameterPackCase'
108+
value: 'lower_case'
109+
- key: 'readability-identifier-naming.PointerParameterCase'
110+
value: 'lower_case'
111+
- key: 'readability-identifier-naming.PrivateMemberCase'
112+
value: 'lower_case'
113+
- key: 'readability-identifier-naming.PrivateMemberPrefix'
114+
value: 'm_'
115+
- key: 'readability-identifier-naming.PrivateMethodCase'
116+
value: 'lower_case'
117+
- key: 'readability-identifier-naming.ProtectedMemberCase'
118+
value: 'lower_case'
119+
- key: 'readability-identifier-naming.ProtectedMemberPrefix'
120+
value: 'm_'
121+
- key: 'readability-identifier-naming.ProtectedMethodCase'
122+
value: 'lower_case'
123+
- key: 'readability-identifier-naming.PublicMemberCase'
124+
value: 'lower_case'
125+
- key: 'readability-identifier-naming.PublicMethodCase'
126+
value: 'lower_case'
127+
- key: 'readability-identifier-naming.ScopedEnumConstantCase'
128+
value: 'lower_case'
129+
- key: 'readability-identifier-naming.StaticConstantCase'
130+
value: 'lower_case'
131+
- key: 'readability-identifier-naming.StaticVariableCase'
132+
value: 'lower_case'
133+
- key: 'readability-identifier-naming.StructCase'
134+
value: 'lower_case'
135+
- key: 'readability-identifier-naming.TemplateParameterCase'
136+
value: 'CamelCase'
137+
- key: 'readability-identifier-naming.TemplateTemplateParameterCase'
138+
value: 'CamelCase'
139+
- key: 'readability-identifier-naming.TypeAliasCase'
140+
value: 'lower_case'
141+
- key: 'readability-identifier-naming.TypedefCase'
142+
value: 'lower_case'
143+
- key: 'readability-identifier-naming.TypeTemplateParameterCase'
144+
value: 'CamelCase'
145+
- key: 'readability-identifier-naming.UnionCase'
146+
value: 'lower_case'
147+
- key: 'readability-identifier-naming.ValueTemplateParameterCase'
148+
value: 'CamelCase'
149+
- key: 'readability-identifier-naming.VariableCase'
150+
value: 'lower_case'
151+
- key: 'readability-identifier-naming.VirtualMethodCase'
152+
value: 'lower_case'
153+
...

0 commit comments

Comments
 (0)