From fa956eb7a99d4c523f49caddce110fa2a7b89755 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 21 Oct 2024 16:21:56 +0200 Subject: [PATCH 1/2] Fix printing to stderr - add a missing newline --- Sources/_OpenAPIGeneratorCore/Diagnostics.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/_OpenAPIGeneratorCore/Diagnostics.swift b/Sources/_OpenAPIGeneratorCore/Diagnostics.swift index f85c991d..9c6e78e9 100644 --- a/Sources/_OpenAPIGeneratorCore/Diagnostics.swift +++ b/Sources/_OpenAPIGeneratorCore/Diagnostics.swift @@ -322,7 +322,9 @@ public struct StdErrPrintingDiagnosticCollector: DiagnosticCollector, Sendable { /// Emits a diagnostic message to standard error. /// /// - Parameter diagnostic: The diagnostic message to emit. - public func emit(_ diagnostic: Diagnostic) { stdErrHandle.write(diagnostic.description) } + public func emit(_ diagnostic: Diagnostic) { + stdErrHandle.write(diagnostic.description + "\n") + } } /// A no-op collector, silently ignores all diagnostics. From 443acc347e83068a7c4f29f68f28e5a98a928a80 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 21 Oct 2024 16:24:29 +0200 Subject: [PATCH 2/2] Fix soundness --- Sources/_OpenAPIGeneratorCore/Diagnostics.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/_OpenAPIGeneratorCore/Diagnostics.swift b/Sources/_OpenAPIGeneratorCore/Diagnostics.swift index 9c6e78e9..08b561a0 100644 --- a/Sources/_OpenAPIGeneratorCore/Diagnostics.swift +++ b/Sources/_OpenAPIGeneratorCore/Diagnostics.swift @@ -322,9 +322,7 @@ public struct StdErrPrintingDiagnosticCollector: DiagnosticCollector, Sendable { /// Emits a diagnostic message to standard error. /// /// - Parameter diagnostic: The diagnostic message to emit. - public func emit(_ diagnostic: Diagnostic) { - stdErrHandle.write(diagnostic.description + "\n") - } + public func emit(_ diagnostic: Diagnostic) { stdErrHandle.write(diagnostic.description + "\n") } } /// A no-op collector, silently ignores all diagnostics.