Skip to content

Commit 0e0d0aa

Browse files
authored
Fix documentation and add support for CI-ing it (#196)
* Fix documentation and add support for CI-ing it * Soundness cleanup
1 parent df28105 commit 0e0d0aa

11 files changed

+61
-19
lines changed

Sources/NIOExtras/DebugInboundEventsHandler.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
5757
self.logger = logger
5858
}
5959

60-
/// Logs ``Event.registered`` to ``logger``
60+
/// Logs ``Event/registered`` to `logger`
6161
/// Called when the `Channel` has successfully registered with its `EventLoop` to handle I/O.
6262
/// - parameters:
6363
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -66,7 +66,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
6666
context.fireChannelRegistered()
6767
}
6868

69-
/// Logs ``Event.unregistered`` to ``logger``
69+
/// Logs ``Event/unregistered`` to `logger`
7070
/// Called when the `Channel` has unregistered from its `EventLoop`, and so will no longer be receiving I/O events.
7171
/// - parameters:
7272
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -75,7 +75,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
7575
context.fireChannelUnregistered()
7676
}
7777

78-
/// Logs ``Event.active`` to ``logger``
78+
/// Logs ``Event/active`` to `logger`
7979
/// Called when the `Channel` has become active, and is able to send and receive data.
8080
/// - parameters:
8181
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -84,7 +84,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
8484
context.fireChannelActive()
8585
}
8686

87-
/// Logs ``Event.inactive`` to ``logger``
87+
/// Logs ``Event/inactive`` to `logger`
8888
/// Called when the `Channel` has become inactive and is no longer able to send and receive data`.
8989
/// - parameters:
9090
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -93,7 +93,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
9393
context.fireChannelInactive()
9494
}
9595

96-
/// Logs ``Event.read`` to ``logger``
96+
/// Logs ``Event/read(data:)`` to `logger`
9797
/// Called when some data has been read from the remote peer.
9898
/// - parameters:
9999
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -103,7 +103,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
103103
context.fireChannelRead(data)
104104
}
105105

106-
/// Logs ``Event.readComplete`` to ``logger``
106+
/// Logs ``Event/readComplete`` to `logger`
107107
/// Called when the `Channel` has completed its current read loop, either because no more data is available
108108
/// to read from the transport at this time, or because the `Channel` needs to yield to the event loop to process
109109
/// other I/O events for other `Channel`s.
@@ -114,7 +114,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
114114
context.fireChannelReadComplete()
115115
}
116116

117-
/// Logs ``Event.writabilityChanged`` to ``logger``
117+
/// Logs ``Event/writabilityChanged(isWritable:)`` to `logger`
118118
/// The writability state of the `Channel` has changed, either because it has buffered more data than the writability
119119
/// high water mark, or because the amount of buffered data has dropped below the writability low water mark.
120120
/// - parameters:
@@ -124,7 +124,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
124124
context.fireChannelWritabilityChanged()
125125
}
126126

127-
/// Logs ``Event.userInboundEventTriggered`` to ``logger``
127+
/// Logs ``Event/userInboundEventTriggered(event:)`` to `logger`
128128
/// Called when a user inbound event has been triggered.
129129
/// - parameters:
130130
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -134,7 +134,7 @@ public class DebugInboundEventsHandler: ChannelInboundHandler {
134134
context.fireUserInboundEventTriggered(event)
135135
}
136136

137-
/// Logs ``Event.errorCaught`` to ``logger``
137+
/// Logs ``Event/errorCaught(_:)`` to `logger`
138138
/// An error was encountered earlier in the inbound `ChannelPipeline`.
139139
/// - parameters:
140140
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.

Sources/NIOExtras/DebugOutboundEventsHandler.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
5757
self.logger = logger
5858
}
5959

60-
/// Logs ``Event.register`` to ``logger``
60+
/// Logs ``Event/register`` to `logger`
6161
/// Called to request that the `Channel` register itself for I/O events with its `EventLoop`.
6262
/// - parameters:
6363
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -67,7 +67,7 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
6767
context.register(promise: promise)
6868
}
6969

70-
/// Logs ``Event.bind`` to ``logger``
70+
/// Logs ``Event/bind(address:)`` to `logger`
7171
/// Called to request that the `Channel` bind to a specific `SocketAddress`.
7272
/// - parameters:
7373
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -78,7 +78,7 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
7878
context.bind(to: address, promise: promise)
7979
}
8080

