diff --git a/Sources/GRPCCodeGen/CodeGenerationRequest.swift b/Sources/GRPCCodeGen/CodeGenerationRequest.swift index 55cdb679a..ae12f7975 100644 --- a/Sources/GRPCCodeGen/CodeGenerationRequest.swift +++ b/Sources/GRPCCodeGen/CodeGenerationRequest.swift @@ -442,7 +442,7 @@ public struct MethodName: Hashable { /// The name as used as a property. /// - /// This value typically starts with an lowercase character, for example "get". + /// This value typically starts with a lowercase character, for example "get". public var functionName: String public init(identifyingName: String, typeName: String, functionName: String) { diff --git a/Sources/GRPCCodeGen/Internal/Renderer/TextBasedRenderer.swift b/Sources/GRPCCodeGen/Internal/Renderer/TextBasedRenderer.swift index 3cfb4a2dd..cd7c34728 100644 --- a/Sources/GRPCCodeGen/Internal/Renderer/TextBasedRenderer.swift +++ b/Sources/GRPCCodeGen/Internal/Renderer/TextBasedRenderer.swift @@ -43,7 +43,7 @@ final class StringCodeWriter { internal let indentation: Int /// Whether the next call to `writeLine` will continue writing to the last - /// stored line. Otherwise a new line is appended. + /// stored line. Otherwise, a new line is appended. private var nextWriteAppendsToLastLine: Bool = false /// Creates a new empty writer. diff --git a/Sources/GRPCCodeGen/Internal/Translator/ServerCodeTranslator.swift b/Sources/GRPCCodeGen/Internal/Translator/ServerCodeTranslator.swift index 3de95fdc1..34b913e9d 100644 --- a/Sources/GRPCCodeGen/Internal/Translator/ServerCodeTranslator.swift +++ b/Sources/GRPCCodeGen/Internal/Translator/ServerCodeTranslator.swift @@ -206,7 +206,7 @@ struct ServerCodeTranslator { /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and /// trailing response metadata. If you don't need these then consider using - /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// the ``SimpleServiceProtocol``. If you need fine-grained control over your RPCs then /// use ``StreamingServiceProtocol``. """ } diff --git a/Sources/GRPCCore/Call/Client/CallOptions.swift b/Sources/GRPCCore/Call/Client/CallOptions.swift index 68a36a9e6..9cfcb6220 100644 --- a/Sources/GRPCCore/Call/Client/CallOptions.swift +++ b/Sources/GRPCCore/Call/Client/CallOptions.swift @@ -40,7 +40,7 @@ public struct CallOptions: Sendable { /// Whether RPCs for this method should wait until the connection is ready. /// /// If `false` the RPC will abort immediately if there is a transient failure connecting to - /// the server. Otherwise gRPC will attempt to connect until the deadline is exceeded. + /// the server. Otherwise, gRPC will attempt to connect until the deadline is exceeded. public var waitForReady: Bool? /// The maximum allowed payload size in bytes for an individual request message. diff --git a/Sources/GRPCCore/Call/Client/ClientResponse.swift b/Sources/GRPCCore/Call/Client/ClientResponse.swift index 23ec38546..fc6ad3386 100644 --- a/Sources/GRPCCore/Call/Client/ClientResponse.swift +++ b/Sources/GRPCCore/Call/Client/ClientResponse.swift @@ -140,7 +140,7 @@ public struct ClientResponse: Sendable { /// /// A stream response captures every part of the response stream over time and distinguishes /// accepted and rejected requests via the ``accepted`` property. An "accepted" request is one -/// where the the server responds with initial metadata and attempts to process the request. A +/// where the server responds with initial metadata and attempts to process the request. A /// "rejected" request is one where the server responds with a status as the first and only /// response part and doesn't process the request body. /// diff --git a/Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor+RetryExecutor.swift b/Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor+RetryExecutor.swift index bb4eb4bc7..19c35b3f3 100644 --- a/Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor+RetryExecutor.swift +++ b/Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor+RetryExecutor.swift @@ -288,7 +288,7 @@ extension ClientRPCExecutor.RetryExecutor { // subscriber and maximises the chances that 'isKnownSafeForNextSubscriber' will // return true. // - // Note: this must only be called if we should retry, otherwise we may cancel a + // Note: this must only be called if we should retry; otherwise, we may cancel a // subscriber for an accepted request. retryStream.invalidateAllSubscriptions() diff --git a/Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor.swift b/Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor.swift index f7e41fad9..04f5254bf 100644 --- a/Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor.swift +++ b/Sources/GRPCCore/Call/Client/Internal/ClientRPCExecutor.swift @@ -112,7 +112,7 @@ extension ClientRPCExecutor { /// - deserializer: A deserializer to convert bytes to output messages. /// - interceptors: An array of interceptors which the request and response pass through. The /// interceptors will be called in the order of the array. - /// - stream: The stream to excecute the RPC on. + /// - stream: The stream to execute the RPC on. /// - Returns: The deserialized response. @inlinable // would be private static func _execute( diff --git a/Sources/GRPCCore/Call/Client/Internal/ClientResponse+Convenience.swift b/Sources/GRPCCore/Call/Client/Internal/ClientResponse+Convenience.swift index 41c3d0244..14ec4ade8 100644 --- a/Sources/GRPCCore/Call/Client/Internal/ClientResponse+Convenience.swift +++ b/Sources/GRPCCore/Call/Client/Internal/ClientResponse+Convenience.swift @@ -87,7 +87,7 @@ extension StreamingClientResponse { /// Creates a streaming response from the given status and metadata. /// /// If the ``Status`` has code ``Status/Code-swift.struct/ok`` then an accepted stream is created - /// containing only the provided metadata. Otherwise a failed response is returned with an error + /// containing only the provided metadata. Otherwise, a failed response is returned with an error /// created from the status and metadata. /// /// - Parameters: diff --git a/Sources/GRPCCore/Call/Client/Internal/ClientStreamExecutor.swift b/Sources/GRPCCore/Call/Client/Internal/ClientStreamExecutor.swift index 74aac103f..44cece2c0 100644 --- a/Sources/GRPCCore/Call/Client/Internal/ClientStreamExecutor.swift +++ b/Sources/GRPCCore/Call/Client/Internal/ClientStreamExecutor.swift @@ -26,7 +26,7 @@ internal enum ClientStreamExecutor { /// - attempt: The attempt number for the RPC that will be executed. /// - serializer: A request serializer. /// - deserializer: A response deserializer. - /// - stream: The stream to excecute the RPC on. + /// - stream: The stream to execute the RPC on. /// - Returns: A streamed response. @inlinable static func execute( diff --git a/Sources/GRPCCore/Configuration/MethodConfig.swift b/Sources/GRPCCore/Configuration/MethodConfig.swift index 3decbfe58..65901a08c 100644 --- a/Sources/GRPCCore/Configuration/MethodConfig.swift +++ b/Sources/GRPCCore/Configuration/MethodConfig.swift @@ -68,7 +68,7 @@ public struct MethodConfig: Hashable, Sendable { /// Whether RPCs for this method should wait until the connection is ready. /// /// If `false` the RPC will abort immediately if there is a transient failure connecting to - /// the server. Otherwise gRPC will attempt to connect until the deadline is exceeded. + /// the server. Otherwise, gRPC will attempt to connect until the deadline is exceeded. public var waitForReady: Bool? /// The default timeout for the RPC. diff --git a/Sources/GRPCCore/Configuration/ServiceConfig.swift b/Sources/GRPCCore/Configuration/ServiceConfig.swift index a96119f1e..f2ce07793 100644 --- a/Sources/GRPCCore/Configuration/ServiceConfig.swift +++ b/Sources/GRPCCore/Configuration/ServiceConfig.swift @@ -54,7 +54,7 @@ public struct ServiceConfig: Hashable, Sendable { /// /// - Parameters: /// - methodConfig: Per-method configuration. - /// - loadBalancingConfig: Load balancing policies. Clients use the the first supported + /// - loadBalancingConfig: Load balancing policies. Clients use the first supported /// policy when iterating the list in order. /// - retryThrottling: Policy for throttling retries. public init( diff --git a/Sources/GRPCCore/Documentation.docc/Articles/Migration-guide.md b/Sources/GRPCCore/Documentation.docc/Articles/Migration-guide.md index 493061ef8..12b1f1159 100644 --- a/Sources/GRPCCore/Documentation.docc/Articles/Migration-guide.md +++ b/Sources/GRPCCore/Documentation.docc/Articles/Migration-guide.md @@ -325,7 +325,7 @@ let server = GRPCServer( transport: .http2NIOPosix( // Configure the host and port to listen on. address: .ipv4(host: "127.0.0.1", port: 1234), - // Configure TLS here, if your're using it. + // Configure TLS here, if you're using it. transportSecurity: .plaintext, config: .defaults { config in // Change any of the default config in here. diff --git a/Sources/GRPCCore/Documentation.docc/Development/Design.md b/Sources/GRPCCore/Documentation.docc/Development/Design.md index 8175f036f..2dde75b66 100644 --- a/Sources/GRPCCore/Documentation.docc/Development/Design.md +++ b/Sources/GRPCCore/Documentation.docc/Development/Design.md @@ -352,7 +352,7 @@ protocol ServiceName.ClientProtocol { ``` Each method takes a request appropriate for its RPC type, a serializer, a -deserializer, a set of options and a handler for processing the response. The +deserializer, a set of options, and a handler for processing the response. The function doesn't return until the response handler has returned and all resources associated with the RPC have been cleaned up. diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Hello-World/Hello-World.tutorial b/Sources/GRPCCore/Documentation.docc/Tutorials/Hello-World/Hello-World.tutorial index a16c4edb2..065792d8c 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Hello-World/Hello-World.tutorial +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Hello-World/Hello-World.tutorial @@ -71,7 +71,7 @@ @Steps { @Step { - Open `HelloWorld.proto` in to see how the service is defined. + Open `HelloWorld.proto` to see how the service is defined. @Code(name: "HelloWorld.proto", file: "hello-world-sec03-step01.proto") } diff --git a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Route-Guide.tutorial b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Route-Guide.tutorial index c1d8e42b2..b25b46e60 100644 --- a/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Route-Guide.tutorial +++ b/Sources/GRPCCore/Documentation.docc/Tutorials/Route-Guide/Route-Guide.tutorial @@ -346,7 +346,7 @@ following code in. `@main` indicates that the type contains the entry point to the program. In this case, - because `RouteGuide` conforms to `AsyncParseableCommand`, the entry point to our program + because `RouteGuide` conforms to `AsyncParsableCommand`, the entry point to our program is the `run()` method. The `@Flag` annotation marks `server` as a flag to the argument parser so that you can specify `--server` when running the program. diff --git a/Sources/GRPCCore/Internal/Base64.swift b/Sources/GRPCCore/Internal/Base64.swift index 24501f3ab..161fc97f1 100644 --- a/Sources/GRPCCore/Internal/Base64.swift +++ b/Sources/GRPCCore/Internal/Base64.swift @@ -163,7 +163,7 @@ enum Base64 { case (true, 1): throw DecodingError.invalidLength default: - // everythin alright so far + // everything alright so far break } diff --git a/Sources/GRPCCore/Internal/Metadata+GRPC.swift b/Sources/GRPCCore/Internal/Metadata+GRPC.swift index 76c7e459d..70ccec1b3 100644 --- a/Sources/GRPCCore/Internal/Metadata+GRPC.swift +++ b/Sources/GRPCCore/Internal/Metadata+GRPC.swift @@ -93,7 +93,7 @@ extension Metadata { let attoseconds = Int64(remainingMilliseconds) * 1_000_000_000_000_000 self = .retryAfter(Duration(secondsComponent: seconds, attosecondsComponent: attoseconds)) } else { - // Negative or not parseable means stop trying. + // Negative or not parsable means stop trying. // Source: https://github.com/grpc/proposal/blob/0e1807a6e30a1a915c0dcadc873bca92b9fa9720/A6-client-retries.md self = .stopRetrying } diff --git a/Sources/GRPCCore/Internal/String+Extensions.swift b/Sources/GRPCCore/Internal/String+Extensions.swift index dd4d68397..aed0895ed 100644 --- a/Sources/GRPCCore/Internal/String+Extensions.swift +++ b/Sources/GRPCCore/Internal/String+Extensions.swift @@ -36,7 +36,7 @@ extension UInt8 { } extension String.UTF8View { - /// Compares two UTF8 strings as case insensitive ASCII bytes. + /// Compares two UTF8 strings as case-insensitive ASCII bytes. /// /// - Parameter bytes: The string constant in the form of a collection of `UInt8` /// - Returns: Whether the collection contains **EXACTLY** this array or no, but by ignoring case. diff --git a/Sources/GRPCCore/Metadata.swift b/Sources/GRPCCore/Metadata.swift index b3ea93810..53cdab34c 100644 --- a/Sources/GRPCCore/Metadata.swift +++ b/Sources/GRPCCore/Metadata.swift @@ -110,7 +110,7 @@ public struct Metadata: Sendable, Hashable { /// - Parameters: /// - key: The key for the key-value pair. /// - value: The value to be associated to the given key. If it's a binary value, then the associated - /// key must end in "-bin", otherwise, this method will produce an assertion failure. + /// key must end in "-bin"; otherwise, this method will produce an assertion failure. init(key: String, value: Value) { if case .binary = value { assert(key.hasSuffix("-bin"), "Keys for binary values must end in -bin") diff --git a/Sources/GRPCCore/MethodDescriptor.swift b/Sources/GRPCCore/MethodDescriptor.swift index a677ff982..d392dbfbb 100644 --- a/Sources/GRPCCore/MethodDescriptor.swift +++ b/Sources/GRPCCore/MethodDescriptor.swift @@ -26,7 +26,7 @@ public struct MethodDescriptor: Sendable, Hashable { /// The fully qualified method name in the format "package.service/method". /// /// For example, the fully qualified name of the "SayHello" method of the "Greeter" service in - /// "helloworld" package is "helloworld.Greeter/SayHelllo". + /// "helloworld" package is "helloworld.Greeter/SayHello". public var fullyQualifiedMethod: String { "\(self.service)/\(self.method)" } diff --git a/Sources/GRPCCore/RPCError.swift b/Sources/GRPCCore/RPCError.swift index e6baf1d2b..aeff6c776 100644 --- a/Sources/GRPCCore/RPCError.swift +++ b/Sources/GRPCCore/RPCError.swift @@ -210,7 +210,7 @@ extension RPCError.Code { /// The caller does not have permission to execute the specified operation. /// ``permissionDenied`` must not be used for rejections caused by exhausting /// some resource (use ``resourceExhausted`` instead for those errors). - /// ``permissionDenied`` must not be used if the caller can not be identified + /// ``permissionDenied`` must not be used if the caller cannot be identified /// (use ``unauthenticated`` instead for those errors). public static let permissionDenied = Self(code: .permissionDenied) diff --git a/Sources/GRPCCore/Status.swift b/Sources/GRPCCore/Status.swift index 2b85d038f..9bea7f764 100644 --- a/Sources/GRPCCore/Status.swift +++ b/Sources/GRPCCore/Status.swift @@ -230,7 +230,7 @@ extension Status.Code { /// The caller does not have permission to execute the specified operation. /// ``permissionDenied`` must not be used for rejections caused by exhausting /// some resource (use ``resourceExhausted`` instead for those errors). - /// ``permissionDenied`` must not be used if the caller can not be identified + /// ``permissionDenied`` must not be used if the caller cannot be identified /// (use ``unauthenticated`` instead for those errors). public static let permissionDenied = Self(code: .permissionDenied) diff --git a/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift b/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift index c40e01585..3ce4bdd18 100644 --- a/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift +++ b/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift @@ -1575,7 +1575,7 @@ extension _BroadcastSequenceStateMachine { @usableFromInline var nextElementID: _BroadcastSequenceStateMachine.Elements.ID - /// A continuation which which will be resumed when the next element becomes available. + /// A continuation which will be resumed when the next element becomes available. @usableFromInline var continuation: ConsumerContinuation? @@ -1592,7 +1592,7 @@ extension _BroadcastSequenceStateMachine { /// Returns and sets the continuation to `nil` if one exists. /// - /// The next element ID is advanced if a contination exists. + /// The next element ID is advanced if a continuation exists. /// /// - Returns: The continuation, if one existed. @inlinable diff --git a/Sources/GRPCCore/Transport/ClientTransport.swift b/Sources/GRPCCore/Transport/ClientTransport.swift index 89d21e1c3..b145bb036 100644 --- a/Sources/GRPCCore/Transport/ClientTransport.swift +++ b/Sources/GRPCCore/Transport/ClientTransport.swift @@ -63,7 +63,7 @@ public protocol ClientTransport: Sendable { /// running ``connect()``. func beginGracefulShutdown() - /// Opens a stream using the transport, and uses it as input into a user-provided closure alongisde the given context. + /// Opens a stream using the transport, and uses it as input into a user-provided closure alongside the given context. /// /// - Important: The opened stream is closed after the closure is finished. /// diff --git a/Tests/GRPCCodeGenTests/Internal/Renderer/TextBasedRendererTests.swift b/Tests/GRPCCodeGenTests/Internal/Renderer/TextBasedRendererTests.swift index 080204962..f3ba7718a 100644 --- a/Tests/GRPCCodeGenTests/Internal/Renderer/TextBasedRendererTests.swift +++ b/Tests/GRPCCodeGenTests/Internal/Renderer/TextBasedRendererTests.swift @@ -880,10 +880,10 @@ final class Test_TextBasedRenderer: XCTestCase { func testProtocol() throws { try _test( - .init(name: "Protocoly"), + .init(name: "Protocolly"), renderedBy: { $0.renderProtocol(_:) }, rendersAs: #""" - protocol Protocoly {} + protocol Protocolly {} """# ) } diff --git a/Tests/GRPCCodeGenTests/Internal/Translator/IDLToStructuredSwiftTranslatorSnippetBasedTests.swift b/Tests/GRPCCodeGenTests/Internal/Translator/IDLToStructuredSwiftTranslatorSnippetBasedTests.swift index 33f4b0d87..6bff28c02 100644 --- a/Tests/GRPCCodeGenTests/Internal/Translator/IDLToStructuredSwiftTranslatorSnippetBasedTests.swift +++ b/Tests/GRPCCodeGenTests/Internal/Translator/IDLToStructuredSwiftTranslatorSnippetBasedTests.swift @@ -99,7 +99,7 @@ final class IDLToStructuredSwiftTranslatorSnippetBasedTests: XCTestCase { /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and /// trailing response metadata. If you don't need these then consider using - /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// the ``SimpleServiceProtocol``. If you need fine-grained control over your RPCs then /// use ``StreamingServiceProtocol``. /// /// > Source IDL Documentation: diff --git a/Tests/GRPCCodeGenTests/Internal/Translator/ServerCodeTranslatorSnippetBasedTests.swift b/Tests/GRPCCodeGenTests/Internal/Translator/ServerCodeTranslatorSnippetBasedTests.swift index 9db99776f..d11f644f7 100644 --- a/Tests/GRPCCodeGenTests/Internal/Translator/ServerCodeTranslatorSnippetBasedTests.swift +++ b/Tests/GRPCCodeGenTests/Internal/Translator/ServerCodeTranslatorSnippetBasedTests.swift @@ -84,7 +84,7 @@ final class ServerCodeTranslatorSnippetBasedTests { /// This protocol is higher level than ``StreamingServiceProtocol`` but lower level than /// the ``SimpleServiceProtocol``, it provides access to request and response metadata and /// trailing response metadata. If you don't need these then consider using - /// the ``SimpleServiceProtocol``. If you need fine grained control over your RPCs then + /// the ``SimpleServiceProtocol``. If you need fine-grained control over your RPCs then /// use ``StreamingServiceProtocol``. /// /// > Source IDL Documentation: diff --git a/Tests/GRPCCoreTests/Call/Client/ClientResponseTests.swift b/Tests/GRPCCoreTests/Call/Client/ClientResponseTests.swift index 30df1465c..ff09d73df 100644 --- a/Tests/GRPCCoreTests/Call/Client/ClientResponseTests.swift +++ b/Tests/GRPCCoreTests/Call/Client/ClientResponseTests.swift @@ -164,7 +164,7 @@ final class ClientResponseTests: XCTestCase { func testStreamToSingleConversionForInvalidStream() async throws { let bodies: [[StreamingClientResponse.Contents.BodyPart]] = [ [], // Empty stream - [.trailingMetadata([:]), .trailingMetadata([:])], // Multiple metadatas + [.trailingMetadata([:]), .trailingMetadata([:])], // Multiple metadata [.trailingMetadata([:]), .message("")], // Metadata then message ] diff --git a/Tests/GRPCCoreTests/Test Utilities/Coding+JSON.swift b/Tests/GRPCCoreTests/Test Utilities/Coding+JSON.swift index bb734479f..d8dd275a8 100644 --- a/Tests/GRPCCoreTests/Test Utilities/Coding+JSON.swift +++ b/Tests/GRPCCoreTests/Test Utilities/Coding+JSON.swift @@ -41,7 +41,7 @@ struct JSONDeserializer: MessageDeserializer { let data = serializedMessageBytes.withUnsafeBytes { Data($0) } return try jsonDecoder.decode(Message.self, from: data) } catch { - throw RPCError(code: .internalError, message: "Can't deserialze message from JSON. \(error)") + throw RPCError(code: .internalError, message: "Can't deserialize message from JSON. \(error)") } } } diff --git a/Tests/GRPCInProcessTransportTests/Test Utilities/JSONSerializing.swift b/Tests/GRPCInProcessTransportTests/Test Utilities/JSONSerializing.swift index ed44053c9..7dc54764e 100644 --- a/Tests/GRPCInProcessTransportTests/Test Utilities/JSONSerializing.swift +++ b/Tests/GRPCInProcessTransportTests/Test Utilities/JSONSerializing.swift @@ -41,7 +41,7 @@ struct JSONDeserializer: MessageDeserializer { let data = serializedMessageBytes.withUnsafeBytes { Data($0) } return try jsonDecoder.decode(Message.self, from: data) } catch { - throw RPCError(code: .internalError, message: "Can't deserialze message from JSON. \(error)") + throw RPCError(code: .internalError, message: "Can't deserialize message from JSON. \(error)") } } } diff --git a/dev/protos/fetch.sh b/dev/protos/fetch.sh index 2032a2408..023e0a816 100755 --- a/dev/protos/fetch.sh +++ b/dev/protos/fetch.sh @@ -28,7 +28,7 @@ git clone --depth 1 https://github.com/googleapis/googleapis.git "$checkouts/goo # Remove the old protos. rm -rf "$upstream" -# Create new directories to poulate. These are based on proto package name +# Create new directories to populate. These are based on proto package name # rather than source repository name. mkdir -p "$upstream/google" mkdir -p "$upstream/grpc/core"