Skip to content

remove umbrella NIO imports and add soundness check #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ httpClient.execute(request: request, deadline: .now() + .milliseconds(1))
### Streaming
When dealing with larger amount of data, it's critical to stream the response body instead of aggregating in-memory. Handling a response stream is done using a delegate protocol. The following example demonstrates how to count the number of bytes in a streaming response body:
```swift
import NIO
import NIOCore
import NIOHTTP1

class CountingDelegate: HTTPClientResponseDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
//===----------------------------------------------------------------------===//

import Logging
import NIO
import NIOConcurrencyHelpers
import NIOCore
import NIOHTTP1

extension HTTPConnectionPool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore

extension HTTPConnectionPool {
struct HTTP1StateMachine {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//

import NIO
import NIOCore
import NIOHTTP1

extension HTTPConnectionPool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
//===----------------------------------------------------------------------===//

@testable import AsyncHTTPClient
import NIO
import NIOCore
import NIOEmbedded
import NIOHTTP1
import NIOPosix
import XCTest

class HTTPConnectionPool_HTTP1StateMachineTests: XCTestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
//===----------------------------------------------------------------------===//

@testable import AsyncHTTPClient
import NIO
import NIOCore
import NIOHTTP1
import NIOPosix
import XCTest

class HTTPConnectionPool_ManagerTests: XCTestCase {
Expand Down
2 changes: 1 addition & 1 deletion Tests/AsyncHTTPClientTests/Mocks/MockConnectionPool.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@testable import AsyncHTTPClient
import Logging
import NIO
import NIOCore
import NIOHTTP1
import NIOSSL

Expand Down
2 changes: 1 addition & 1 deletion Tests/AsyncHTTPClientTests/Mocks/MockRequestQueuer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@testable import AsyncHTTPClient
import Logging
import NIO
import NIOCore
import NIOHTTP1

/// A mock request queue (not creating any timers) that is used to validate
Expand Down
9 changes: 9 additions & 0 deletions scripts/soundness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,12 @@ EOF
done

rm "$tmp"

# This checks for the umbrella NIO module.
printf "=> Checking for imports of umbrella NIO module... "
if git grep --color=never -i "^[ \t]*import \+NIO[ \t]*$" > /dev/null; then
printf "\033[0;31mUmbrella imports found.\033[0m\n"
git grep -i "^[ \t]*import \+NIO[ \t]*$"
exit 1
fi
printf "\033[0;32mokay.\033[0m\n"