Skip to content

Commit 3bae770

Browse files
Merge pull request #25 from deeplex/dev/update-cpp-template-v0.4.0
refactor: update to copier-cpp template v0.4.0
2 parents 7f7023c + c396526 commit 3bae770

52 files changed

Lines changed: 612 additions & 173 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: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,62 @@ 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
3573
AlignOperands: Align
@@ -38,25 +76,27 @@ AlignTrailingComments:
3876
OverEmptyLines: 1
3977
AllowAllArgumentsOnNextLine: true
4078
AllowAllParametersOfDeclarationOnNextLine: true
79+
AllowBreakBeforeNoexceptSpecifier: Never
4180
AllowShortBlocksOnASingleLine: Never
81+
AllowShortCaseExpressionOnASingleLine: true
4282
AllowShortCaseLabelsOnASingleLine: false
83+
AllowShortCompoundRequirementOnASingleLine: true
4384
AllowShortEnumsOnASingleLine: false
4485
AllowShortFunctionsOnASingleLine: None
4586
AllowShortIfStatementsOnASingleLine: Never
4687
AllowShortLambdasOnASingleLine: Inline
4788
AllowShortLoopsOnASingleLine: false
89+
AllowShortNamespacesOnASingleLine: false
4890
AlwaysBreakAfterDefinitionReturnType: None
49-
AlwaysBreakAfterReturnType: None
5091
AlwaysBreakBeforeMultilineStrings: false
51-
AlwaysBreakTemplateDeclarations: Yes
5292
AttributeMacros:
5393
- __capability
5494
- DPLX_ATTR_FORCE_INLINE
5595
- DPLX_ATTR_NO_UNIQUE_ADDRESS
5696
- DPLX_ATTR_DP_DEPRECATED
5797
- DPLX_ATTR_DP_DEPRECATED_
5898
BinPackArguments: true
59-
BinPackParameters: false
99+
BinPackParameters: OnePerLine
60100
BitFieldColonSpacing: Both
61101
BraceWrapping:
62102
AfterCaseLabel: false
@@ -77,17 +117,22 @@ BraceWrapping:
77117
SplitEmptyFunction: true
78118
SplitEmptyRecord: true
79119
SplitEmptyNamespace: true
120+
BreakAdjacentStringLiterals: true
80121
BreakAfterAttributes: Leave
81122
BreakAfterJavaFieldAnnotations: true
123+
BreakAfterReturnType: None
82124
BreakArrays: false
83125
BreakBeforeBinaryOperators: All
84126
BreakBeforeConceptDeclarations: Always
85127
BreakBeforeBraces: Custom
86128
BreakBeforeInlineASMColon: OnlyMultiline
87129
BreakBeforeTernaryOperators: true
130+
BreakBinaryOperations: Never
88131
BreakConstructorInitializers: BeforeComma
132+
BreakFunctionDefinitionParameters: false
89133
BreakInheritanceList: BeforeComma
90134
BreakStringLiterals: true
135+
BreakTemplateDeclarations: Yes
91136
ColumnLimit: 80
92137
CommentPragmas: '^ IWYU pragma:'
93138
CompactNamespaces: false
@@ -109,27 +154,34 @@ 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/dp[/\.].*'
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
131182
IndentCaseBlocks: false
132183
IndentCaseLabels: false
184+
IndentExportBlock: false
133185
IndentExternBlock: NoIndent
134186
IndentGotoLabels: true
135187
IndentPPDirectives: None
@@ -148,11 +200,16 @@ IntegerLiteralSeparator:
148200
HexMinDigits: 5
149201
JavaScriptQuotes: Leave
150202
JavaScriptWrapImports: true
151-
KeepEmptyLinesAtTheStartOfBlocks: true
203+
KeepEmptyLines:
204+
AtEndOfFile: false
205+
AtStartOfBlock: true
206+
AtStartOfFile: true
207+
KeepFormFeed: true
152208
LambdaBodyIndentation: Signature
153209
LineEnding: LF
154210
MacroBlockBegin: ''
155211
MacroBlockEnd: ''
212+
MainIncludeChar: Quote
156213
MaxEmptyLinesToKeep: 1
157214
NamespaceIndentation: None
158215
ObjCBinPackProtocolList: Auto
@@ -163,9 +220,11 @@ ObjCSpaceBeforeProtocolList: true
163220
PackConstructorInitializers: Never
164221
PenaltyBreakAssignment: 2
165222
PenaltyBreakBeforeFirstCallParameter: 19
223+
PenaltyBreakBeforeMemberAccess: 150
166224
PenaltyBreakComment: 300
167225
PenaltyBreakFirstLessLess: 120
168226
PenaltyBreakOpenParenthesis: 0
227+
PenaltyBreakScopeResolution: 500
169228
PenaltyBreakString: 1000
170229
PenaltyBreakTemplateDeclaration: 10
171230
PenaltyExcessCharacter: 1000000
@@ -175,13 +234,16 @@ PointerAlignment: Right
175234
PPIndentWidth: -1
176235
QualifierAlignment: Right
177236
ReferenceAlignment: Pointer
178-
ReflowComments: true
237+
ReflowComments: Always
179238
RemoveBracesLLVM: false
180-
RemoveSemicolon: false # TODO: evaluate
239+
RemoveEmptyLinesInUnwrappedLines: true
240+
RemoveParentheses: Leave
241+
RemoveSemicolon: false
181242
RequiresClausePosition: OwnLine
182243
RequiresExpressionIndentation: OuterScope
183244
SeparateDefinitionBlocks: Leave
184245
ShortNamespaceLines: 1
246+
SkipMacroDefinitionBody: false
185247
SortIncludes: CaseInsensitive
186248
SortJavaStaticImport: Before
187249
SortUsingDeclarations: LexicographicNumeric
@@ -194,6 +256,7 @@ SpaceBeforeCaseColon: false
194256
SpaceBeforeCpp11BracedList: false
195257
SpaceBeforeCtorInitializerColon: true
196258
SpaceBeforeInheritanceColon: true
259+
SpaceBeforeJsonColon: false
197260
SpaceBeforeParens: ControlStatements
198261
SpaceBeforeParensOptions: # this is ignored due to SpaceBeforeParens != "Custom"
199262
AfterControlStatements: true
@@ -202,33 +265,40 @@ SpaceBeforeParensOptions: # this is ignored due to SpaceBeforeParens != "Custom"
202265
AfterFunctionDeclarationName: false
203266
AfterIfMacros: true
204267
AfterOverloadedOperator: false
268+
AfterPlacementOperator: true
205269
AfterRequiresInClause: false
206270
AfterRequiresInExpression: false
207271
BeforeNonEmptyParentheses: false
208272
SpaceBeforeRangeBasedForLoopColon: true
209273
SpaceBeforeSquareBrackets: false
210274
SpaceInEmptyBlock: false
211-
SpaceInEmptyParentheses: false
212275
SpacesBeforeTrailingComments: 1
213276
SpacesInAngles: Never
214-
SpacesInConditionalStatement: false
215277
SpacesInContainerLiterals: true
216-
SpacesInCStyleCastParentheses: false
217278
SpacesInLineCommentPrefix:
218279
Minimum: 1
219280
Maximum: -1
220-
SpacesInParentheses: false
281+
SpacesInParens: Never
282+
SpacesInParensOptions:
283+
ExceptDoubleParentheses: false
284+
InCStyleCasts: false
285+
InConditionalStatements: false
286+
InEmptyParentheses: false
287+
Other: false
221288
SpacesInSquareBrackets: false
222289
Standard: Latest
223290
StatementAttributeLikeMacros:
224291
StatementMacros:
292+
TableGenBreakInsideDAGArg: DontBreak
225293
TabWidth: 4
226294
UseTab: Never
295+
VerilogBreakBetweenInstancePorts: true
227296
WhitespaceSensitiveMacros:
228297
- BOOST_PP_STRINGIZE
229298
- CF_SWIFT_NAME
230299
- NS_SWIFT_NAME
231300
- PP_STRINGIZE
232301
- STRINGIZE
302+
WrapNamespaceBodyWithEmptyLines: Leave
233303
...
234304

