Skip to content

Commit f5af465

Browse files
committed
Apply formatting changes in the codebase
1 parent baf7993 commit f5af465

25 files changed

+254
-105
lines changed

Sources/AsyncProcess/FileContentStream.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ private final class ReadIntoAsyncChannelHandler: ChannelDuplexHandler {
256256
extension FileHandle {
257257
func fileContentStream(eventLoop: EventLoop) throws -> FileContentStream {
258258
let asyncBytes = try FileContentStream(
259-
fileDescriptor: self.fileDescriptor, eventLoop: eventLoop)
259+
fileDescriptor: self.fileDescriptor,
260+
eventLoop: eventLoop
261+
)
260262
try self.close()
261263
return asyncBytes
262264
}
@@ -432,7 +434,8 @@ where Base: AsyncSequence, Base.Element == ByteBuffer {
432434
}
433435

434436
public init(
435-
_ underlying: Base, dropTerminator: Bool,
437+
_ underlying: Base,
438+
dropTerminator: Bool,
436439
maximumAllowableBufferSize: Int,
437440
dropLastChunkIfNoNewline: Bool
438441
) {

Sources/AsyncProcess/ProcessExecutor+Convenience.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ extension ProcessExecutor {
324324
}
325325

326326
var allInfo = ProcessExitReasonAndOutput(
327-
exitReason: .exit(-1), standardOutput: nil, standardError: nil)
327+
exitReason: .exit(-1),
328+
standardOutput: nil,
329+
standardError: nil
330+
)
328331
while let next = try await group.next() {
329332
switch next {
330333
case let .exitReason(exitReason):
@@ -467,7 +470,8 @@ extension ProcessExecutor {
467470
try await self.runCollectingOutput(
468471
group: group,
469472
executable: executable,
470-
arguments, standardInput: EOFSequence(),
473+
arguments,
474+
standardInput: EOFSequence(),
471475
collectStandardOutput: collectStandardOutput,
472476
collectStandardError: collectStandardError,
473477
perStreamCollectionLimitBytes: perStreamCollectionLimitBytes,

Sources/AsyncProcess/ProcessExecutor.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ public final actor ProcessExecutor {
159159
private let _standardOutput: ChunkSequence
160160
private let _standardError: ChunkSequence
161161
private let processIsRunningApproximation = ManagedAtomic(
162-
RunningStateApproximation.neverStarted.rawValue)
162+
RunningStateApproximation.neverStarted.rawValue
163+
)
163164
private let processOutputConsumptionApproximation = ManagedAtomic(UInt8(0))
164165
private let processPid = ManagedAtomic(pid_t(0))
165166
private let ownsStandardOutputWriteHandle: Bool
@@ -568,7 +569,10 @@ public final actor ProcessExecutor {
568569
// At this point, the process is running, we should therefore have a process ID (unless we're already dead).
569570
let childPid = p.processIdentifier
570571
_ = self.processPid.compareExchange(
571-
expected: 0, desired: childPid, ordering: .sequentiallyConsistent)
572+
expected: 0,
573+
desired: childPid,
574+
ordering: .sequentiallyConsistent
575+
)
572576
assert(childPid != 0 || !p.isRunning)
573577
self.logger.debug(
574578
"running command",

Sources/GeneratorCLI/GeneratorCLI.swift

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ struct GeneratorCLI: AsyncParsableCommand {
7171

7272
logger.info(
7373
"Generator run finished successfully.",
74-
metadata: ["elapsedTime": .string(elapsed.intervalString)])
74+
metadata: ["elapsedTime": .string(elapsed.intervalString)]
75+
)
7576
}
7677
}
7778

@@ -167,7 +168,8 @@ extension GeneratorCLI {
167168
if let arch = hostArch {
168169
let target = Triple(arch: arch, vendor: current.vendor!, os: current.os!)
169170
appLogger.warning(
170-
"deprecated: Please use `--host \(target.triple)` instead of `--host-arch \(arch)`")
171+
"deprecated: Please use `--host \(target.triple)` instead of `--host-arch \(arch)`"
172+
)
171173
return target
172174
}
173175
return current
@@ -219,7 +221,8 @@ extension GeneratorCLI {
219221
if let arch = generatorOptions.targetArch {
220222
let target = Triple(arch: arch, vendor: nil, os: .linux, environment: .gnu)
221223
appLogger.warning(
222-
"deprecated: Please use `--target \(target.triple)` instead of `--target-arch \(arch)`")
224+
"deprecated: Please use `--target \(target.triple)` instead of `--target-arch \(arch)`"
225+
)
223226
}
224227
return Triple(arch: hostTriple.arch!, vendor: nil, os: .linux, environment: .gnu)
225228
}
@@ -240,7 +243,9 @@ extension GeneratorCLI {
240243
let linuxDistributionVersion =
241244
self.linuxDistributionVersion ?? linuxDistributionDefaultVersion
242245
let linuxDistribution = try LinuxDistribution(
243-
name: linuxDistributionName, version: linuxDistributionVersion)
246+
name: linuxDistributionName,
247+
version: linuxDistributionVersion
248+
)
244249
let hostTriple = try self.generatorOptions.deriveHostTriple()
245250
let targetTriple = self.deriveTargetTriple(hostTriple: hostTriple)
246251

@@ -259,7 +264,10 @@ extension GeneratorCLI {
259264
logger: loggerWithLevel(from: self.generatorOptions)
260265
)
261266
try await GeneratorCLI.run(
262-
recipe: recipe, targetTriple: targetTriple, options: self.generatorOptions)
267+
recipe: recipe,
268+
targetTriple: targetTriple,
269+
options: self.generatorOptions
270+
)
263271
}
264272

265273
func isInvokedAsDefaultSubcommand() -> Bool {
@@ -316,7 +324,10 @@ extension GeneratorCLI {
316324
)
317325
let targetTriple = self.deriveTargetTriple()
318326
try await GeneratorCLI.run(
319-
recipe: recipe, targetTriple: targetTriple, options: self.generatorOptions)
327+
recipe: recipe,
328+
targetTriple: targetTriple,
329+
options: self.generatorOptions
330+
)
320331
}
321332
}
322333
}
@@ -327,12 +338,19 @@ extension Duration {
327338
let date = Date(timeInterval: TimeInterval(self.components.seconds), since: reference)
328339

329340
let components = Calendar.current.dateComponents(
330-
[.hour, .minute, .second], from: reference, to: date)
341+
[.hour, .minute, .second],
342+
from: reference,
343+
to: date
344+
)
331345

