Skip to content

Commit 47fab80

Browse files
committed
Docs: Add missing documentation comments for public declarations
1 parent 9b66550 commit 47fab80

File tree

6 files changed

+27
-1
lines changed

6 files changed

+27
-1
lines changed

Plugins/ContainerImageBuilder/runner.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import Foundation
1616

17+
/// Error code returned if the process terminates because of an uncaught signal.
1718
public enum ExitCode: Error { case rawValue(Int32) }
1819

1920
/// Runs `command` with the given arguments and environment variables, capturing standard output and standard error.

Sources/ContainerRegistry/HTTPClient.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ import FoundationNetworking
1919
import HTTPTypes
2020
import HTTPTypesFoundation
2121

22-
// HEAD does not include a response body so if an error is thrown, data will be nil
22+
/// An error encountered while making an HTTP request
23+
///
24+
/// The response to a `HEAD` request does not include a body so if an error is thrown, `data` will be `nil`
2325
public enum HTTPClientError: Error {
2426
case unexpectedStatusCode(status: HTTPResponse.Status, response: HTTPResponse, data: Data?)
2527
case unexpectedContentType(String)

Sources/ContainerRegistry/RegistryClient.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import FoundationNetworking
1919
import HTTPTypes
2020
import Basics
2121

22+
/// An error encountered while communicating with a container registry.
2223
public enum RegistryClientError: Error {
2324
case registryParseError(String)
2425
case invalidRegistryPath(String)

Sources/ContainerRegistry/Schema.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public struct ImageConfigurationRootFS: Codable, Hashable, Sendable {
176176
self.diff_ids = diff_ids
177177
}
178178

179+
/// Field name mapping
179180
public enum CodingKeys: String, CodingKey {
180181
case _type = "type"
181182
case diff_ids
@@ -400,6 +401,7 @@ public struct Platform: Codable, Hashable, Sendable {
400401
self.features = features
401402
}
402403

404+
/// Field name mapping
403405
public enum CodingKeys: String, CodingKey {
404406
case architecture
405407
case os

Sources/ContainerRegistry/ScratchImage.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public struct ScratchImage {
2727
var manifestDescriptor: ContentDescriptor
2828
var index: ImageIndex
2929

30+
/// Construct a `ScratchImage` structure, representing a scratch container image with no contents.
31+
/// - Parameters:
32+
/// - architecture: The CPU architecture encoded in the scratch image layer. The scratch layer is empty, but this value should match any layers stacked on top of it.
33+
/// - os: The operating system name encoded in the scratch image layer. The scratch layer is empty, but this value should match any layers stacked on top of it.
3034
public init(architecture: String, os: String) {
3135
self.encoder = containerJSONEncoder()
3236

Sources/Tar/tar.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,22 @@ public struct TarHeader {
242242
/// Filename prefix - prepended to name
243243
var prefix: String = ""
244244

245+
/// Construct a Tar archive header block
246+
/// - Parameters:
247+
/// - name: File name
248+
/// - mode: Access mode
249+
/// - uid: File owner's user ID
250+
/// - gid: File's group ID
251+
/// - size: File size in octets
252+
/// - mtime: Last modification time
253+
/// - typeflag: Type of file represented by this header
254+
/// - linkname: Reference to a previous file in the archive. Only valid when `typeflag` is `.LNKTYPE`. This is an internal link in the archive file, _not_ a symbolic link.
255+
/// - uname: File owner's user name
256+
/// - gname: File's group name
257+
/// - devmajor: Device major number. Only valid when `typeflag` is `.BLKTYPE` or `.CHRTYPE`.
258+
/// - devminor: Device minor number. Only valid when `typeflag` is `.BLKTYPE` or `.CHRTYPE`.
259+
/// - prefix: Optional filename prefix, allowing file names longer than 100 octets to be stored.
260+
/// - Throws: If the value of any field cannot be represented in a Tar header.
245261
public init(
246262
name: String,
247263
mode: Int = 0o555,

0 commit comments

Comments
 (0)