.clang-tidy

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +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.
510
# 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
613
Checks: >
714
boost-*,
15+
-boost-use-ranges,
816
bugprone-*,
917
-bugprone-easily-swappable-parameters,
18+
-bugprone-forward-declaration-namespace,
1019
clang-analyzer-*,
1120
-clang-analyzer-core.uninitialized.Assign,
21+
-clang-analyzer-optin.core.EnumCastOutOfRange,
1222
clang-diagnostic-*,
1323
cppcoreguidelines-*,
1424
-cppcoreguidelines-avoid-c-arrays,
1525
-cppcoreguidelines-avoid-do-while,
26+
-cppcoreguidelines-missing-std-forward,
27+
-cppcoreguidelines-rvalue-reference-param-not-moved,
1628
-cppcoreguidelines-special-member-functions,
29+
-cppcoreguidelines-use-default-member-init,
1730
modernize-*,
1831
-modernize-avoid-c-arrays,
1932
-cppcoreguidelines-avoid-do-while,
2033
-modernize-use-default-member-init,
34+
-modernize-use-designated-initializers,
35+
-modernize-use-ranges,
2136
performance-*,
37+
-performance-enum-size,
2238
portability-*,
39+
-portability-template-virtual-member-function,
2340
readability-*,
2441
-readability-identifier-length,
2542
-readability-magic-numbers,
2643
-readability-named-parameter,
44+
-readability-redundant-inline-specifier,
2745
-readability-redundant-member-init,
2846
-readability-static-accessed-through-instance
2947
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.4
2+
_commit: v0.4.0
33
_src_path: gh:deeplex/copier-cpp
44
email: henrik@gassmann.onl
55
full_name: Henrik Steffen Gaßmann

