Skip to content

Commit e651bd9

Browse files
committed
Reformat
1 parent e3b4abf commit e651bd9

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Sources/SwiftDiagnostics/DiagnosticDecorators/DiagnosticDecorator.swift

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ protocol DiagnosticDecorator {
3939
///
4040
/// - Returns: A decorated version of the diagnostic message, enhanced by visual cues like color, text styles, or other markers,
4141
/// as well as a severity-specific prefix, based on its severity level.
42-
func decorateMessage(_ message: String, basedOnSeverity severity: DiagnosticSeverity, category: DiagnosticCategory?) -> String
42+
func decorateMessage(
43+
_ message: String,
44+
basedOnSeverity severity: DiagnosticSeverity,
45+
category: DiagnosticCategory?
46+
) -> String
4347

4448
/// Decorates the outline of a source code buffer to visually enhance its structure.
4549
///
@@ -69,6 +73,10 @@ extension DiagnosticDecorator {
6973
///
7074
/// - Returns: A decorated version of the diagnostic message, determined by its severity level.
7175
func decorateDiagnosticMessage(_ diagnosticMessage: DiagnosticMessage) -> String {
72-
decorateMessage(diagnosticMessage.message, basedOnSeverity: diagnosticMessage.severity, category: diagnosticMessage.category)
76+
decorateMessage(
77+
diagnosticMessage.message,
78+
basedOnSeverity: diagnosticMessage.severity,
79+
category: diagnosticMessage.category
80+
)
7381
}
7482
}

Tests/SwiftDiagnosticsTest/DiagnosticDecorators/ANSIDiagnosticDecoratorTests.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ final class ANSIDiagnosticDecoratorTests: XCTestCase {
4040
basedOnSeverity: .error,
4141
category: DiagnosticCategory(name: "Filesystem", documentationURL: "http://www.swift.org")
4242
)
43-
assertStringsEqualWithDiff(decoratedMessageWithCategory, "\u{1B}[1;31merror: \u{1B}[1;39mFile not found\u{1B}[0;0m [#\u{001B}]8;;http://www.swift.org\u{001B}\\Filesystem\u{001B}]8;;\u{001B}\\]")
43+
assertStringsEqualWithDiff(
44+
decoratedMessageWithCategory,
45+
"\u{1B}[1;31merror: \u{1B}[1;39mFile not found\u{1B}[0;0m [#\u{001B}]8;;http://www.swift.org\u{001B}\\Filesystem\u{001B}]8;;\u{001B}\\]"
46+
)
4447
}
4548

4649
func testDecorateMessageWithEmptyMessage() {

0 commit comments

Comments
 (0)