Skip to content

Commit 0e47928

Browse files
build: update copier-cpp template to v0.4.0
1 parent b2274e0 commit 0e47928

26 files changed

Lines changed: 491 additions & 86 deletions

.clang-format

Lines changed: 82 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,23 +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
96+
- DPLX_ATTR_DP_DEPRECATED
97+
- DPLX_ATTR_DP_DEPRECATED_
5698
BinPackArguments: true
57-
BinPackParameters: false
99+
BinPackParameters: OnePerLine
58100
BitFieldColonSpacing: Both
59101
BraceWrapping:
60102
AfterCaseLabel: false
@@ -75,17 +117,22 @@ BraceWrapping:
75117
SplitEmptyFunction: true
76118
SplitEmptyRecord: true
77119
SplitEmptyNamespace: true
120+
BreakAdjacentStringLiterals: true
78121
BreakAfterAttributes: Leave
79122
BreakAfterJavaFieldAnnotations: true
123+
BreakAfterReturnType: None
80124
BreakArrays: false
81125
BreakBeforeBinaryOperators: All
82126
BreakBeforeConceptDeclarations: Always
83127
BreakBeforeBraces: Custom
84128
BreakBeforeInlineASMColon: OnlyMultiline
85129
BreakBeforeTernaryOperators: true
130+
BreakBinaryOperations: Never
86131
BreakConstructorInitializers: BeforeComma
132+
BreakFunctionDefinitionParameters: false
87133
BreakInheritanceList: BeforeComma
88134
BreakStringLiterals: true
135+
BreakTemplateDeclarations: Yes
89136
ColumnLimit: 80
90137
CommentPragmas: '^ IWYU pragma:'
91138
CompactNamespaces: false
@@ -107,27 +154,34 @@ IncludeBlocks: Regroup
107154
IncludeCategories:
108155
- Regex: '^<[[:alpha:]_]*>$'
109156
Priority: 2
157+
SortPriority: 0
110158
CaseSensitive: false
111159
- Regex: '^<boost/'
112160
Priority: 5
161+
SortPriority: 0
113162
CaseSensitive: false
114163
- Regex: '^<dplx/dlog[/\.].*'
115164
Priority: 29
165+
SortPriority: 0
116166
CaseSensitive: true
117167
- Regex: '^<dplx/.*'
118168
Priority: 27
169+
SortPriority: 0
119170
CaseSensitive: true
120171
- Regex: '^<.*'
121172
Priority: 20
173+
SortPriority: 0
122174
CaseSensitive: false
123175
- Regex: '^".*'
124176
Priority: 30
177+
SortPriority: 0
125178
CaseSensitive: false
126179
IncludeIsMainRegex: '(\.test)?$'
127180
IncludeIsMainSourceRegex: ''
128181
IndentAccessModifiers: false
129182
IndentCaseBlocks: false
130183
IndentCaseLabels: false
184+
IndentExportBlock: false
131185
IndentExternBlock: NoIndent
132186
IndentGotoLabels: true
133187
IndentPPDirectives: None
@@ -146,11 +200,16 @@ IntegerLiteralSeparator:
146200
HexMinDigits: 5
147201
JavaScriptQuotes: Leave
148202
JavaScriptWrapImports: true
149-
KeepEmptyLinesAtTheStartOfBlocks: true
203+
KeepEmptyLines:
204+
AtEndOfFile: false
205+
AtStartOfBlock: true
206+
AtStartOfFile: true
207+
KeepFormFeed: true
150208
LambdaBodyIndentation: Signature
151209
LineEnding: LF
152210
MacroBlockBegin: ''
153211
MacroBlockEnd: ''
212+
MainIncludeChar: Quote
154213
MaxEmptyLinesToKeep: 1
155214
NamespaceIndentation: None
156215
ObjCBinPackProtocolList: Auto
@@ -161,9 +220,11 @@ ObjCSpaceBeforeProtocolList: true
161220
PackConstructorInitializers: Never
162221
PenaltyBreakAssignment: 2
163222
PenaltyBreakBeforeFirstCallParameter: 19
223+
PenaltyBreakBeforeMemberAccess: 150
164224
PenaltyBreakComment: 300
165225
PenaltyBreakFirstLessLess: 120
166226
PenaltyBreakOpenParenthesis: 0
227+
PenaltyBreakScopeResolution: 500
167228
PenaltyBreakString: 1000
168229
PenaltyBreakTemplateDeclaration: 10
169230
PenaltyExcessCharacter: 1000000
@@ -173,13 +234,16 @@ PointerAlignment: Right
173234
PPIndentWidth: -1
174235
QualifierAlignment: Right
175236
ReferenceAlignment: Pointer
176-
ReflowComments: true
237+
ReflowComments: Always
177238
RemoveBracesLLVM: false
178-
RemoveSemicolon: false # TODO: evaluate
239+
RemoveEmptyLinesInUnwrappedLines: true
240+
RemoveParentheses: Leave
241+
RemoveSemicolon: false
179242
RequiresClausePosition: OwnLine
180243
RequiresExpressionIndentation: OuterScope
181244
SeparateDefinitionBlocks: Leave
182245
ShortNamespaceLines: 1
246+
SkipMacroDefinitionBody: false
183247
SortIncludes: CaseInsensitive
184248
SortJavaStaticImport: Before
185249
SortUsingDeclarations: LexicographicNumeric
@@ -192,6 +256,7 @@ SpaceBeforeCaseColon: false
192256
SpaceBeforeCpp11BracedList: false
193257
SpaceBeforeCtorInitializerColon: true
194258
SpaceBeforeInheritanceColon: true
259+
SpaceBeforeJsonColon: false
195260
SpaceBeforeParens: ControlStatements
196261
SpaceBeforeParensOptions: # this is ignored due to SpaceBeforeParens != "Custom"
197262
AfterControlStatements: true
@@ -200,33 +265,40 @@ SpaceBeforeParensOptions: # this is ignored due to SpaceBeforeParens != "Custom"
200265
AfterFunctionDeclarationName: false
201266
AfterIfMacros: true
202267
AfterOverloadedOperator: false
268+
AfterPlacementOperator: true
203269
AfterRequiresInClause: false
204270
AfterRequiresInExpression: false
205271
BeforeNonEmptyParentheses: false
206272
SpaceBeforeRangeBasedForLoopColon: true
207273
SpaceBeforeSquareBrackets: false
208274
SpaceInEmptyBlock: false
209-
SpaceInEmptyParentheses: false
210275
SpacesBeforeTrailingComments: 1
211276
SpacesInAngles: Never
212-
SpacesInConditionalStatement: false
213277
SpacesInContainerLiterals: true
214-
SpacesInCStyleCastParentheses: false
215278
SpacesInLineCommentPrefix:
216279
Minimum: 1
217280
Maximum: -1
218-
SpacesInParentheses: false
281+
SpacesInParens: Never
282+
SpacesInParensOptions:
283+
ExceptDoubleParentheses: false
284+
InCStyleCasts: false
285+
InConditionalStatements: false
286+
InEmptyParentheses: false
287+
Other: false
219288
SpacesInSquareBrackets: false
220289
Standard: Latest
221290
StatementAttributeLikeMacros:
222291
StatementMacros:
292+
TableGenBreakInsideDAGArg: DontBreak
223293
TabWidth: 4
224294
UseTab: Never
295+
VerilogBreakBetweenInstancePorts: true
225296
WhitespaceSensitiveMacros:
226297
- BOOST_PP_STRINGIZE
227298
- CF_SWIFT_NAME
228299
- NS_SWIFT_NAME
229300
- PP_STRINGIZE
230301
- STRINGIZE
302+
WrapNamespaceBodyWithEmptyLines: Leave
231303
...
232304