332346
if let hours = components.hour, hours > 0 {
333347
#if !canImport(Darwin) && compiler(<6.0)
334348
return String(
335-
format: "%02d:%02d:%02d", hours, components.minute ?? 0, components.second ?? 0)
349+
format: "%02d:%02d:%02d",
350+
hours,
351+
components.minute ?? 0,
352+
components.second ?? 0
353+
)
336354
#else
337355
return self.formatted()
338356
#endif

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Copy.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ extension SwiftSDKGenerator {
136136
if isOptional && !doesFileExist(at: fromPath) {
137137
logger.debug(
138138
"Optional package path ignored since it does not exist",
139-
metadata: ["packagePath": .string(fromPath.string)])
139+
metadata: ["packagePath": .string(fromPath.string)]
140+
)
140141
continue
141142
}
142143

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Download.swift

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ extension FilePath {
3131

3232
extension SwiftSDKGenerator {
3333
func downloadArtifacts(
34-
_ client: some HTTPClientProtocol, _ engine: QueryEngine,
34+
_ client: some HTTPClientProtocol,
35+
_ engine: QueryEngine,
3536
downloadableArtifacts: inout DownloadableArtifacts,
3637
itemsToDownload: @Sendable (DownloadableArtifacts) -> [DownloadableArtifacts.Item]
3738
) async throws {
@@ -58,7 +59,8 @@ extension SwiftSDKGenerator {
5859
for item in itemsToDownload(downloadableArtifacts) {
5960
group.addTask {
6061
try await engine[
61-
DownloadArtifactQuery(artifact: item, httpClient: client, logger: self.logger)]
62+
DownloadArtifactQuery(artifact: item, httpClient: client, logger: self.logger)
63+
]
6264
}
6365
}
6466

@@ -74,7 +76,8 @@ extension SwiftSDKGenerator {
7476
"Using downloaded artifacts in these locations.",
7577
metadata: [
7678
"paths": .array(results.map(\.path.metadataValue))
77-
])
79+
]
80+
)
7881
}
7982

