Skip to content

Commit 30fb4bf

Browse files
committed
Update documentation imports and formatting
Standardized import order in documentation examples to import CommonProcessExecutionKit before CommonShell. Improved code formatting and spacing for better readability in code snippets across multiple documentation files.
1 parent affd90f commit 30fb4bf

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import CommonShell
2424

2525
var shell = CommonShell(executable: .name("git"))
2626
shell.hostKind = .env(options: [])
27-
let out = try await shell.run(arguments: ["status"]) // throws on non-zero exit
27+
let out = try await shell.run(arguments: ["status"]) // throws on non-zero exit
2828
print(out)
2929
```
3030

@@ -62,7 +62,7 @@ public struct CommandSpec: Codable, Sendable {
6262
public var hostKind: ExecutionHostKind? = nil
6363
public var runnerKind: ProcessRunnerKind? = nil
6464
public var timeout: Duration? = nil
65-
public var instrumentation: ProcessInstrumentation? = nil // runtime-only
65+
public var instrumentation: ProcessInstrumentation? = nil // runtime-only
6666
}
6767
```
6868

SPEC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
### Examples
9797

9898
```swift
99-
import CommonShell
10099
import CommonProcessExecutionKit
100+
import CommonShell
101101

102102
let sh = CommonShell(executable: Executable.path("/usr/bin/env"))
103103

sources/common-shell-arguments/CommonShellArguments.docc/CommonShellArguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ struct MyCLI: AsyncParsableCommand, CommonShellParsableArguments {
2323
host: .shell(options: []),
2424
identity: .path("/bin/sh"),
2525
args: ["echo hello"]
26-
) // via shell wrapper
26+
) // via shell wrapper
2727
print(out)
2828
}
2929
}

sources/common-shell/CommonShell.docc/QuickStart.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ unified `ExecutableReference` and `Executable` (from CommonProcess) to express
99
what you want to run and keep wrapper policy at the shell layer.
1010

1111
```swift
12-
import CommonShell
1312
import CommonProcessExecutionKit
13+
import CommonShell
1414

1515
// A neutral base configured to use /usr/bin/env by default
1616
let shell = CommonShell(executable: Executable.path("/usr/bin/env"))
@@ -73,14 +73,17 @@ host-aware helpers:
7373

7474
```swift
7575
// Shell host convenience with override identity
76-
print(try await shell.run(host: .shell(options: []), identity: .path("/bin/sh"), args: ["echo via shell"]))
76+
print(
77+
try await shell.run(
78+
host: .shell(options: []), identity: .path("/bin/sh"), args: ["echo via shell"]))
7779

7880
// Env host with explicit options via the low-level API
79-
print(try await shell.run(
80-
host: .env(options: ["-n"]),
81-
executable: Executable.name("echo"),
82-
arguments: ["ok"]
83-
))
81+
print(
82+
try await shell.run(
83+
host: .env(options: ["-n"]),
84+
executable: Executable.name("echo"),
85+
arguments: ["ok"]
86+
))
8487
```
8588

8689
## Duration benchmarks

sources/common-shell/CommonShell.docc/RunnersAndRoutes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ CommonProcess provides multiple runner backends (availability depends on platfor
1414
Pick explicitly on any CommonShell `run`/`runForInterval` via `runnerKind:`:
1515

1616
```swift
17-
import CommonShell
1817
import CommonProcessExecutionKit
18+
import CommonShell
1919

2020
let sh = CommonShell(executable: Executable.path("/usr/bin/env"))
2121
let out = try await sh.run(

sources/common-shell/CommonShell.docc/WhatsNew.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ A quick note on the simplified CommonShell API.
1111
## Examples
1212

1313
```swift
14-
import CommonShell
1514
import CommonProcessExecutionKit
15+
import CommonShell
1616

1717
let sh = CommonShell(executable: .path("/usr/bin/env"))
1818

sources/common-shell/Documentation.docc/CommonShell-Comparison-TuistCommand.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ print(out.utf8Output())
3838

3939
// Streaming run (consume events)
4040
let (events, cancel) = try shell.stream(["log", "--oneline"])
41-
for try await e in events { /* .stdout/.stderr/.completed */ }
41+
for try await e in events { /* .stdout/.stderr/.completed */ }
4242

4343
// Host wrappers (env/shell/npx/npm) set Invocation.hostKind appropriately
4444
let envOut = try await shell.runEnv(["PATH"]) // runs env PATH

0 commit comments

Comments
 (0)