.clang-tidy

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,51 @@
11
---
2+
# bugprone-forward-declaration-namespace generates a false positive for boost
3+
# clang-analyzer-optin.core.EnumCastOutOfRange I disagree.
4+
# clang-analyzer-optin.cplusplus.VirtualCall is currently violated by llfio
25
# cppcoreguidelines-avoid-magic-numbers aliases readability-magic-numbers
36
# cppcoreguidelines-avoid-c-arrays aliases modernize-avoid-c-arrays
7+
# cppcoreguidelines-missing-std-forward doesn't recognize equivalent static casts
8+
# cppcoreguidelines-rvalue-reference-param-not-moved doesn't recognize equivalent static casts
49
# cppcoreguidelines-special-member-functions is overly explicit and verbose
5-
# clang-analyzer-core.uninitialized.Assign is currently violated by status-code
6-
# clang-analyzer-optin.cplusplus.VirtualCall is currently violated by llfio
10+
# cppcoreguidelines-use-default-member-init I disagree.
11+
# clang-analyzer-core.uninitialized.Assign happens to choke on OUTCOME_TRY
12+
# modernize-use-designated-initializers interacts badly with our test data tables
13+
# readability-redundant-inline-specifier doesn't consider MSVC /Ob1
714
Checks: >
815
boost-*,
16+
-boost-use-ranges,
917
bugprone-*,
1018
-bugprone-easily-swappable-parameters,
19+
-bugprone-forward-declaration-namespace,
1120
clang-analyzer-*,
21+
-clang-analyzer-core.uninitialized.Assign,
22+
-clang-analyzer-optin.core.EnumCastOutOfRange,
23+
-clang-analyzer-optin.cplusplus.VirtualCall
1224
clang-diagnostic-*,
1325
cppcoreguidelines-*,
1426
-cppcoreguidelines-avoid-c-arrays,
1527
-cppcoreguidelines-avoid-do-while,
28+
-cppcoreguidelines-missing-std-forward,
29+
-cppcoreguidelines-rvalue-reference-param-not-moved,
1630
-cppcoreguidelines-special-member-functions,
31+
-cppcoreguidelines-use-default-member-init,
1732
modernize-*,
1833
-modernize-avoid-c-arrays,
34+
-cppcoreguidelines-avoid-do-while,
1935
-modernize-use-default-member-init,
36+
-modernize-use-designated-initializers,
37+
-modernize-use-ranges,
2038
performance-*,
39+
-performance-enum-size,
2140
portability-*,
41+
-portability-template-virtual-member-function,
2242
readability-*,
2343
-readability-identifier-length,
2444
-readability-magic-numbers,
2545
-readability-named-parameter,
46+
-readability-redundant-inline-specifier,
2647
-readability-redundant-member-init,
2748
-readability-static-accessed-through-instance,
28-
-clang-analyzer-core.uninitialized.Assign,
29-
-clang-analyzer-optin.cplusplus.VirtualCall
3049
WarningsAsErrors: true
3150
HeaderFilterRegex: ".*/src/dp(lx|_tests)/.*"
3251
FormatStyle: file

.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: https://github.com/deeplex/copier-cpp.git
44
email: henrik@gassmann.onl
55
full_name: Henrik Steffen Gaßmann

.devcontainer/devcontainer.json

Lines changed: 23 additions & 7 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++",
5-
"image": "ghcr.io/deeplex/devcontainer-cpp:ubuntu-22.04",
2+
"name": "Deeplex | C++",
3+
"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
}

0 commit comments

Comments
 (0)