mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
80d3813214
Use [GitHub Actions Logging](https://help.github.com/en/github/automating-your-workflow-with-github-actions/development-tools-for-github-actions#logging-commands) same as https://github.com/norio-nomura/action-swiftlint does.
34 lines
1.2 KiB
Swift
34 lines
1.2 KiB
Swift
public protocol Reporter: CustomStringConvertible {
|
|
static var identifier: String { get }
|
|
static var isRealtime: Bool { get }
|
|
|
|
static func generateReport(_ violations: [StyleViolation]) -> String
|
|
}
|
|
|
|
public func reporterFrom(identifier: String) -> Reporter.Type { // swiftlint:disable:this cyclomatic_complexity
|
|
switch identifier {
|
|
case XcodeReporter.identifier:
|
|
return XcodeReporter.self
|
|
case JSONReporter.identifier:
|
|
return JSONReporter.self
|
|
case CSVReporter.identifier:
|
|
return CSVReporter.self
|
|
case CheckstyleReporter.identifier:
|
|
return CheckstyleReporter.self
|
|
case JUnitReporter.identifier:
|
|
return JUnitReporter.self
|
|
case HTMLReporter.identifier:
|
|
return HTMLReporter.self
|
|
case EmojiReporter.identifier:
|
|
return EmojiReporter.self
|
|
case SonarQubeReporter.identifier:
|
|
return SonarQubeReporter.self
|
|
case MarkdownReporter.identifier:
|
|
return MarkdownReporter.self
|
|
case GitHubActionsLoggingReporter.identifier:
|
|
return GitHubActionsLoggingReporter.self
|
|
default:
|
|
queuedFatalError("no reporter with identifier '\(identifier)' available.")
|
|
}
|
|
}
|