Skip to content

Commit 335848d

Browse files
authored
Fix mdformat check (#1790)
1 parent ca0ee29 commit 335848d

File tree

25 files changed

+148
-155
lines changed

25 files changed

+148
-155
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
stages: [manual]
2424

2525
- repo: https://github.com/executablebooks/mdformat
26-
rev: 0.7.18
26+
rev: 0.7.22
2727
hooks:
2828
- id: mdformat
2929
args: ["--wrap=120", "--number"]
@@ -32,7 +32,7 @@ repos:
3232
- mdformat-frontmatter
3333
- mdformat-gfm
3434
- mdformat-gfm-alerts
35-
- mdformat-mkdocs~=3.0
35+
- mdformat-mkdocs
3636

3737
- repo: local
3838
hooks:
@@ -55,7 +55,7 @@ repos:
5555
rev: v3.12.2
5656
hooks:
5757
- id: markdown-link-check
58-
args: ["-c", "markdown_link_config.json"]
58+
args: ["-q", "-c", "markdown_link_config.json"]
5959

6060
- repo: https://github.com/rstcheck/rstcheck
6161
rev: v6.2.0

source/auth/auth.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -922,18 +922,18 @@ else // the valid host string contains no periods and is not "aws.amazonaws.com"
922922
923923
Examples are provided below.
924924
925-
| Host | Region | Notes |
926-
| ------------------------------ | ---------- | ------------------------------------------------ |
927-
| sts.amazonaws.com | us-east-1 | the host is "sts.amazonaws.com"; use `us-east-1` |
928-
| sts.us-west-2.amazonaws.com | us-west-2 | use the second label |
929-
| sts.us-west-2.amazonaws.com.ch | us-west-2 | use the second label |
930-
| example.com | com | use the second label |
931-
| localhost | us-east-1 | no "`.`" character; use the default region |
932-
| sts..com | \< Error > | second label is empty |
933-
| .amazonaws.com | \< Error > | starts with a period |
934-
| sts.amazonaws. | \< Error > | ends with a period |
935-
| "" | \< Error > | empty string |
936-
| "string longer than 255" | \< Error > | string longer than 255 bytes |
925+
| Host | Region | Notes |
926+
| ------------------------------ | --------- | ------------------------------------------------ |
927+
| sts.amazonaws.com | us-east-1 | the host is "sts.amazonaws.com"; use `us-east-1` |
928+
| sts.us-west-2.amazonaws.com | us-west-2 | use the second label |
929+
| sts.us-west-2.amazonaws.com.ch | us-west-2 | use the second label |
930+
| example.com | com | use the second label |
931+
| localhost | us-east-1 | no "`.`" character; use the default region |
932+
| sts..com | < Error > | second label is empty |
933+
| .amazonaws.com | < Error > | starts with a period |
934+
| sts.amazonaws. | < Error > | ends with a period |
935+
| "" | < Error > | empty string |
936+
| "string longer than 255" | < Error > | string longer than 255 bytes |
937937
938938
#### [MongoCredential](#mongocredential) Properties
939939

source/benchmarking/benchmarking.md

+30-30
Large diffs are not rendered by default.

source/bson-binary-encrypted/binary-encrypted.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ struct {
7878
| ------------------ | ------------------------------------------------------------------- |
7979
| **Name** | **Description** |
8080
| subtype | Type of blob format and encryption algorithm used. |
81-
| key_uuid\[16\] | The value of \_id for the key used to decrypt the ciphertext. |
81+
| key_uuid[16] | The value of \_id for the key used to decrypt the ciphertext. |
8282
| original_bson_type | The byte representing the original BSON type of the encrypted data. |
83-
| ciphertext\[\] | The encrypted ciphertext (includes IV prepended). |
83+
| ciphertext[] | The encrypted ciphertext (includes IV prepended). |
8484

8585
## Test Plan
8686

source/bson-binary-vector/bson-binary-vector.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Each vector can take one of multiple data types (dtypes). The following table li
3535
| ---------------- | ---------- | ----------------------- | ----------------------------------------------------------------------------------------- |
3636
| `0x03` | INT8 | 8 | INT8 |
3737
| `0x27` | FLOAT32 | 32 | FLOAT |
38-
| `0x10` | PACKED_BIT | 1 `*` | BOOL |
38+
| `0x10` | PACKED_BIT | 1 `*` | BOOL |
3939

4040
`*` A Binary Quantized (PACKED_BIT) Vector is a vector of 0s and 1s (bits), but it is represented in memory as a list of
41-
integers in \[0, 255\]. So, for example, the vector `[0, 255]` would be shorthand for the 16-bit vector
41+
integers in [0, 255]. So, for example, the vector `[0, 255]` would be shorthand for the 16-bit vector
4242
`[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]`. The idea is that each number (a uint8) can be stored as a single byte. Of course,
4343
some languages, Python for one, do not have an uint8 type, so must be represented as an int in memory, but not on disk.
4444

@@ -182,8 +182,8 @@ End Function
182182

183183
Drivers MUST validate vector metadata and raise an error if any invariant is violated:
184184

185-
- Padding MUST be 0 for all dtypes where padding doesn’t apply, and MUST be within \[0, 7\] for PACKED_BIT.
186-
- A PACKED_BIT vector MUST NOT be empty if padding is in the range \[1, 7\].
185+
- Padding MUST be 0 for all dtypes where padding doesn’t apply, and MUST be within [0, 7] for PACKED_BIT.
186+
- A PACKED_BIT vector MUST NOT be empty if padding is in the range [1, 7].
187187
- For a PACKED_BIT vector, ignored bits must be zero.
188188
- When unpacking binary data into a FLOAT32 Vector structure, the length of the binary data following the dtype and
189189
padding MUST be a multiple of 4 bytes.

source/change-streams/tests/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Each YAML file has the following keys:
5656
The definition of MATCH or MATCHES in the Spec Test Runner is as follows:
5757

5858
- MATCH takes two values, `expected` and `actual`
59-
- Notation is "Assert \[actual\] MATCHES \[expected\]
59+
- Notation is "Assert [actual] MATCHES [expected]
6060
- Assertion passes if `expected` is a subset of `actual`, with the value `42` acting as placeholders for "any value"
6161

6262
Pseudocode implementation of `actual` MATCHES `expected`:
@@ -167,7 +167,7 @@ and sharded clusters unless otherwise specified:
167167

168168
1. `ChangeStream` must continuously track the last seen `resumeToken`
169169

170-
2. `ChangeStream` will throw an exception if the server response is missing the resume token (if wire version is \< 8,
170+
2. `ChangeStream` will throw an exception if the server response is missing the resume token (if wire version is < 8,
171171
this is a driver-side error; for 8+, this is a server-side error)
172172

173173
3. After receiving a `resumeToken`, `ChangeStream` will automatically resume one time on a resumable error with the

source/client-side-encryption/tests/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ mongocryptd is released alongside the server. mongocryptd is available in versio
317317
Drivers MUST run all tests with mongocryptd on at least one platform for all tested server versions.
318318

319319
Drivers MUST run all tests with [crypt_shared](../client-side-encryption.md#crypt_shared) on at least one platform for
320-
all tested server versions. For server versions \< 6.0, drivers MUST test with the latest major release of
320+
all tested server versions. For server versions < 6.0, drivers MUST test with the latest major release of
321321
[crypt_shared](../client-side-encryption.md#crypt_shared). Using the latest major release of
322322
[crypt_shared](../client-side-encryption.md#crypt_shared) is supported with older server versions.
323323

source/collation/collation.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ and sorting on language strings in a locale-aware fashion.
1212

1313
A driver MUST support a Collation option for each of the relevant operations in server versions >= 3.4 (maxWireVersion
1414
5\) and MUST throw an error if a user supplies a Collation option for the operation and the selected server has
15-
maxWireVersion \< 5 or if the user is using opcode-based unacknowledged writes.
15+
maxWireVersion < 5 or if the user is using opcode-based unacknowledged writes.
1616

1717
The CRUD and Index Management specs include the collation option in descriptions of API elements where it is supported.
1818
This document provides more details on the specific driver behavior required to handle the collation option.
@@ -43,7 +43,7 @@ gains.
4343
Server versions earlier than 3.4 don't always throw an error if an unknown option is supplied to certain operations.
4444
Because a Collation defines how documents are matched and sorted for both read and write operations, behavior
4545
differences between server versions are significant. Drivers therefore MUST throw an error if a user specifies a
46-
Collation and the selected server has a maxWireVersion \< 5 or if using opcode-based unacknowledged writes.
46+
Collation and the selected server has a maxWireVersion < 5 or if using opcode-based unacknowledged writes.
4747

4848
## Specification
4949

@@ -140,7 +140,7 @@ hinting an index. See the [Index Management specification](../index-management/i
140140
### Require maxWireVersion 5
141141

142142
Drivers MUST require the server's maxWireVersion >= 5 to support Collations. When a collation is explicitly specified
143-
for a server with maxWireVersion \< 5, the driver MUST raise an error.
143+
for a server with maxWireVersion < 5, the driver MUST raise an error.
144144

145145
### Opcode-based Unacknowledged Writes
146146

@@ -160,7 +160,7 @@ db.command({
160160

161161
### BulkWrite API
162162

163-
If maxWireVersion \< 5, the driver MUST inspect each BulkWrite operation model for a collation and MUST raise an error
163+
If maxWireVersion < 5, the driver MUST inspect each BulkWrite operation model for a collation and MUST raise an error
164164
and MUST NOT send any operations to the server if a collation is explicitly specified on an operation. For example, the
165165
user will provide BulkWrite operation models as in the following example:
166166

@@ -178,7 +178,7 @@ db.collection.bulkWrite([
178178
]);
179179
```
180180

181-
The driver must inspect each operation for a Collation if maxWireVersion is \< 5 and fail the entire bulkWrite if a
181+
The driver must inspect each operation for a Collation if maxWireVersion is < 5 and fail the entire bulkWrite if a
182182
collation was explicitly specified. In the example above, that means even the insertOne (without Collation) MUST NOT be
183183
sent.
184184

@@ -192,7 +192,7 @@ custom name must be provided for one of them. Then, the test should ensure that
192192
delete_one is called with an index name.
193193

194194
Drivers should also test that errors are raised in each place Collation can be provided to a API method and the selected
195-
server has maxWireVersion \< 5.
195+
server has maxWireVersion < 5.
196196

197197
## Backwards Compatibility
198198

source/command-logging-and-monitoring/command-logging-and-monitoring.md

+8-13
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,11 @@ penalties, particularly when event listeners are introduced.
449449
- 2024-09-11: Migrated from reStructuredText to Markdown.
450450

451451
- 2015-09-16: Removed `limit` from find test with options to support 3.2.\
452-
Changed find test read preference to
453-
`primaryPreferred`.
452+
Changed find test read preference to `primaryPreferred`.
454453

455454
- 2015-10-01: Changed find test with a kill cursors to not run on server versions\
456-
greater than 3.0. Added a find test
457-
with no kill cursors command which only runs on 3.1 and higher. Added notes on which tests should run based on
458-
server versions.
455+
greater than 3.0. Added a find test with no kill cursors command which only runs on 3.1 and higher. Added notes on
456+
which tests should run based on server versions.
459457

460458
- 2015-10-19: Changed batchSize in the 3.2 find tests to expect the remaining value.
461459

@@ -478,12 +476,11 @@ penalties, particularly when event listeners are introduced.
478476
- 2021-05-05: Updated to use hello and legacy hello.
479477

480478
- 2021-08-30: Added `serverConnectionId` field to `CommandStartedEvent`,\
481-
`CommandSucceededEvent` and
482-
`CommandFailedEvent`.
479+
`CommandSucceededEvent` and `CommandFailedEvent`.
483480

484481
- 2022-05-18: Converted legacy tests to the unified test format.
485482

486-
- 2022-09-02: Remove material that only applies to MongoDB versions \< 3.6.
483+
- 2022-09-02: Remove material that only applies to MongoDB versions < 3.6.
487484

488485
- 2022-10-05: Remove spec front matter and reformat changelog.
489486

@@ -492,14 +489,12 @@ penalties, particularly when event listeners are introduced.
492489
- 2022-11-16: Update sensitive command tests to only run on server versions where the commands are supported.
493490

494491
- 2022-12-13: Updated log message `serverPort` field description to clarify drivers should populate it with the\
495-
default
496-
port 27017 when relevant. Updated suggested unstructured forms of log messages to more clearly label connection IDs
497-
and use more readable server address representations.
492+
default port 27017 when relevant. Updated suggested unstructured forms of log messages to more clearly label
493+
connection IDs and use more readable server address representations.
498494

499495
- 2023-03-23: Updated `serverConnectionId` field to be Int64 as long-running servers can return Int64.
500496

501497
- 2023-06-13: Added `databaseName` field to `CommandFailedEvent` and `CommandSucceededEvent`.\
502-
Updated suggested
503-
unstructured forms of log messages reflecting the changes.
498+
Updated suggested unstructured forms of log messages reflecting the changes.
504499

505500
- 2023-10-19: Add Q&A section

source/compression/OP_COMPRESSED.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Abstract
88

9-
This specification describes how to implement Wire Protocol Compression between MongoDB drivers and mongo\[d|s\].
9+
This specification describes how to implement Wire Protocol Compression between MongoDB drivers and mongo[d|s].
1010

1111
Compression is achieved through a new bi-directional wire protocol opcode, referred to as OP_COMPRESSED.
1212

@@ -278,7 +278,7 @@ normally.
278278
{"t":{"$date":"2021-04-20T09:57:26.825-06:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn5","msg":"Slow query","attr":{"type":"command","ns":"admin.$cmd","command":{"hello":1,"client":{"driver":{"name":"mongo-csharp-driver","version":"2.12.2.0"},"os":{"type":"macOS","name":"Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64","architecture":"x86_64","version":"19.6.0"},"platform":".NET 5.0.3"},"compression":[],"$readPreference":{"mode":"secondaryPreferred"},"$db":"admin"},"numYields":0,"reslen":319,"locks":{},"remote":"127.0.0.1:54372","protocol":"op_query","durationMillis":1}}
279279
```
280280

281-
e.g., empty compression: \[\] array. No operations should have been compressed.
281+
e.g., empty compression: [] array. No operations should have been compressed.
282282

283283
The results of the program should have been:
284284

source/connection-monitoring-and-pooling/connection-monitoring-and-pooling.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ encountered, such a [Connection](#connection) MUST be closed (as described in
553553
list of available [Connections](#connection) is exhausted.
554554

555555
If the list is exhausted, the total number of [Connections](#connection) is less than maxPoolSize, and
556-
pendingConnectionCount \< maxConnecting, the pool MUST create a [Connection](#connection), establish it, mark it as "in
556+
pendingConnectionCount < maxConnecting, the pool MUST create a [Connection](#connection), establish it, mark it as "in
557557
use" and return it. If totalConnectionCount == maxPoolSize or pendingConnectionCount == maxConnecting, then the pool
558558
MUST wait to service the request until neither of those two conditions are met or until a [Connection](#connection)
559559
becomes available, re-entering the checkOut loop in either case. This waiting MUST NOT prevent

source/crud/crud.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -2274,8 +2274,8 @@ a read preference for the operation. As of `featureCompatibilityVersion` 4.4, se
22742274
`$out` or `$merge`. Since drivers do not track `featureCompatibilityVersion`, the decision to consider a read preference
22752275
for such a pipeline will depend on the wire version(s) of the server(s) to which the driver is connected.
22762276
2277-
If there are one or more available servers and one or more of those servers is pre-5.0 (i.e. wire version \< 13),
2278-
drivers MUST NOT use the available read preference and MUST instead select a server using a primary read preference.
2277+
If there are one or more available servers and one or more of those servers is pre-5.0 (i.e. wire version < 13), drivers
2278+
MUST NOT use the available read preference and MUST instead select a server using a primary read preference.
22792279
22802280
Otherwise, if there are either no available servers, all available servers are 5.0+ (i.e. wire version >= 13), or the
22812281
topology type is LoadBalanced (we can assume the backing mongos is 5.0+), drivers MUST use the available read
@@ -2438,11 +2438,10 @@ able to be used as this change is non-backwards breaking. Any driver which imple
24382438
deprecate it and drivers that have not built it should not do so.
24392439
24402440
Q: Should drivers offer explain helpers?\
2441-
Originally, it was determined that explain should not be exposed via
2442-
specialized APIs in drivers because it it was deemed to be an unusual use-case for a driver. We'd like users to use the
2443-
shell for this purpose. However, explain is still possible from a driver. Some drivers have historically provided
2444-
explain helpers and continue to do so. Drivers that do not offer explain helpers can run explain commands using the
2445-
runCommand API.
2441+
Originally, it was determined that explain should not be exposed via specialized APIs in drivers because it it was
2442+
deemed to be an unusual use-case for a driver. We'd like users to use the shell for this purpose. However, explain is
2443+
still possible from a driver. Some drivers have historically provided explain helpers and continue to do so. Drivers
2444+
that do not offer explain helpers can run explain commands using the runCommand API.
24462445
24472446
Q: What about explain?
24482447
@@ -2482,7 +2481,7 @@ release.
24822481
Q: Where is `singleBatch` in FindOptions?
24832482
24842483
Drivers have historically allowed users to request a single batch of results (after which the cursor is closed) by
2485-
specifying a negative value for the `limit` option. For servers \< 3.2, a single batch may be requested by specifying a
2484+
specifying a negative value for the `limit` option. For servers < 3.2, a single batch may be requested by specifying a
24862485
negative value in the `numberToReturn` wire protocol field. For servers >= 3.2, the `find` command defines `limit` as a
24872486
non-negative integer option but introduces a `singleBatch` boolean option. Rather than introduce a `singleBatch` option
24882487
to FindOptions, the spec preserves the existing API for `limit` and instructs drivers to convert negative values
@@ -2575,7 +2574,7 @@ aforementioned allowance in the SemVer spec.
25752574
25762575
- 2020-01-10: Clarify client-side error reporting for unsupported options
25772576
2578-
- 2020-01-10: Error if hint specified for unacknowledged update using OP_UPDATE or OP_MSG for servers \< 4.2
2577+
- 2020-01-10: Error if hint specified for unacknowledged update using OP_UPDATE or OP_MSG for servers < 4.2
25792578
25802579
- 2019-10-28: Removed link to old language examples.
25812580

source/crud/tests/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Using a 4.0+ server, set the following failpoint:
4242
Then, perform an insert operation and assert that a WriteConcernError occurs and that its `details` property is both
4343
accessible and matches the `errInfo` object from the failpoint.
4444

45-
### 2. WriteError.details exposes writeErrors\[\].errInfo
45+
### 2. WriteError.details exposes writeErrors[].errInfo
4646

4747
Test that `writeErrors[].errInfo` in a command response is propagated as `WriteError.details` (or equivalent) in the
4848
driver.

0 commit comments

Comments
 (0)