.devcontainer/devcontainer.json

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
31
{
4-
"name": "C++",
2+
"name": "Deeplex | C++",
53
"image": "ghcr.io/deeplex/devcontainer-cpp:ubuntu-24.04",
64
"customizations": {
75
"vscode": {
86
"extensions": [
7+
// general editor utility
98
"EditorConfig.EditorConfig",
9+
// GitHub integration
1010
"github.vscode-github-actions",
11+
"GitHub.vscode-pull-request-github",
12+
// C++
13+
"llvm-vs-code-extensions.vscode-clangd",
14+
"ms-vscode.cmake-tools",
15+
// sphinx
1116
"lextudio.restructuredtext",
1217
"ms-python.python",
13-
"ms-vscode.cpptools",
14-
"ms-vscode.cmake-tools",
1518
"trond-snekvik.simple-rst",
16-
"twxs.cmake",
1719
]
1820
}
1921
},
22+
"features": {
23+
"ghcr.io/devcontainers/features/common-utils:2": {
24+
"installZsh": true,
25+
"installOhMyZsh": true,
26+
"installOhMyZshConfig": true,
27+
"upgradePackages": true,
28+
"username": "vscode"
29+
},
30+
"ghcr.io/devcontainers/features/python:1": {
31+
"version": "os-provided",
32+
"installTools": true,
33+
"toolsToInstall": "copier,pipenv"
34+
}
35+
},
2036
"postCreateCommand": "cd ${containerWorkspaceFolder}/docs && pipenv sync --dev",
2137
}

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# style: Reformat sources with clang-format-16
22
581f623d89802e5be3982df44dad979feeb6cf8d
3+
# style: reformat sources with clang-format v20
4+
132b0409fe81d68b611d09316f1ed92890a77f25

0 commit comments

Comments
 (0)