8083
func downloadUbuntuPackages(
@@ -93,7 +96,8 @@ extension SwiftSDKGenerator {
9396
"""
9497
The `xz` utility was not found in `PATH`. \
9598
Consider installing it for more efficient downloading of package lists.
96-
""")
99+
"""
100+
)
97101
}
98102

99103
async let mainPackages = try await client.parseUbuntuPackagesList(
@@ -137,7 +141,9 @@ extension SwiftSDKGenerator {
137141
}
138142

139143
logger.info(
140-
"Downloading Ubuntu packages...", metadata: ["packageCount": .stringConvertible(urls.count)])
144+
"Downloading Ubuntu packages...",
145+
metadata: ["packageCount": .stringConvertible(urls.count)]
146+
)
141147
try await inTemporaryDirectory { fs, tmpDir in
142148
let downloadedFiles = try await self.downloadFiles(from: urls, to: tmpDir, client, engine)
143149
await report(downloadedFiles: downloadedFiles)
@@ -160,8 +166,11 @@ extension SwiftSDKGenerator {
160166
$0.addTask {
161167
let downloadedFilePath = try await engine[
162168
DownloadFileQuery(
163-
remoteURL: url, localDirectory: directory, httpClient: client
164-
)]
169+
remoteURL: url,
170+
localDirectory: directory,
171+
httpClient: client
172+
)
173+
]
165174
let filePath = downloadedFilePath.path
166175
guard
167176
let fileSize = try FileManager.default.attributesOfItem(
@@ -191,7 +200,8 @@ extension SwiftSDKGenerator {
191200
metadata: [
192201
"url": .string(url.absoluteString),
193202
"size": .string(byteCountFormatter.string(fromByteCount: Int64(bytes))),
194-
])
203+
]
204+
)
195205
}
196206
}
197207
}

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Entrypoint.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ extension SwiftSDKGenerator {
5151
try await self.createDirectoryIfNeeded(at: pathsConfiguration.artifactsCachePath)
5252

5353
let swiftSDKProduct = try await recipe.makeSwiftSDK(
54-
generator: self, engine: engine, httpClient: client)
54+
generator: self,
55+
engine: engine,
56+
httpClient: client
57+
)
5558

5659
let toolsetJSONPath = try await self.generateToolsetJSON(recipe: recipe)
5760

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Fixup.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ extension SwiftSDKGenerator {
5858

5959
func symlinkClangHeaders() throws {
6060
let swiftStaticClangPath = self.pathsConfiguration.toolchainDirPath.appending(
61-
"usr/lib/swift_static/clang")
61+
"usr/lib/swift_static/clang"
62+
)
6263
if !doesFileExist(at: swiftStaticClangPath) {
6364
logger.info("Symlinking clang headers...")
6465
try self.createSymlink(

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Metadata.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ extension SwiftSDKGenerator {
6363
"""
6464
`toolchainBinDirPath`, `sdkDirPath`, and `toolsetPath` are at unexpected locations that prevent computing \
6565
relative paths
66-
""")
66+
"""
67+
)
6768
}
6869

6970
var metadata = SwiftSDKMetadataV4.TripleProperties(

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator+Unpack.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ extension SwiftSDKGenerator {
103103
try await inTemporaryDirectory { fs, tmpDir in
104104
try await fs.unpack(file: targetSwiftPackagePath, into: tmpDir)
105105
try await fs.copyTargetSwift(
106-
from: tmpDir.appending(relativePathToRoot).appending("usr"), sdkDirPath: sdkDirPath
106+
from: tmpDir.appending(relativePathToRoot).appending("usr"),
107+
sdkDirPath: sdkDirPath
107108
)
108109
}
109110
}

0 commit comments

Comments
 (0)