Skip to content

Commit be5121b

Browse files
committed
Fix typos througout the repo
1 parent 9c6ee33 commit be5121b

16 files changed

+128
-191
lines changed

Sources/Subprocess/API.swift

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
// MARK: - Collected Result
1919

20-
/// Run a executable with given parameters asynchrously and returns
20+
/// Run an executable with given parameters asynchronously and returns
2121
/// a `CollectedResult` containing the output of the child process.
2222
/// - Parameters:
2323
/// - executable: The executable to run.
@@ -62,7 +62,7 @@ public func run<
6262
)
6363
}
6464

65-
/// Run a executable with given parameters asynchrously and returns
65+
/// Run an executable with given parameters asynchronously and returns
6666
/// a `CollectedResult` containing the output of the child process.
6767
/// - Parameters:
6868
/// - executable: The executable to run.
@@ -142,7 +142,7 @@ public func run<
142142

143143
// MARK: - Custom Execution Body
144144

145-
/// Run a executable with given parameters and a custom closure
145+
/// Run an executable with given parameters and a custom closure
146146
/// to manage the running subprocess' lifetime and stream its standard output.
147147
/// - Parameters:
148148
/// - executable: The executable to run.
@@ -155,7 +155,7 @@ public func run<
155155
/// - error: How to manager executable standard error.
156156
/// - isolation: the isolation context to run the body closure.
157157
/// - body: The custom execution body to manually control the running process
158-
/// - Returns a ExecutableResult type containing the return value
158+
/// - Returns an executableResult type containing the return value
159159
/// of the closure.
160160
public func run<Result, Input: InputProtocol, Error: OutputProtocol>(
161161
_ executable: Executable,
@@ -204,7 +204,7 @@ public func run<Result, Input: InputProtocol, Error: OutputProtocol>(
204204
}
205205
}
206206