81-
/// Logs ``Event.connect`` to ``logger``
81+
/// Logs ``Event/connect(address:)`` to `logger`
8282
/// Called to request that the `Channel` connect to a given `SocketAddress`.
8383
/// - parameters:
8484
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -89,7 +89,7 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
8989
context.connect(to: address, promise: promise)
9090
}
9191

92-
/// Logs ``Event.data`` to ``logger``
92+
/// Logs ``Event/write(data:)`` to `logger`
9393
/// Called to request a write operation.
9494
/// - parameters:
9595
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -100,7 +100,7 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
100100
context.write(data, promise: promise)
101101
}
102102

103-
/// Logs ``Event.flush`` to ``logger``
103+
/// Logs ``Event/flush`` to `logger`
104104
/// Called to request that the `Channel` flush all pending writes. The flush operation will try to flush out all previous written messages
105105
/// that are pending.
106106
/// - parameters:
@@ -110,7 +110,7 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
110110
context.flush()
111111
}
112112

113-
/// Logs ``Event.read`` to ``logger``
113+
/// Logs ``Event/read`` to `logger`
114114
/// Called to request that the `Channel` perform a read when data is ready. The read operation will signal that we are ready to read more data.
115115
/// - parameters:
116116
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -119,7 +119,7 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
119119
context.read()
120120
}
121121

122-
/// Logs ``Event.close`` to ``logger``
122+
/// Logs ``Event/close(mode:)`` to `logger`
123123
/// Called to request that the `Channel` close itself down`.
124124
/// - parameters:
125125
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.
@@ -130,7 +130,7 @@ public class DebugOutboundEventsHandler: ChannelOutboundHandler {
130130
context.close(mode: mode, promise: promise)
131131
}
132132

133-
/// Logs ``Event.triggerUserOutboundEvent`` to ``logger``
133+
/// Logs ``Event/triggerUserOutboundEvent(event:)`` to `logger`
134134
/// Called when an user outbound event is triggered.
135135
/// - parameters:
136136
/// - context: The `ChannelHandlerContext` which this `ChannelHandler` belongs to.

Sources/NIOExtras/HTTP1ProxyConnectHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public final class NIOHTTP1ProxyConnectHandler: ChannelDuplexHandler, RemovableC
260260
}
261261
}
262262

263-
/// Error types for ``HTTP1ProxyConnectHandler``
263+
/// Error types for ``NIOHTTP1ProxyConnectHandler``
264264
public struct Error: Swift.Error {
265265
fileprivate enum Details {
266266
case proxyAuthenticationRequired

Tests/NIOExtrasTests/RequestResponseWithIDHandlerTest+XCTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the SwiftNIO open source project
44
//
5-
// Copyright (c) 2018-2022 Apple Inc. and the SwiftNIO project authors
5+
// Copyright (c) 2018-2023 Apple Inc. and the SwiftNIO project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information

docker/docker-compose.2004.55.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ services:
99
ubuntu_version: "focal"
1010
swift_version: "5.5"
1111

12+
documentation-check:
13+
image: swift-nio-extras:20.04-5.5
14+
1215
test:
1316
image: swift-nio-extras:20.04-5.5
1417

docker/docker-compose.2004.56.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ services:
99
ubuntu_version: "focal"
1010
swift_version: "5.6"
1111

12+
documentation-check:
13+
image: swift-nio-extras:20.04-5.6
14+
1215
test:
1316
image: swift-nio-extras:20.04-5.6
1417

docker/docker-compose.2204.57.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ services:
99
ubuntu_version: "jammy"
1010
swift_version: "5.7"
1111

12+
documentation-check:
13+
image: swift-nio-extras:22.04-5.7
14+
1215
test:
1316
image: swift-nio-extras:22.04-5.7
1417

docker/docker-compose.2204.58.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ services:
1313
environment:
1414
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
1515

16+
documentation-check:
17+
image: swift-nio-extras:22.04-5.8
18+
1619
shell:
1720
image: swift-nio-extras:22.04-5.8

docker/docker-compose.2204.main.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ services:
1313
environment:
1414
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
1515

16+
documentation-check:
17+
image: swift-nio-extras:22.04-main
18+
1619
shell:
1720
image: swift-nio-extras:22.04-main

docker/docker-compose.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ services:
2626
<<: *common
2727
command: /bin/bash -xcl "./scripts/soundness.sh"
2828

29+
documentation-check:
30+
<<: *common
31+
command: /bin/bash -xcl "./scripts/check-docs.sh"
32+
2933
test:
3034
<<: *common
3135
command: /bin/bash -xcl "cat /etc/lsb-release && swift -version && swift test -Xswiftc -warnings-as-errors --enable-test-discovery $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-}"

0 commit comments

Comments
 (0)