Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 72f6501

Browse files
Bump clang-format from 19.1.7 to 20.1.7 (#1419)
* Update Python package dependencies * Update clang-format configuration file for Clang 20.1 * Format all source files
1 parent 790cf78 commit 72f6501

File tree

37 files changed

+725
-681
lines changed

37 files changed

+725
-681
lines changed

‎.clang-format

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,31 @@ AlignConsecutiveAssignments:
88
AcrossEmptyLines: false
99
AcrossComments: false
1010
AlignCompound: false
11+
AlignFunctionDeclarations: false
1112
AlignFunctionPointers: false
1213
PadOperators: true
1314
AlignConsecutiveBitFields:
1415
Enabled: false
1516
AcrossEmptyLines: false
1617
AcrossComments: false
1718
AlignCompound: false
19+
AlignFunctionDeclarations: false
1820
AlignFunctionPointers: false
1921
PadOperators: false
2022
AlignConsecutiveDeclarations:
2123
Enabled: false
2224
AcrossEmptyLines: false
2325
AcrossComments: false
2426
AlignCompound: false
27+
AlignFunctionDeclarations: false
2528
AlignFunctionPointers: false
2629
PadOperators: false
2730
AlignConsecutiveMacros:
2831
Enabled: false
2932
AcrossEmptyLines: false
3033
AcrossComments: false
3134
AlignCompound: false
35+
AlignFunctionDeclarations: false
3236
AlignFunctionPointers: false
3337
PadOperators: false
3438
AlignConsecutiveShortCaseStatements:
@@ -42,20 +46,23 @@ AlignConsecutiveTableGenBreakingDAGArgColons:
4246
AcrossEmptyLines: false
4347
AcrossComments: false
4448
AlignCompound: false
49+
AlignFunctionDeclarations: false
4550
AlignFunctionPointers: false
4651
PadOperators: false
4752
AlignConsecutiveTableGenCondOperatorColons:
4853
Enabled: false
4954
AcrossEmptyLines: false
5055
AcrossComments: false
5156
AlignCompound: false
57+
AlignFunctionDeclarations: false
5258
AlignFunctionPointers: false
5359
PadOperators: false
5460
AlignConsecutiveTableGenDefinitionColons:
5561
Enabled: false
5662
AcrossEmptyLines: false
5763
AcrossComments: false
5864
AlignCompound: false
65+
AlignFunctionDeclarations: false
5966
AlignFunctionPointers: false
6067
PadOperators: false
6168
AlignEscapedNewlines: Left
@@ -75,6 +82,7 @@ AllowShortFunctionsOnASingleLine: Empty
7582
AllowShortIfStatementsOnASingleLine: Never
7683
AllowShortLambdasOnASingleLine: All
7784
AllowShortLoopsOnASingleLine: false
85+
AllowShortNamespacesOnASingleLine: false
7886
AlwaysBreakAfterDefinitionReturnType: None
7987
AlwaysBreakBeforeMultilineStrings: true
8088
AttributeMacros:
@@ -90,7 +98,7 @@ AttributeMacros:
9098
- MONGOCXX_ABI_NO_EXPORT
9199
- MONGOCXX_DEPRECATED
92100
BinPackArguments: false
93-
BinPackParameters: false
101+
BinPackParameters: OnePerLine
94102
BitFieldColonSpacing: Both
95103
BraceWrapping:
96104
AfterCaseLabel: false
@@ -121,6 +129,7 @@ BreakBeforeConceptDeclarations: Always
121129
BreakBeforeBraces: Attach
122130
BreakBeforeInlineASMColon: OnlyMultiline
123131
BreakBeforeTernaryOperators: true
132+
BreakBinaryOperations: Never
124133
BreakConstructorInitializers: BeforeColon
125134
BreakFunctionDefinitionParameters: false
126135
BreakInheritanceList: BeforeColon
@@ -197,6 +206,7 @@ IncludeIsMainSourceRegex: ''
197206
IndentAccessModifiers: false
198207
IndentCaseBlocks: false
199208
IndentCaseLabels: true
209+
IndentExportBlock: true
200210
IndentExternBlock: AfterExternBlock
201211
IndentGotoLabels: true
202212
IndentPPDirectives: None
@@ -219,6 +229,7 @@ KeepEmptyLines:
219229
AtEndOfFile: false
220230
AtStartOfBlock: false
221231
AtStartOfFile: false
232+
KeepFormFeed: false
222233
LambdaBodyIndentation: Signature
223234
LineEnding: DeriveLF
224235
MacroBlockBegin: ''
@@ -234,6 +245,7 @@ ObjCSpaceBeforeProtocolList: true
234245
PackConstructorInitializers: NextLine
235246
PenaltyBreakAssignment: 2
236247
PenaltyBreakBeforeFirstCallParameter: 1
248+
PenaltyBreakBeforeMemberAccess: 150
237249
PenaltyBreakComment: 300
238250
PenaltyBreakFirstLessLess: 120
239251
PenaltyBreakOpenParenthesis: 0
@@ -248,8 +260,9 @@ PPIndentWidth: -1
248260
QualifierAlignment: Right
249261
RawStringFormats: []
250262
ReferenceAlignment: Pointer
251-
ReflowComments: true
263+
ReflowComments: Always
252264
RemoveBracesLLVM: false
265+
RemoveEmptyLinesInUnwrappedLines: false
253266
RemoveParentheses: Leave
254267
RemoveSemicolon: false
255268
RequiresClausePosition: OwnLine
@@ -324,4 +337,5 @@ TypenameMacros:
324337
UseTab: Never
325338
VerilogBreakBetweenInstancePorts: true
326339
WhitespaceSensitiveMacros: []
340+
WrapNamespaceBodyWithEmptyLines: Leave
327341
...

‎benchmark/benchmark_runner.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,17 @@ benchmark_runner::benchmark_runner(std::set<benchmark_type> types) : _types{type
5555
// Single doc microbenchmarks
5656
_microbenches.push_back(std::make_unique<run_command>());
5757
_microbenches.push_back(std::make_unique<find_one_by_id>("single_and_multi_document/tweet.json"));
58-
_microbenches.push_back(std::make_unique<insert_one>(
59-
"TestSmallDocInsertOne", 2.75, iterations, "single_and_multi_document/small_doc.json"));
58+
_microbenches.push_back(
59+
std::make_unique<insert_one>(
60+
"TestSmallDocInsertOne", 2.75, iterations, "single_and_multi_document/small_doc.json"));
6061
_microbenches.push_back(
6162
std::make_unique<insert_one>("TestLargeDocInsertOne", 27.31, 10, "single_and_multi_document/large_doc.json"));
6263

6364
// Multi doc microbenchmarks
6465
_microbenches.push_back(std::make_unique<find_many>("single_and_multi_document/tweet.json"));
65-
_microbenches.push_back(std::make_unique<bulk_insert>(
66-
"TestSmallDocBulkInsert", 2.75, iterations, "single_and_multi_document/small_doc.json"));
66+
_microbenches.push_back(
67+
std::make_unique<bulk_insert>(
68+
"TestSmallDocBulkInsert", 2.75, iterations, "single_and_multi_document/small_doc.json"));
6769
_microbenches.push_back(
6870
std::make_unique<bulk_insert>("TestLargeDocBulkInsert", 27.31, 10, "single_and_multi_document/large_doc.json"));
6971
// CXX-2794: Disable GridFS benchmarks due to long runtime

‎examples/api/mongocxx/examples/clients/create/single/options/auto_encryption.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ void example(bsoncxx::document::view kms_providers) {
3838

3939
auto_encryption_opts.key_vault_namespace({"keyvault", "datakeys"});
4040
auto_encryption_opts.kms_providers(kms_providers);
41-
auto_encryption_opts.extra_options(bsoncxx::from_json(
42-
R"({"mongocryptdURI": "mongodb://localhost:27027", "mongocryptdSpawnArgs": ["--port", "27027"]})"));
41+
auto_encryption_opts.extra_options(
42+
bsoncxx::from_json(
43+
R"({"mongocryptdURI": "mongodb://localhost:27027", "mongocryptdSpawnArgs": ["--port", "27027"]})"));
4344
// ... other automatic encryption options.
4445

4546
mongocxx::options::client client_opts;

‎examples/api/mongocxx/examples/collections/bulk_write_with_options.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ void example(mongocxx::collection coll) {
4646
auto result_opt =
4747
coll.create_bulk_write(opts)
4848
.append(mongocxx::model::insert_one{bsoncxx::from_json(R"({"x": 10})")})
49-
.append(mongocxx::model::update_one{
50-
bsoncxx::from_json(R"({"x": {"$exists": 1}})"), bsoncxx::from_json(R"({"$set": {"x": 20}})")})
49+
.append(
50+
mongocxx::model::update_one{
51+
bsoncxx::from_json(R"({"x": {"$exists": 1}})"), bsoncxx::from_json(R"({"$set": {"x": 20}})")})
5152
.execute();
5253

5354
EXPECT(result_opt);

‎examples/api/mongocxx/examples/collections/index_views/create_with_options.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ void example(mongocxx::index_view indexes) {
4949

5050
// Index model.
5151
{
52-
auto result_opt = indexes.create_one(mongocxx::index_model{
53-
bsoncxx::from_json(R"({"y": 1})"),
54-
bsoncxx::from_json(R"({"name": "two"})"),
55-
});
52+
auto result_opt = indexes.create_one(
53+
mongocxx::index_model{
54+
bsoncxx::from_json(R"({"y": 1})"),
55+
bsoncxx::from_json(R"({"name": "two"})"),
56+
});
5657

5758
EXPECT(result_opt);
5859
EXPECT(result_opt->compare("two") == 0);

‎examples/api/runner.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,12 @@ class runner_type {
300300
if (verbose) {
301301
std::vector<bsoncxx::stdx::string_view> names;
302302

303-
names.reserve(std::accumulate(
304-
std::begin(all_components),
305-
std::end(all_components),
306-
std::size_t{0},
307-
[](std::size_t n, std::vector<component> const* cptr) { return n + cptr->size(); }));
303+
names.reserve(
304+
std::accumulate(
305+
std::begin(all_components),
306+
std::end(all_components),
307+
std::size_t{0},
308+
[](std::size_t n, std::vector<component> const* cptr) { return n + cptr->size(); }));
308309

309310
for (auto cptr : all_components) {
310311
for (auto c : *cptr) {

‎pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ apidocs = [
2424

2525
clang_format = [
2626
# etc/clang-format-all.sh
27-
"clang-format~=19.1",
27+
"clang-format~=20.1.0",
2828
]
2929

3030
config_generator = [

‎src/bsoncxx/include/bsoncxx/v1/detail/type_traits.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,10 +378,7 @@ static constexpr struct invoke_fn {
378378
// @cond DOXYGEN_DISABLE "Found ';' while parsing initializer list!"
379379
template <typename F, typename... Args, typename Fd = remove_cvref_t<F>>
380380
constexpr auto operator()(F&& fn, Args&&... args) const
381-
BSONCXX_PRIVATE_RETURNS(impl_invoke::invoker<
382-
std::is_member_object_pointer<Fd>::value,
383-
std::is_member_function_pointer<
384-
Fd>::value>::apply(static_cast<F&&>(fn), static_cast<Args&&>(args)...));
381+
BSONCXX_PRIVATE_RETURNS(impl_invoke::invoker<std::is_member_object_pointer<Fd>::value, std::is_member_function_pointer<Fd>::value>::apply(static_cast<F&&>(fn), static_cast<Args&&>(args)...));
385382
// @endcond
386383
} invoke;
387384

‎src/bsoncxx/test/v_noabi/bson_types.cpp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,15 @@ TEST_CASE("document uninitialized element throws exceptions", "") {
372372
REQUIRE_THROWS_WITH(
373373
doc["doesnotexist"].get_string().value,
374374

375-
Catch::Matchers::ContainsSubstring("cannot get string from an uninitialized element with key "
376-
"\"doesnotexist\": unset document::element"));
375+
Catch::Matchers::ContainsSubstring(
376+
"cannot get string from an uninitialized element with key "
377+
"\"doesnotexist\": unset document::element"));
377378

378379
REQUIRE_THROWS_WITH(
379380
doc["alsodoesnotexist"].get_value(),
380-
Catch::Matchers::ContainsSubstring("cannot return the type of uninitialized element with key "
381-
"\"alsodoesnotexist\": unset document::element"));
381+
Catch::Matchers::ContainsSubstring(
382+
"cannot return the type of uninitialized element with key "
383+
"\"alsodoesnotexist\": unset document::element"));
382384

383385
// Ensure a non-existing element evaluates to false.
384386
REQUIRE(!doc["doesnotexist"]);
@@ -387,8 +389,9 @@ TEST_CASE("document uninitialized element throws exceptions", "") {
387389
// Ensure getting a key from a non-existing element results in an exception.
388390
REQUIRE_THROWS_WITH(
389391
doc["doesnotexist"].key(),
390-
Catch::Matchers::ContainsSubstring("cannot return the key from an uninitialized element with key "
391-
"\"doesnotexist\": unset document::element"));
392+
Catch::Matchers::ContainsSubstring(
393+
"cannot return the key from an uninitialized element with key "
394+
"\"doesnotexist\": unset document::element"));
392395
}
393396

394397
TEST_CASE("array uninitialized element throws exceptions", "") {
@@ -398,16 +401,18 @@ TEST_CASE("array uninitialized element throws exceptions", "") {
398401

399402
REQUIRE_THROWS_WITH(
400403
arr.view()[3].get_string().value,
401-
Catch::Matchers::ContainsSubstring("cannot get string from an uninitialized element with key "
402-
"\"3\": unset document::element"));
404+
Catch::Matchers::ContainsSubstring(
405+
"cannot get string from an uninitialized element with key "
406+
"\"3\": unset document::element"));
403407
// Ensure a non-existing element evaluates to false.
404408
REQUIRE(!arr.view()[3]);
405409
// Ensure finding a non-existing element results in an end iterator.
406410
REQUIRE(arr.view().find(3) == arr.view().cend());
407411
// Ensure getting a key from a non-existing element results in an exception.
408412
REQUIRE_THROWS_WITH(
409413
arr.view()[3].key(),
410-
Catch::Matchers::ContainsSubstring("cannot return the key from an uninitialized element with key "
411-
"\"3\": unset document::element"));
414+
Catch::Matchers::ContainsSubstring(
415+
"cannot return the key from an uninitialized element with key "
416+
"\"3\": unset document::element"));
412417
}
413418
} // namespace

‎src/mongocxx/include/mongocxx/v_noabi/mongocxx/options/aggregate.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,7 @@ class aggregate {
333333
/// @see
334334
/// - https://www.mongodb.com/docs/manual/reference/command/aggregate/
335335
///
336-
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<
337-
bsoncxx::v_noabi::types::bson_value::view_or_value> const&)
336+
MONGOCXX_ABI_EXPORT_CDECL(bsoncxx::v_noabi::stdx::optional<bsoncxx::v_noabi::types::bson_value::view_or_value> const&)
338337
comment() const;
339338

340339
private:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /