Skip to content

Commit 378b138

Browse files
authored
CDRIVER-6085 Reorder + annotate include directives with "IWYU pragma: export" (#2167)
* Reorder and annotate component include directives with "IWYU pragma: export" * Apply "keep" pragma to unused headers in compat.h * Rename bson-private.h -> bson_t-private.h * Drive-by Python script format fixes
1 parent 48d0a48 commit 378b138

File tree

60 files changed

+232
-89
lines changed

Some content is hidden

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

60 files changed

+232
-89
lines changed

.evergreen/config_generator/components/earthly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def earthly_task(
274274

275275
CONTAINER_RUN_DISTROS = [
276276
'amazon2',
277-
"debian11-latest-large",
277+
'debian11-latest-large',
278278
'debian12-latest-large',
279279
'ubuntu2204-large',
280280
'ubuntu2404-large',

.evergreen/config_generator/components/oidc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from shrub.v3.evg_build_variant import BuildVariant
2-
from shrub.v3.evg_command import EvgCommandType, ec2_assume_role, KeyValueParam, expansions_update
2+
from shrub.v3.evg_command import EvgCommandType, KeyValueParam, ec2_assume_role, expansions_update
33
from shrub.v3.evg_task import EvgTask, EvgTaskRef
44
from shrub.v3.evg_task_group import EvgTaskGroup
55

6-
from config_generator.components.funcs.run_tests import RunTests
76
from config_generator.components.funcs.fetch_det import FetchDET
87
from config_generator.components.funcs.fetch_source import FetchSource
8+
from config_generator.components.funcs.run_tests import RunTests
99
from config_generator.components.sasl.openssl import SaslCyrusOpenSSLCompile
10-
from config_generator.etc.utils import bash_exec
1110
from config_generator.etc.distros import find_small_distro
11+
from config_generator.etc.utils import bash_exec
1212

1313

1414
def task_groups():

.evergreen/legacy_config_generator/evergreen_config_lib/testazurekms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def _create_variant():
101101
name='testazurekms-variant',
102102
display_name='Azure KMS',
103103
# Azure Virtual Machine created is Debian 11.
104-
run_on='debian11-small', # TODO: switch to 'debian11-latest-small' after DEVPROD-23011 fixed.
104+
run_on='debian11-small', # TODO: switch to 'debian11-latest-small' after DEVPROD-23011 fixed.
105105
tasks=['testazurekms_task_group', 'testazurekms-fail-task'],
106106
batchtime=20160,
107107
) # Use a batchtime of 14 days as suggested by the CSFLE test README

src/common/src/mlib/platform.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
#define _WIN32_WINNT 0x601
3838
#endif
3939
// Winsock must be included before windows.h
40-
#include <winsock2.h>
41-
#include <windows.h>
40+
#include <winsock2.h> // IWYU pragma: export
41+
#include <windows.h> // IWYU pragma: export
4242
#endif
4343

4444
// POSIX headers
4545
#if defined(__unix__) || defined(__unix) || defined(__APPLE__)
46-
#include <unistd.h>
47-
#include <fcntl.h>
48-
#include <sys/types.h>
46+
#include <unistd.h> // IWYU pragma: export
47+
#include <fcntl.h> // IWYU pragma: export
48+
#include <sys/types.h> // IWYU pragma: export
4949
#endif
5050

5151
// clang-format on

src/libbson/src/bson/bson-context-private.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
#ifndef BSON_CONTEXT_PRIVATE_H
2121
#define BSON_CONTEXT_PRIVATE_H
2222

23+
#include <bson/bson-context.h> // IWYU pragma: export
2324

24-
#include <common-thread-private.h>
25+
//
2526

26-
#include <bson/bson-context.h>
27+
#include <common-thread-private.h>
2728

2829

2930
BSON_BEGIN_DECLS

src/libbson/src/bson/bson-error-private.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
#ifndef BSON_ERROR_PRIVATE_H
2020
#define BSON_ERROR_PRIVATE_H
2121

22-
#include <bson/error.h>
22+
#include <bson/error.h> // IWYU pragma: export
23+
24+
//
25+
2326
#include <bson/macros.h>
2427

2528

src/libbson/src/bson/bson-json-private.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#ifndef BSON_JSON_PRIVATE_H
2020
#define BSON_JSON_PRIVATE_H
2121

22+
#include <bson/bson-json.h> // IWYU pragma: export
2223

2324
struct _bson_json_opts_t {
2425
bson_json_mode_t mode;

src/libbson/src/bson/bson-vector-private.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
#ifndef BSON_VECTOR_PRIVATE_H
2020
#define BSON_VECTOR_PRIVATE_H
2121

22+
#include <bson/bson-vector.h> // IWYU pragma: export
23+
24+
//
25+
2226
#include <bson/compat.h>
2327
#include <bson/macros.h>
2428

src/libbson/src/bson/bson-vector.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#define BSON_VECTOR_H
2121

2222
#include <bson/bson-endian.h>
23+
#include <bson/bson-types.h>
24+
#include <bson/bson_t.h>
2325
#include <bson/compat.h>
2426
#include <bson/macros.h>
2527

src/libbson/src/bson/bson-writer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include <bson/bson-writer.h>
1919

20-
#include <bson/bson-private.h>
20+
#include <bson/bson_t-private.h>
2121

2222

2323
struct _bson_writer_t {

0 commit comments

Comments
 (0)