Skip to content

Commit af173fd

Browse files
Merge pull request #33 from deeplex/dev/update-cpp-template-v0.4.0
refactor: update to copier-cpp template v0.4.0
2 parents 93c78ca + cc2494c commit af173fd

48 files changed

Lines changed: 713 additions & 281 deletions

Some content is hidden

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

.clang-format

Lines changed: 129 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BasedOnStyle: LLVM
33

44
---
55
Language: Cpp
6-
BasedOnStyle: LLVM
6+
#BasedOnStyle: LLVM
77
AccessModifierOffset: -4
88
AlignAfterOpenBracket: Align
99
AlignArrayOfStructures: Right
@@ -12,93 +12,138 @@ AlignConsecutiveAssignments:
1212
AcrossEmptyLines: false
1313
AcrossComments: false
1414
AlignCompound: false
15+
AlignFunctionDeclarations: false
16+
AlignFunctionPointers: false
1517
PadOperators: true
1618
AlignConsecutiveBitFields:
1719
Enabled: false
1820
AcrossEmptyLines: false
1921
AcrossComments: false
2022
AlignCompound: false
23+
AlignFunctionDeclarations: false
24+
AlignFunctionPointers: false
2125
PadOperators: false
2226
AlignConsecutiveDeclarations:
2327
Enabled: false
2428
AcrossEmptyLines: false
2529
AcrossComments: false
2630
AlignCompound: false
31+
AlignFunctionDeclarations: true
32+
AlignFunctionPointers: false
2733
PadOperators: false
2834
AlignConsecutiveMacros:
2935
Enabled: true
3036
AcrossEmptyLines: false
3137
AcrossComments: true
3238
AlignCompound: false
39+
AlignFunctionDeclarations: false
40+
AlignFunctionPointers: false
41+
PadOperators: false
42+
AlignConsecutiveShortCaseStatements:
43+
Enabled: false
44+
AcrossEmptyLines: false
45+
AcrossComments: false
46+
AlignCaseArrows: false
47+
AlignCaseColons: false
48+
AlignConsecutiveTableGenBreakingDAGArgColons:
49+
Enabled: false
50+
AcrossEmptyLines: false
51+
AcrossComments: false
52+
AlignCompound: false
53+
AlignFunctionDeclarations: false
54+
AlignFunctionPointers: false
55+
PadOperators: false
56+
AlignConsecutiveTableGenCondOperatorColons:
57+
Enabled: false
58+
AcrossEmptyLines: false
59+
AcrossComments: false
60+
AlignCompound: false
61+
AlignFunctionDeclarations: false
62+
AlignFunctionPointers: false
63+
PadOperators: false
64+
AlignConsecutiveTableGenDefinitionColons:
65+
Enabled: false
66+
AcrossEmptyLines: false
67+
AcrossComments: false
68+
AlignCompound: false
69+
AlignFunctionDeclarations: false
70+
AlignFunctionPointers: false
3371
PadOperators: false
3472
AlignEscapedNewlines: Right
35-
AlignOperands: AlignAfterOperator
36-
AlignTrailingComments: true
73+
AlignOperands: Align
74+
AlignTrailingComments:
75+
Kind: Always
76+
OverEmptyLines: 1
3777
AllowAllArgumentsOnNextLine: true
3878
AllowAllParametersOfDeclarationOnNextLine: true
39-
AllowShortEnumsOnASingleLine: true
79+
AllowBreakBeforeNoexceptSpecifier: Never
4080
AllowShortBlocksOnASingleLine: Never
81+
AllowShortCaseExpressionOnASingleLine: true
4182
AllowShortCaseLabelsOnASingleLine: false
83+
AllowShortCompoundRequirementOnASingleLine: true
84+
AllowShortEnumsOnASingleLine: false
4285
AllowShortFunctionsOnASingleLine: None
43-
AllowShortLambdasOnASingleLine: Inline
4486
AllowShortIfStatementsOnASingleLine: Never
87+
AllowShortLambdasOnASingleLine: Inline
4588
AllowShortLoopsOnASingleLine: false
89+
AllowShortNamespacesOnASingleLine: false
4690
AlwaysBreakAfterDefinitionReturnType: None
47-
AlwaysBreakAfterReturnType: None
4891
AlwaysBreakBeforeMultilineStrings: false
49-
AlwaysBreakTemplateDeclarations: Yes
5092
AttributeMacros:
5193
- __capability
5294
- DPLX_ATTR_FORCE_INLINE
5395
- DPLX_ATTR_NO_UNIQUE_ADDRESS
96+
- DPLX_ATTR_DP_DEPRECATED
97+
- DPLX_ATTR_DP_DEPRECATED_
5498
BinPackArguments: true
55-
BinPackParameters: false
99+
BinPackParameters: OnePerLine
100+
BitFieldColonSpacing: Both
56101
BraceWrapping:
57102
AfterCaseLabel: false
58-
AfterClass: false
103+
AfterClass: true
59104
AfterControlStatement: Always
60-
AfterEnum: false
61-
AfterFunction: false
62-
AfterNamespace: false
105+
AfterEnum: true
106+
AfterExternBlock: true
107+
AfterFunction: true
108+
AfterNamespace: true
63109
AfterObjCDeclaration: false
64-
AfterStruct: false
65-
AfterUnion: false
66-
AfterExternBlock: false
67-
BeforeCatch: false
68-
BeforeElse: false
110+
AfterStruct: true
111+
AfterUnion: true
112+
BeforeCatch: true
113+
BeforeElse: true
69114
BeforeLambdaBody: false
70-
BeforeWhile: false
115+
BeforeWhile: true
71116
IndentBraces: false
72117
SplitEmptyFunction: true
73118
SplitEmptyRecord: true
74119
SplitEmptyNamespace: true
120+
BreakAdjacentStringLiterals: true
121+
BreakAfterAttributes: Leave
122+
BreakAfterJavaFieldAnnotations: true
123+
BreakAfterReturnType: None
124+
BreakArrays: false
75125
BreakBeforeBinaryOperators: All
76126
BreakBeforeConceptDeclarations: Always
77-
BreakBeforeBraces: Allman
78-
BreakBeforeInheritanceComma: false
79-
BreakInheritanceList: BeforeComma
127+
BreakBeforeBraces: Custom
128+
BreakBeforeInlineASMColon: OnlyMultiline
80129
BreakBeforeTernaryOperators: true
81-
BreakConstructorInitializersBeforeComma: false
130+
BreakBinaryOperations: Never
82131
BreakConstructorInitializers: BeforeComma
83-
BreakAfterJavaFieldAnnotations: false
132+
BreakFunctionDefinitionParameters: false
133+
BreakInheritanceList: BeforeComma
84134
BreakStringLiterals: true
135+
BreakTemplateDeclarations: Yes
85136
ColumnLimit: 80
86137
CommentPragmas: '^ IWYU pragma:'
87-
QualifierAlignment: Right
88138
CompactNamespaces: false
89139
ConstructorInitializerIndentWidth: 4
90140
ContinuationIndentWidth: 8
91141
Cpp11BracedListStyle: true
92-
DeriveLineEnding: true
93142
DerivePointerAlignment: false
94143
DisableFormat: false
95144
EmptyLineAfterAccessModifier: Never
96145
EmptyLineBeforeAccessModifier: LogicalBlock
97146
ExperimentalAutoDetectBinPacking: false
98-
PackConstructorInitializers: Never
99-
# deprecated, replaced by PackConstructorInitializers
100-
#ConstructorInitializerAllOnOneLineOrOnePerLine: true
101-
#AllowAllConstructorInitializersOnNextLine: false
102147
FixNamespaceComments: true
103148
ForEachMacros:
104149
- foreach
@@ -109,77 +154,109 @@ IncludeBlocks: Regroup
109154
IncludeCategories:
110155
- Regex: '^<[[:alpha:]_]*>$'
111156
Priority: 2
157+
SortPriority: 0
112158
CaseSensitive: false
113159
- Regex: '^<boost/'
114160
Priority: 5
161+
SortPriority: 0
115162
CaseSensitive: false
116163
- Regex: '^<dplx/cncr[/\.].*'
117164
Priority: 29
165+
SortPriority: 0
118166
CaseSensitive: true
119167
- Regex: '^<dplx/.*'
120168
Priority: 27
169+
SortPriority: 0
121170
CaseSensitive: true
122171
- Regex: '^<.*'
123172
Priority: 20
173+
SortPriority: 0
124174
CaseSensitive: false
125175
- Regex: '^".*'
126176
Priority: 30
177+
SortPriority: 0
127178
CaseSensitive: false
128179
IncludeIsMainRegex: '(\.test)?$'
129180
IncludeIsMainSourceRegex: ''
130181
IndentAccessModifiers: false
131-
IndentCaseLabels: false
132182
IndentCaseBlocks: false
183+
IndentCaseLabels: false
184+
IndentExportBlock: false
185+
IndentExternBlock: NoIndent
133186
IndentGotoLabels: true
134187
IndentPPDirectives: None
135-
IndentExternBlock: NoIndent
136188
IndentRequiresClause: true
137189
IndentWidth: 4
138190
IndentWrappedFunctionNames: false
139191
InsertBraces: true
192+
InsertNewlineAtEOF: true
140193
InsertTrailingCommas: None
194+
IntegerLiteralSeparator:
195+
Binary: 0
196+
BinaryMinDigits: 9
197+
Decimal: 3
198+
DecimalMinDigits: 5
199+
Hex: 4
200+
HexMinDigits: 5
141201
JavaScriptQuotes: Leave
142202
JavaScriptWrapImports: true
143-
KeepEmptyLinesAtTheStartOfBlocks: true
203+
KeepEmptyLines:
204+
AtEndOfFile: false
205+
AtStartOfBlock: true
206+
AtStartOfFile: true
207+
KeepFormFeed: true
144208
LambdaBodyIndentation: Signature
209+
LineEnding: LF
145210
MacroBlockBegin: ''
146211
MacroBlockEnd: ''
212+
MainIncludeChar: Quote
147213
MaxEmptyLinesToKeep: 1
148214
NamespaceIndentation: None
149215
ObjCBinPackProtocolList: Auto
150216
ObjCBlockIndentWidth: 2
151217
ObjCBreakBeforeNestedBlockParam: true
152218
ObjCSpaceAfterProperty: false
153219
ObjCSpaceBeforeProtocolList: true
220+
PackConstructorInitializers: Never
154221
PenaltyBreakAssignment: 2
155222
PenaltyBreakBeforeFirstCallParameter: 19
223+
PenaltyBreakBeforeMemberAccess: 150
156224
PenaltyBreakComment: 300
157225
PenaltyBreakFirstLessLess: 120
158226
PenaltyBreakOpenParenthesis: 0
227+
PenaltyBreakScopeResolution: 500
159228
PenaltyBreakString: 1000
160229
PenaltyBreakTemplateDeclaration: 10
161230
PenaltyExcessCharacter: 1000000
162-
PenaltyReturnTypeOnItsOwnLine: 60
163231
PenaltyIndentedWhitespace: 0
232+
PenaltyReturnTypeOnItsOwnLine: 60
164233
PointerAlignment: Right
165234
PPIndentWidth: -1
235+
QualifierAlignment: Right
166236
ReferenceAlignment: Pointer
167-
ReflowComments: true
237+
ReflowComments: Always
168238
RemoveBracesLLVM: false
239+
RemoveEmptyLinesInUnwrappedLines: true
240+
RemoveParentheses: Leave
241+
RemoveSemicolon: false
169242
RequiresClausePosition: OwnLine
243+
RequiresExpressionIndentation: OuterScope
170244
SeparateDefinitionBlocks: Leave
171245
ShortNamespaceLines: 1
246+
SkipMacroDefinitionBody: false
172247
SortIncludes: CaseInsensitive
173248
SortJavaStaticImport: Before
174-
SortUsingDeclarations: true
249+
SortUsingDeclarations: LexicographicNumeric
175250
SpaceAfterCStyleCast: false
176251
SpaceAfterLogicalNot: false
177252
SpaceAfterTemplateKeyword: true
253+
SpaceAroundPointerQualifiers: Default
178254
SpaceBeforeAssignmentOperators: true
179255
SpaceBeforeCaseColon: false
180256
SpaceBeforeCpp11BracedList: false
181257
SpaceBeforeCtorInitializerColon: true
182258
SpaceBeforeInheritanceColon: true
259+
SpaceBeforeJsonColon: false
183260
SpaceBeforeParens: ControlStatements
184261
SpaceBeforeParensOptions: # this is ignored due to SpaceBeforeParens != "Custom"
185262
AfterControlStatements: true
@@ -188,33 +265,40 @@ SpaceBeforeParensOptions: # this is ignored due to SpaceBeforeParens != "Custom"
188265
AfterFunctionDeclarationName: false
189266
AfterIfMacros: true
190267
AfterOverloadedOperator: false
268+
AfterPlacementOperator: true
191269
AfterRequiresInClause: false
192270
AfterRequiresInExpression: false
193271
BeforeNonEmptyParentheses: false
194-
SpaceAroundPointerQualifiers: Default
195272
SpaceBeforeRangeBasedForLoopColon: true
273+
SpaceBeforeSquareBrackets: false
196274
SpaceInEmptyBlock: false
197-
SpaceInEmptyParentheses: false
198275
SpacesBeforeTrailingComments: 1
199276
SpacesInAngles: Never
200-
SpacesInConditionalStatement: false
201277
SpacesInContainerLiterals: true
202-
SpacesInCStyleCastParentheses: false
203278
SpacesInLineCommentPrefix:
204279
Minimum: 1
205280
Maximum: -1
206-
SpacesInParentheses: false
281+
SpacesInParens: Never
282+
SpacesInParensOptions:
283+
ExceptDoubleParentheses: false
284+
InCStyleCasts: false
285+
InConditionalStatements: false
286+
InEmptyParentheses: false
287+
Other: false
207288
SpacesInSquareBrackets: false
208-
SpaceBeforeSquareBrackets: false
209-
BitFieldColonSpacing: Both
210289
Standard: Latest
211290
StatementAttributeLikeMacros:
212291
StatementMacros:
292+
TableGenBreakInsideDAGArg: DontBreak
213293
TabWidth: 4
214-
UseCRLF: false
215294
UseTab: Never
295+
VerilogBreakBetweenInstancePorts: true
216296
WhitespaceSensitiveMacros:
217-
- STRINGIZE
218-
- PP_STRINGIZE
219297
- BOOST_PP_STRINGIZE
298+
- CF_SWIFT_NAME
299+
- NS_SWIFT_NAME
300+
- PP_STRINGIZE
301+
- STRINGIZE
302+
WrapNamespaceBodyWithEmptyLines: Leave
220303
...
304+

.clang-tidy

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,47 @@
11
---
2+
# bugprone-forward-declaration-namespace generates a false positive for boost
3+
# clang-analyzer-optin.core.EnumCastOutOfRange I disagree.
24
# cppcoreguidelines-avoid-magic-numbers aliases readability-magic-numbers
35
# cppcoreguidelines-avoid-c-arrays aliases modernize-avoid-c-arrays
6+
# cppcoreguidelines-missing-std-forward doesn't recognize equivalent static casts
7+
# cppcoreguidelines-rvalue-reference-param-not-moved doesn't recognize equivalent static casts
48
# cppcoreguidelines-special-member-functions is overly explicit and verbose
9+
# cppcoreguidelines-use-default-member-init I disagree.
10+
# clang-analyzer-core.uninitialized.Assign happens to choke on OUTCOME_TRY
11+
# modernize-use-designated-initializers interacts badly with our test data tables
12+
# readability-redundant-inline-specifier doesn't consider MSVC /Ob1
513
Checks: >
614
boost-*,
15+
-boost-use-ranges,
716
bugprone-*,
817
-bugprone-easily-swappable-parameters,
18+
-bugprone-forward-declaration-namespace,
919
clang-analyzer-*,
20+
-clang-analyzer-core.uninitialized.Assign,
21+
-clang-analyzer-optin.core.EnumCastOutOfRange,
1022
clang-diagnostic-*,
1123
cppcoreguidelines-*,
1224
-cppcoreguidelines-avoid-c-arrays,
25+
-cppcoreguidelines-avoid-do-while,
26+
-cppcoreguidelines-missing-std-forward,
27+
-cppcoreguidelines-rvalue-reference-param-not-moved,
1328
-cppcoreguidelines-special-member-functions,
29+
-cppcoreguidelines-use-default-member-init,
1430
modernize-*,
1531
-modernize-avoid-c-arrays,
32+
-cppcoreguidelines-avoid-do-while,
1633
-modernize-use-default-member-init,
34+
-modernize-use-designated-initializers,
35+
-modernize-use-ranges,
1736
performance-*,
37+
-performance-enum-size,
1838
portability-*,
39+
-portability-template-virtual-member-function,
1940
readability-*,
2041
-readability-identifier-length,
2142
-readability-magic-numbers,
2243
-readability-named-parameter,
44+
-readability-redundant-inline-specifier,
2345
-readability-redundant-member-init,
2446
-readability-static-accessed-through-instance
2547
WarningsAsErrors: true

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: v0.3.2
2+
_commit: v0.4.0
33
_src_path: gh:deeplex/copier-cpp
44
email: henrik@gassmann.onl
55
full_name: Henrik Steffen Gaßmann

0 commit comments

Comments
 (0)