From 7492da41d555bfb3fddff77b6a20c12c85286a7b Mon Sep 17 00:00:00 2001 From: Vera Mitchell Date: Thu, 13 Nov 2025 17:26:30 -0700 Subject: [PATCH 1/3] print lint location and message in plain bold instead of white fixes #1087 --- .../swift-format/Utilities/StderrDiagnosticPrinter.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift b/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift index f7730f00c..82b35a273 100644 --- a/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift +++ b/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift @@ -33,8 +33,8 @@ final class StderrDiagnosticPrinter { case boldRed = "1;31" case boldYellow = "1;33" case boldMagenta = "1;35" - case boldWhite = "1;37" case boldGray = "1;90" + case bold = "1" case reset = "0" } @@ -61,7 +61,7 @@ final class StderrDiagnosticPrinter { printQueue.sync { let stderr = FileHandleTextOutputStream(FileHandle.standardError) - stderr.write("\(ansiSGR(.boldWhite))\(description(of: diagnostic.location)): ") + stderr.write("\(ansiSGR(.bold))\(description(of: diagnostic.location)): ") switch diagnostic.severity { case .error: stderr.write("\(ansiSGR(.boldRed))error: ") @@ -72,7 +72,7 @@ final class StderrDiagnosticPrinter { if let category = diagnostic.category { stderr.write("\(ansiSGR(.boldYellow))[\(category)] ") } - stderr.write("\(ansiSGR(.boldWhite))\(diagnostic.message)\(ansiSGR(.reset))\n") + stderr.write("\(ansiSGR(.reset))\(ansiSGR(.bold))\(diagnostic.message)\(ansiSGR(.reset))\n") } } From 56f275c32bad0365aa87743f2a19d9584c12c372 Mon Sep 17 00:00:00 2001 From: QuietMisdreavus Date: Fri, 14 Nov 2025 09:12:57 -0700 Subject: [PATCH 2/3] review: print source locations in plain text Co-authored-by: Tony Allevato --- Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift b/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift index 82b35a273..50fed49ed 100644 --- a/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift +++ b/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift @@ -61,7 +61,7 @@ final class StderrDiagnosticPrinter { printQueue.sync { let stderr = FileHandleTextOutputStream(FileHandle.standardError) - stderr.write("\(ansiSGR(.bold))\(description(of: diagnostic.location)): ") + stderr.write("\(ansiSGR(.reset))\(description(of: diagnostic.location)): ") switch diagnostic.severity { case .error: stderr.write("\(ansiSGR(.boldRed))error: ") From e0f19166c71b4420ef2074b8b2ee66a10ed70855 Mon Sep 17 00:00:00 2001 From: Vera Mitchell Date: Fri, 14 Nov 2025 11:06:09 -0700 Subject: [PATCH 3/3] swap the colors for warning labels and diagnostic categories This aligns the color of warning labels with the Swift compiler by making them yellow instead of magenta. Diagnostic categories were changed to make them not share a color with the warning labels. --- Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift b/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift index 50fed49ed..eb4f79c87 100644 --- a/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift +++ b/Sources/swift-format/Utilities/StderrDiagnosticPrinter.swift @@ -65,12 +65,12 @@ final class StderrDiagnosticPrinter { switch diagnostic.severity { case .error: stderr.write("\(ansiSGR(.boldRed))error: ") - case .warning: stderr.write("\(ansiSGR(.boldMagenta))warning: ") + case .warning: stderr.write("\(ansiSGR(.boldYellow))warning: ") case .note: stderr.write("\(ansiSGR(.boldGray))note: ") } if let category = diagnostic.category { - stderr.write("\(ansiSGR(.boldYellow))[\(category)] ") + stderr.write("\(ansiSGR(.boldMagenta))[\(category)] ") } stderr.write("\(ansiSGR(.reset))\(ansiSGR(.bold))\(diagnostic.message)\(ansiSGR(.reset))\n") }