-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added simple markdown. (Implemented for use in Teams Webhook message).
- Loading branch information
Alex da Franca
committed
Jun 1, 2022
1 parent
766b339
commit ddbbd73
Showing
7 changed files
with
188 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
Sources/xcresultparser/OutputFormatting/Formatters/Markdown/MDResultFormatter.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// | ||
// MDResultFormatter.swift | ||
// | ||
// Created by Alex da Franca on 31.05.22. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct MDResultFormatter: XCResultFormatting { | ||
private let indentWidth = " " | ||
|
||
public let testFailIcon = "🔴" | ||
public let testPassIcon = "🟢" | ||
|
||
public init() { } | ||
|
||
public func documentPrefix(title: String) -> String { | ||
return "" | ||
} | ||
public var documentSuffix: String { | ||
return "" | ||
} | ||
public var accordionOpenTag: String { | ||
return "" | ||
} | ||
public var accordionCloseTag: String { | ||
return "" | ||
} | ||
public var tableOpenTag: String { | ||
return "" | ||
} | ||
public var tableCloseTag: String { | ||
return "" | ||
} | ||
public var divider: String { | ||
return "---------------------\n" | ||
} | ||
public func resultSummaryLine(_ item: String, failed: Bool) -> String { | ||
return "* " + item | ||
} | ||
public func resultSummaryLineWarning(_ item: String, hasWarnings: Bool) -> String { | ||
return "* " + item | ||
} | ||
public func testConfiguration(_ item: String) -> String { | ||
return "## " + item | ||
} | ||
public func testTarget(_ item: String, failed: Bool) -> String { | ||
return "### " + item | ||
} | ||
public func testClass(_ item: String, failed: Bool) -> String { | ||
return "#### " + item | ||
} | ||
public func singleTestItem(_ item: String, failed: Bool) -> String { | ||
return "* " + item | ||
} | ||
public func failedTestItem(_ item: String, message: String) -> String { | ||
return "* " + item + "\n" + | ||
" * " + message | ||
} | ||
public func codeCoverageTargetSummary(_ item: String) -> String { | ||
return item | ||
} | ||
public func codeCoverageFileSummary(_ item: String) -> String { | ||
return "## " + item | ||
} | ||
public func codeCoverageFunctionSummary(_ items: [String]) -> String { | ||
return "### " + items.joined(separator: " ") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters