diff --git a/Sources/ContainerBuild/BuildPipelineHandler.swift b/Sources/ContainerBuild/BuildPipelineHandler.swift index 525087733..197473a9c 100644 --- a/Sources/ContainerBuild/BuildPipelineHandler.swift +++ b/Sources/ContainerBuild/BuildPipelineHandler.swift @@ -105,7 +105,7 @@ public actor BuildPipeline { throw NSError( domain: "untilFirstError", code: 1, - userInfo: [NSLocalizedDescriptionKey: "Failed to initialize task continuation"]) + userInfo: [NSLocalizedDescriptionKey: "failed to initialize task continuation"]) } defer { taskContinuation.finish() } let stream = AsyncStream { continuation in diff --git a/Sources/ContainerBuild/URL+Extensions.swift b/Sources/ContainerBuild/URL+Extensions.swift index 3dd9b5e92..672585f44 100644 --- a/Sources/ContainerBuild/URL+Extensions.swift +++ b/Sources/ContainerBuild/URL+Extensions.swift @@ -228,7 +228,7 @@ public final class BufferedCopyReader: AsyncSequence { throw CocoaError( .fileReadUnsupportedScheme, userInfo: [ - NSLocalizedDescriptionKey: "Reset not supported with InputStream-based implementation" + NSLocalizedDescriptionKey: "reset not supported with InputStream-based implementation" ]) } @@ -240,7 +240,7 @@ public final class BufferedCopyReader: AsyncSequence { throw CocoaError( .fileReadUnsupportedScheme, userInfo: [ - NSLocalizedDescriptionKey: "Offset tracking not supported with InputStream-based implementation" + NSLocalizedDescriptionKey: "offset tracking not supported with InputStream-based implementation" ]) } @@ -252,7 +252,7 @@ public final class BufferedCopyReader: AsyncSequence { throw CocoaError( .fileReadUnsupportedScheme, userInfo: [ - NSLocalizedDescriptionKey: "Seeking not supported with InputStream-based implementation" + NSLocalizedDescriptionKey: "seeking not supported with InputStream-based implementation" ]) } diff --git a/Sources/ContainerClient/Core/ClientDiskUsage.swift b/Sources/ContainerClient/Core/ClientDiskUsage.swift index ff92c15ef..99e0c165a 100644 --- a/Sources/ContainerClient/Core/ClientDiskUsage.swift +++ b/Sources/ContainerClient/Core/ClientDiskUsage.swift @@ -31,7 +31,7 @@ public struct ClientDiskUsage { guard let responseData = reply.dataNoCopy(key: .diskUsageStats) else { throw ContainerizationError( .internalError, - message: "Invalid response from server: missing disk usage data" + message: "invalid response from server: missing disk usage data" ) } diff --git a/Sources/ContainerClient/Core/ClientKernel.swift b/Sources/ContainerClient/Core/ClientKernel.swift index 3ef2e4e81..d0a3670fd 100644 --- a/Sources/ContainerClient/Core/ClientKernel.swift +++ b/Sources/ContainerClient/Core/ClientKernel.swift @@ -84,7 +84,7 @@ extension ClientKernel { throw err } throw ContainerizationError( - .notFound, message: "Default kernel not configured for architecture \(platform.architecture). Please use the `container system kernel set` command to configure it") + .notFound, message: "default kernel not configured for architecture \(platform.architecture), please use the `container system kernel set` command to configure it") } } } @@ -97,7 +97,7 @@ extension SystemPlatform { case "amd64": return .linuxAmd default: - fatalError("Unknown architecture") + fatalError("unknown architecture") } } } diff --git a/Sources/ContainerClient/Core/ClientVolume.swift b/Sources/ContainerClient/Core/ClientVolume.swift index 5483ef4c7..d0e9ec0c1 100644 --- a/Sources/ContainerClient/Core/ClientVolume.swift +++ b/Sources/ContainerClient/Core/ClientVolume.swift @@ -41,7 +41,7 @@ public struct ClientVolume { let reply = try await client.send(message) guard let responseData = reply.dataNoCopy(key: .volume) else { - throw VolumeError.storageError("Invalid response from server") + throw VolumeError.storageError("invalid response from server") } return try JSONDecoder().decode(Volume.self, from: responseData) diff --git a/Sources/ContainerClient/Core/Volume.swift b/Sources/ContainerClient/Core/Volume.swift index 08da7e037..bc7665011 100644 --- a/Sources/ContainerClient/Core/Volume.swift +++ b/Sources/ContainerClient/Core/Volume.swift @@ -80,17 +80,17 @@ public enum VolumeError: Error, LocalizedError { public var errorDescription: String? { switch self { case .volumeNotFound(let name): - return "Volume '\(name)' not found" + return "volume '\(name)' not found" case .volumeAlreadyExists(let name): - return "Volume '\(name)' already exists" + return "volume '\(name)' already exists" case .volumeInUse(let name): - return "Volume '\(name)' is currently in use and cannot be accessed by another container, or deleted." + return "volume '\(name)' is currently in use and cannot be accessed by another container, or deleted" case .invalidVolumeName(let name): - return "Invalid volume name '\(name)'" + return "invalid volume name '\(name)'" case .driverNotSupported(let driver): - return "Volume driver '\(driver)' is not supported" + return "volume driver '\(driver)' is not supported" case .storageError(let message): - return "Storage error: \(message)" + return "storage error: \(message)" } } } diff --git a/Sources/ContainerClient/Parser.swift b/Sources/ContainerClient/Parser.swift index 4415b9335..6f985584b 100644 --- a/Sources/ContainerClient/Parser.swift +++ b/Sources/ContainerClient/Parser.swift @@ -262,7 +262,7 @@ public struct Parser { }() guard let commandToRun = processArguments, commandToRun.count > 0 else { - throw ContainerizationError(.invalidArgument, message: "Command/Entrypoint not specified for container process") + throw ContainerizationError(.invalidArgument, message: "command/entrypoint not specified for container process") } let defaultUser: ProcessConfiguration.User = { diff --git a/Sources/ContainerCommands/Container/ContainerStats.swift b/Sources/ContainerCommands/Container/ContainerStats.swift index 3ce906a8a..651b156d9 100644 --- a/Sources/ContainerCommands/Container/ContainerStats.swift +++ b/Sources/ContainerCommands/Container/ContainerStats.swift @@ -74,7 +74,7 @@ extension Application { guard let container = allContainers.first(where: { $0.id == containerId || $0.id.starts(with: containerId) }) else { throw ContainerizationError( .notFound, - message: "Error: No such container: \(containerId)" + message: "no such container: \(containerId)" ) } found.append(container) @@ -102,7 +102,7 @@ extension Application { guard allContainers.first(where: { $0.id == containerId || $0.id.starts(with: containerId) }) != nil else { throw ContainerizationError( .notFound, - message: "Error: No such container: \(containerId)" + message: "no such container: \(containerId)" ) } } @@ -140,7 +140,7 @@ extension Application { } } catch { clearScreen() - print("Error collecting stats: \(error)") + print("error collecting stats: \(error)") try await Task.sleep(for: .seconds(2)) } } diff --git a/Sources/ContainerCommands/DefaultCommand.swift b/Sources/ContainerCommands/DefaultCommand.swift index faec8d961..6ffc11434 100644 --- a/Sources/ContainerCommands/DefaultCommand.swift +++ b/Sources/ContainerCommands/DefaultCommand.swift @@ -42,9 +42,9 @@ struct DefaultCommand: AsyncParsableCommand { // Check for edge cases and unknown options to match the behavior in the absence of plugins. if command.isEmpty { - throw ValidationError("Unknown argument '\(command)'") + throw ValidationError("unknown argument '\(command)'") } else if command.starts(with: "-") { - throw ValidationError("Unknown option '\(command)'") + throw ValidationError("unknown option '\(command)'") } // Compute canonical plugin directories to show in helpful errors (avoid hard-coded paths) diff --git a/Sources/ContainerCommands/System/Kernel/KernelSet.swift b/Sources/ContainerCommands/System/Kernel/KernelSet.swift index 5931755fc..bdd66394a 100644 --- a/Sources/ContainerCommands/System/Kernel/KernelSet.swift +++ b/Sources/ContainerCommands/System/Kernel/KernelSet.swift @@ -67,7 +67,7 @@ extension Application { private func setKernelFromBinary() async throws { guard let binaryPath else { - throw ArgumentParser.ValidationError("Missing argument '--binary'") + throw ArgumentParser.ValidationError("missing argument '--binary'") } let absolutePath = URL(fileURLWithPath: binaryPath, relativeTo: .currentDirectory()).absoluteURL.absoluteString let platform = try getSystemPlatform() @@ -76,10 +76,10 @@ extension Application { private func setKernelFromTar() async throws { guard let binaryPath else { - throw ArgumentParser.ValidationError("Missing argument '--binary'") + throw ArgumentParser.ValidationError("missing argument '--binary'") } guard let tarPath else { - throw ArgumentParser.ValidationError("Missing argument '--tar") + throw ArgumentParser.ValidationError("missing argument '--tar") } let platform = try getSystemPlatform() let localTarPath = URL(fileURLWithPath: tarPath, relativeTo: .currentDirectory()).path diff --git a/Sources/ContainerCommands/System/SystemDF.swift b/Sources/ContainerCommands/System/SystemDF.swift index 75301df1a..79d81e7b0 100644 --- a/Sources/ContainerCommands/System/SystemDF.swift +++ b/Sources/ContainerCommands/System/SystemDF.swift @@ -44,7 +44,7 @@ extension Application { guard let jsonString = String(data: data, encoding: .utf8) else { throw ContainerizationError( .internalError, - message: "Failed to encode JSON output" + message: "failed to encode JSON output" ) } print(jsonString) diff --git a/Sources/ContainerPersistence/DefaultsStore.swift b/Sources/ContainerPersistence/DefaultsStore.swift index 45281469b..e855b725a 100644 --- a/Sources/ContainerPersistence/DefaultsStore.swift +++ b/Sources/ContainerPersistence/DefaultsStore.swift @@ -84,7 +84,7 @@ public enum DefaultsStore { private static var udSuite: UserDefaults { guard let ud = UserDefaults.init(suiteName: self.userDefaultDomain) else { - fatalError("Failed to initialize UserDefaults for domain \(self.userDefaultDomain)") + fatalError("failed to initialize UserDefaults for domain \(self.userDefaultDomain)") } return ud } diff --git a/Sources/ContainerPlugin/PluginLoader.swift b/Sources/ContainerPlugin/PluginLoader.swift index 5dd7d8b63..3f76fed08 100644 --- a/Sources/ContainerPlugin/PluginLoader.swift +++ b/Sources/ContainerPlugin/PluginLoader.swift @@ -133,7 +133,7 @@ extension PluginLoader { }.first) else { log?.warning( - "Not installing plugin with missing configuration", + "not installing plugin with missing configuration", metadata: [ "path": "\(installURL.path)" ] @@ -144,7 +144,7 @@ extension PluginLoader { // Warn and skip if this plugin name has been encountered already guard !pluginNames.contains(plugin.name) else { log?.warning( - "Not installing shadowed plugin", + "not installing shadowed plugin", metadata: [ "path": "\(installURL.path)", "name": "\(plugin.name)", @@ -157,7 +157,7 @@ extension PluginLoader { pluginNames.insert(plugin.name) } catch { log?.warning( - "Not installing plugin with invalid configuration", + "not installing plugin with invalid configuration", metadata: [ "path": "\(installURL.path)", "error": "\(error)", @@ -183,7 +183,7 @@ extension PluginLoader { } } catch { log?.warning( - "Not installing plugin with invalid configuration", + "not installing plugin with invalid configuration", metadata: [ "name": "\(name)", "error": "\(error)", diff --git a/Sources/ContainerPlugin/ServiceManager.swift b/Sources/ContainerPlugin/ServiceManager.swift index 3cee04f7c..597a55f47 100644 --- a/Sources/ContainerPlugin/ServiceManager.swift +++ b/Sources/ContainerPlugin/ServiceManager.swift @@ -72,12 +72,12 @@ public struct ServiceManager { let status = launchctl.terminationStatus guard status == 0 else { throw ContainerizationError( - .internalError, message: "command `launchctl list` failed with status \(status). Message: \(String(data: stderrData, encoding: .utf8) ?? "No error message")") + .internalError, message: "command `launchctl list` failed with status \(status), message: \(String(data: stderrData, encoding: .utf8) ?? "no error message")") } guard let outputText = String(data: outputData, encoding: .utf8) else { throw ContainerizationError( - .internalError, message: "could not decode output of command `launchctl list`. Message: \(String(data: stderrData, encoding: .utf8) ?? "No error message")") + .internalError, message: "could not decode output of command `launchctl list`, message: \(String(data: stderrData, encoding: .utf8) ?? "no error message")") } // The third field of each line of launchctl list output is the label diff --git a/Sources/ContainerVersion/CommandLine+Executable.swift b/Sources/ContainerVersion/CommandLine+Executable.swift index ed0a94eae..3051e74e2 100644 --- a/Sources/ContainerVersion/CommandLine+Executable.swift +++ b/Sources/ContainerVersion/CommandLine+Executable.swift @@ -26,7 +26,7 @@ extension CommandLine { /// Create the buffer and get the path buffer = [CChar](repeating: 0, count: Int(bufferSize)) guard _NSGetExecutablePath(&buffer, &bufferSize) == 0 else { - fatalError("UNEXPECTED: failed to get executable path") + fatalError("unexpected: failed to get executable path") } /// Return the path with the executable file component removed the last component and diff --git a/Sources/ContainerXPC/XPCServer.swift b/Sources/ContainerXPC/XPCServer.swift index 7eb814770..3a21a307c 100644 --- a/Sources/ContainerXPC/XPCServer.swift +++ b/Sources/ContainerXPC/XPCServer.swift @@ -239,12 +239,12 @@ extension xpc_object_t { } var connectionError: Bool { - precondition(isError, "Not an error") + precondition(isError, "not an error") return xpc_equal(self, XPC_ERROR_CONNECTION_INVALID) || xpc_equal(self, XPC_ERROR_CONNECTION_INTERRUPTED) } var connectionClosed: Bool { - precondition(isError, "Not an error") + precondition(isError, "not an error") return xpc_equal(self, XPC_ERROR_CONNECTION_INVALID) } @@ -253,7 +253,7 @@ extension xpc_object_t { } var errorDescription: String? { - precondition(isError, "Not an error") + precondition(isError, "not an error") let cstring = xpc_dictionary_get_string(self, XPC_ERROR_KEY_DESCRIPTION) guard let cstring else { return nil diff --git a/Sources/Helpers/APIServer/ContainerDNSHandler.swift b/Sources/Helpers/APIServer/ContainerDNSHandler.swift index 0104c1351..86534a404 100644 --- a/Sources/Helpers/APIServer/ContainerDNSHandler.swift +++ b/Sources/Helpers/APIServer/ContainerDNSHandler.swift @@ -97,12 +97,12 @@ struct ContainerDNSHandler: DNSHandler { let components = ipAllocation.address.split(separator: "/") guard !components.isEmpty else { - throw DNSResolverError.serverError("Invalid IP format: empty address") + throw DNSResolverError.serverError("invalid IP format: empty address") } let ipString = String(components[0]) guard let ip = IPv4(ipString) else { - throw DNSResolverError.serverError("Failed to parse IP address: \(ipString)") + throw DNSResolverError.serverError("failed to parse IP address: \(ipString)") } return HostRecord(name: question.name, ttl: ttl, ip: ip) diff --git a/Sources/Services/ContainerAPIService/Volumes/VolumesService.swift b/Sources/Services/ContainerAPIService/Volumes/VolumesService.swift index 3c09784e5..daac89f27 100644 --- a/Sources/Services/ContainerAPIService/Volumes/VolumesService.swift +++ b/Sources/Services/ContainerAPIService/Volumes/VolumesService.swift @@ -191,7 +191,7 @@ public actor VolumesService { let sizeInBytes = UInt64(bytes) guard sizeInBytes >= minSize else { - throw VolumeError.storageError("Volume size too small: minimum 1MiB") + throw VolumeError.storageError("volume size too small: minimum 1MiB") } return sizeInBytes @@ -244,7 +244,7 @@ public actor VolumesService { labels: [String: String] ) async throws -> Volume { guard VolumeStorage.isValidVolumeName(name) else { - throw VolumeError.invalidVolumeName("Invalid volume name '\(name)': must match \(VolumeStorage.volumeNamePattern)") + throw VolumeError.invalidVolumeName("invalid volume name '\(name)': must match \(VolumeStorage.volumeNamePattern)") } // Check if volume already exists by trying to list and finding it @@ -283,7 +283,7 @@ public actor VolumesService { private func _delete(name: String) async throws { guard VolumeStorage.isValidVolumeName(name) else { - throw VolumeError.invalidVolumeName("Invalid volume name '\(name)': must match \(VolumeStorage.volumeNamePattern)") + throw VolumeError.invalidVolumeName("invalid volume name '\(name)': must match \(VolumeStorage.volumeNamePattern)") } // Check if volume exists by trying to list and finding it @@ -311,7 +311,7 @@ public actor VolumesService { private func _inspect(_ name: String) async throws -> Volume { guard VolumeStorage.isValidVolumeName(name) else { - throw VolumeError.invalidVolumeName("Invalid volume name '\(name)': must match \(VolumeStorage.volumeNamePattern)") + throw VolumeError.invalidVolumeName("invalid volume name '\(name)': must match \(VolumeStorage.volumeNamePattern)") } let volumes = try await store.list() diff --git a/Sources/Services/ContainerImagesService/Server/ImageService.swift b/Sources/Services/ContainerImagesService/Server/ImageService.swift index e7cc1baf7..440c73c24 100644 --- a/Sources/Services/ContainerImagesService/Server/ImageService.swift +++ b/Sources/Services/ContainerImagesService/Server/ImageService.swift @@ -231,7 +231,7 @@ extension ImagesService { throw err } guard authentication != nil else { - throw ContainerizationError(.internalError, message: "\(String(describing: err)). No credentials found for host \(host)") + throw ContainerizationError(.internalError, message: "\(String(describing: err)), no credentials found for host \(host)") } throw err } diff --git a/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift b/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift index 08fff5dc0..20c8aa417 100644 --- a/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift +++ b/Sources/Services/ContainerImagesService/Server/SnapshotStore.swift @@ -84,7 +84,7 @@ public actor SnapshotStore { throw ContainerizationError(.internalError, message: "missing platform for descriptor \(desc.digest)") } guard let unpacker = try await self.unpackStrategy(image, platform) else { - self.log?.warning("Skipping unpack for \(image.reference) for platform \(platform.description). No unpacker configured.") + self.log?.warning("no unpacker configured, skipping unpack for \(image.reference) for platform \(platform.description)") continue } let currentSubTask = await taskManager.startTask() diff --git a/Sources/TerminalProgress/ProgressConfig.swift b/Sources/TerminalProgress/ProgressConfig.swift index 71c26c786..37eb107a5 100644 --- a/Sources/TerminalProgress/ProgressConfig.swift +++ b/Sources/TerminalProgress/ProgressConfig.swift @@ -163,7 +163,7 @@ extension ProgressConfig { public var description: String { switch self { case .invalid(let reason): - return "Failed to validate config (\(reason))" + return "failed to validate config (\(reason))" } } }