207-
/// Run a executable with given parameters and a custom closure
207+
/// Run an executable with given parameters and a custom closure
208208
/// to manage the running subprocess' lifetime and stream its standard error.
209209
/// - Parameters:
210210
/// - executable: The executable to run.
@@ -217,7 +217,7 @@ public func run<Result, Input: InputProtocol, Error: OutputProtocol>(
217217
/// - output: How to manager executable standard output.
218218
/// - isolation: the isolation context to run the body closure.
219219
/// - body: The custom execution body to manually control the running process
220-
/// - Returns a ExecutableResult type containing the return value
220+
/// - Returns an executableResult type containing the return value
221221
/// of the closure.
222222
public func run<Result, Input: InputProtocol, Output: OutputProtocol>(
223223
_ executable: Executable,
@@ -266,7 +266,7 @@ public func run<Result, Input: InputProtocol, Output: OutputProtocol>(
266266
}
267267
}
268268

269-
/// Run a executable with given parameters and a custom closure
269+
/// Run an executable with given parameters and a custom closure
270270
/// to manage the running subprocess' lifetime, write to its
271271
/// standard input, and stream its standard output.
272272
/// - Parameters:
@@ -279,7 +279,7 @@ public func run<Result, Input: InputProtocol, Output: OutputProtocol>(
279279
/// - error: How to manager executable standard error.
280280
/// - isolation: the isolation context to run the body closure.
281281
/// - body: The custom execution body to manually control the running process
282-
/// - Returns a ExecutableResult type containing the return value
282+
/// - Returns an executableResult type containing the return value
283283
/// of the closure.
284284
public func run<Result, Error: OutputProtocol>(
285285
_ executable: Executable,
@@ -311,7 +311,7 @@ public func run<Result, Error: OutputProtocol>(
311311
}
312312
}
313313

314-
/// Run a executable with given parameters and a custom closure
314+
/// Run an executable with given parameters and a custom closure
315315
/// to manage the running subprocess' lifetime, write to its
316316
/// standard input, and stream its standard error.
317317
/// - Parameters:
@@ -324,7 +324,7 @@ public func run<Result, Error: OutputProtocol>(
324324
/// - output: How to manager executable standard output.
325325
/// - isolation: the isolation context to run the body closure.
326326
/// - body: The custom execution body to manually control the running process
327-
/// - Returns a ExecutableResult type containing the return value
327+
/// - Returns an executableResult type containing the return value
328328
/// of the closure.
329329
public func run<Result, Output: OutputProtocol>(
330330
_ executable: Executable,
@@ -356,7 +356,7 @@ public func run<Result, Output: OutputProtocol>(
356356
}
357357
}
358358

359-
/// Run a executable with given parameters and a custom closure
359+
/// Run an executable with given parameters and a custom closure
360360
/// to manage the running subprocess' lifetime, write to its
361361
/// standard input, and stream its standard output and standard error.
362362
/// - Parameters:
@@ -368,7 +368,7 @@ public func run<Result, Output: OutputProtocol>(
368368
/// when running the executable.
369369
/// - isolation: the isolation context to run the body closure.
370370
/// - body: The custom execution body to manually control the running process
371-
/// - Returns a ExecutableResult type containing the return value
371+
/// - Returns an executableResult type containing the return value
372372
/// of the closure.
373373
public func run<Result>(
374374
_ executable: Executable,
@@ -411,7 +411,7 @@ public func run<Result>(
411411

412412
// MARK: - Configuration Based
413413

414-
/// Run a `Configuration` asynchrously and returns
414+
/// Run a `Configuration` asynchronously and returns
415415
/// a `CollectedResult` containing the output of the child process.
416416
/// - Parameters:
417417
/// - configuration: The `Subprocess` configuration to run.
@@ -503,14 +503,14 @@ public func run<
503503
)
504504
}
505505

506-
/// Run a executable with given parameters specified by a `Configuration`
506+
/// Run an executable with given parameters specified by a `Configuration`
507507
/// - Parameters:
508508
/// - configuration: The `Subprocess` configuration to run.
509509
/// - isolation: the isolation context to run the body closure.
510510
/// - body: The custom configuration body to manually control
511511
/// the running process, write to its standard input, stream
512512
/// its standard output and standard error.
513-
/// - Returns a ExecutableResult type containing the return value
513+
/// - Returns an executableResult type containing the return value
514514
/// of the closure.
515515
public func run<Result>(
516516
_ configuration: Configuration,
@@ -534,7 +534,7 @@ public func run<Result>(
534534

535535
// MARK: - Detached
536536

537-
/// Run a executable with given parameters and return its process
537+
/// Run an executable with given parameters and return its process
538538
/// identifier immediately without monitoring the state of the
539539
/// subprocess nor waiting until it exits.
540540
///
@@ -571,7 +571,7 @@ public func runDetached(
571571
return try runDetached(config, input: input, output: output, error: error)
572572
}
573573

574-
/// Run a executable with given configuration and return its process
574+
/// Run an executable with given configuration and return its process
575575
/// identifier immediately without monitoring the state of the
576576
/// subprocess nor waiting until it exits.
577577
///

Sources/Subprocess/AsyncBufferSequence.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public struct AsyncBufferSequence: AsyncSequence, Sendable {
5050
let data = try await self.diskIO.read(
5151
upToLength: readBufferSize
5252
)
53-
guard let data = data else {
53+
guard let data else {
5454
// We finished reading. Close the file descriptor now
5555
#if os(Windows)
5656
try self.diskIO.close()
@@ -61,7 +61,7 @@ public struct AsyncBufferSequence: AsyncSequence, Sendable {
6161
}
6262
let createdBuffers = Buffer.createFrom(data)
6363
// Most (all?) cases there should be only one buffer
64-
// because DispatchData are motsly contiguous
64+
// because DispatchData are mostly contiguous
6565
if _fastPath(createdBuffers.count == 1) {
6666
// No need to push to the stack
6767
return createdBuffers[0]
@@ -139,7 +139,7 @@ extension AsyncBufferSequence {
139139
)
140140
}
141141
#else
142-
// Unfortunitely here we _have to_ copy the bytes out because
142+
// Unfortunately here we _have to_ copy the bytes out because
143143
// DisptachIO (rightfully) reuses buffer, which means `buffer.data`
144144
// has the same address on all iterations, therefore we can't directly
145145
// create the result array from buffer.data
@@ -238,7 +238,7 @@ extension AsyncBufferSequence {
238238
// For UTF8, look for the next 0x85 byte
239239
guard (targetIndex + 1) < self.buffer.count,
240240
self.buffer[targetIndex + 1] == Encoding.CodeUnit(0x85) else {
241-
// Not a valid new ine. Keep looking
241+
// Not a valid new line. Keep looking
242242
continue
243243
}
244244
// Swallow 0x85 byte
@@ -254,7 +254,7 @@ extension AsyncBufferSequence {
254254
// For UTF8, look for the next 0x80 byte
255255
guard (targetIndex + 1) < self.buffer.count,
256256
self.buffer[targetIndex + 1] == Encoding.CodeUnit(0x80) else {
257-
// Not a valid new ine. Keep looking
257+
// Not a valid new line. Keep looking
258258
continue
259259
}
260260
// Swallow 0x80 byte
@@ -263,7 +263,7 @@ extension AsyncBufferSequence {
263263
guard (targetIndex + 1) < self.buffer.count,
264264
(self.buffer[targetIndex + 1] == Encoding.CodeUnit(0xA8) ||
265265
self.buffer[targetIndex + 1] == Encoding.CodeUnit(0xA9)) else {
266-
// Not a valid new ine. Keep looking
266+
// Not a valid new line. Keep looking
267267
continue
268268
}
269269
// Swallow 0xA8 (or 0xA9) byte

Sources/Subprocess/Buffer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ extension AsyncBufferSequence.Buffer {
7878
}
7979

8080
#if SubprocessSpan
81-
// Access the storge backing this Buffer
81+
// Access the storage backing this Buffer
8282
#if SubprocessSpan
8383
@available(SubprocessSpan, *)
8484
#endif
@@ -113,7 +113,7 @@ extension AsyncBufferSequence.Buffer: Equatable, Hashable {
113113
// MARK: - DispatchData.Block
114114
#if canImport(Darwin) || canImport(Glibc) || canImport(Android) || canImport(Musl)
115115
extension DispatchData {
116-
/// Unfortunitely `DispatchData.Region` is not available on Linux, hence our own wrapper
116+
/// Unfortunately `DispatchData.Region` is not available on Linux, hence our own wrapper
117117
internal struct Slice: @unchecked Sendable, RandomAccessCollection {
118118
typealias Element = UInt8
119119

Sources/Subprocess/Configuration.swift

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public struct Configuration: Sendable {
4040
public var environment: Environment
4141
/// The working directory to use when running the executable.
4242
public var workingDirectory: FilePath
43-
/// The platform specifc options to use when
43+
/// The platform specific options to use when
4444
/// running the subprocess.
4545
public var platformOptions: PlatformOptions
4646

@@ -58,9 +58,6 @@ public struct Configuration: Sendable {
5858
self.platformOptions = platformOptions
5959
}
6060

61-
#if SubprocessSpan
62-
@available(SubprocessSpan, *)
63-
#endif
6461
internal func run<Result>(
6562
input: consuming CreatedPipe,
6663
output: consuming CreatedPipe,
@@ -134,7 +131,7 @@ extension Configuration: CustomStringConvertible, CustomDebugStringConvertible {
134131
extension Configuration {
135132
/// Close each input individually, and throw the first error if there's multiple errors thrown
136133
@Sendable
137-
internal func safelyCloseMultuple(
134+
internal func safelyCloseMultiple(
138135
inputRead: consuming TrackedFileDescriptor?,
139136
inputWrite: consuming TrackedFileDescriptor?,
140137
outputRead: consuming TrackedFileDescriptor?,
@@ -393,7 +390,7 @@ extension Environment: CustomStringConvertible, CustomDebugStringConvertible {
393390
"""
394391
case .inherit(let updateValue):
395392
return """
396-
Inherting current environment with updates:
393+
Inheriting current environment with updates:
397394
\(updateValue)
398395
"""
399396
#if !os(Windows)
@@ -454,7 +451,7 @@ public enum TerminationStatus: Sendable, Hashable, Codable {
454451

455452
/// The subprocess was existed with the given code
456453
case exited(Code)
457-
/// The subprocess was signalled with given exception value
454+
/// The subprocess was signaled with given exception value
458455
case unhandledException(Code)
459456
/// Whether the current TerminationStatus is successful.
460457
public var isSuccess: Bool {
@@ -485,9 +482,6 @@ extension TerminationStatus: CustomStringConvertible, CustomDebugStringConvertib
485482
// MARK: - Internal
486483

487484
extension Configuration {
488-
#if SubprocessSpan
489-
@available(SubprocessSpan, *)
490-
#endif
491485
/// After Spawn finishes, child side file descriptors
492486
/// (input read, output write, error write) will be closed
493487
/// by `spawn()`. It returns the parent side file descriptors
@@ -581,7 +575,7 @@ internal enum StringOrRawBytes: Sendable, Hashable {
581575
}
582576

583577
/// A wrapped `FileDescriptor` and whether it should be closed
584-
/// automactially when done.
578+
/// automatically when done.
585579
internal struct TrackedFileDescriptor: ~Copyable {
586580
internal var closeWhenDone: Bool
587581
internal let fileDescriptor: FileDescriptor
@@ -667,7 +661,7 @@ internal struct TrackedFileDescriptor: ~Copyable {
667661

668662
#if !os(Windows)
669663
/// A wrapped `DispatchIO` and whether it should be closed
670-
/// automactially when done.
664+
/// automatically when done.
671665
internal struct TrackedDispatchIO: ~Copyable {
672666
internal var closeWhenDone: Bool
673667
internal var dispatchIO: DispatchIO

Sources/Subprocess/Execution.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,9 @@ import Musl
2727
import WinSDK
2828
#endif
2929

30-
/// An object that repersents a subprocess that has been
30+
/// An object that represents a subprocess that has been
3131
/// executed. You can use this object to send signals to the
3232
/// child process as well as stream its output and error.
33-
#if SubprocessSpan
34-
@available(SubprocessSpan, *)
35-
#endif
3633
public struct Execution: Sendable {
3734
/// The process identifier of the current execution
3835
public let processIdentifier: ProcessIdentifier

Sources/Subprocess/IO/Input.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public struct NoInput: InputProtocol {
5353
writeFileDescriptor: nil
5454
)
5555
#else
56-
let devnull: FileDescriptor = try .openDevNull(withAcessMode: .readOnly)
56+
let devnull: FileDescriptor = try .openDevNull(withAccessMode: .readOnly)
5757
return CreatedPipe(
5858
readFileDescriptor: .init(devnull, closeWhenDone: true),
5959
writeFileDescriptor: nil
@@ -147,7 +147,7 @@ internal struct CustomWriteInput: InputProtocol {
147147
}
148148

149149
extension InputProtocol where Self == NoInput {
150-
/// Create a Subprocess input that specfies there is no input
150+
/// Create a Subprocess input that specifies there is no input
151151
public static var none: Self { .init() }
152152
}
153153

0 commit comments

Comments
 (0)