Files
SwiftLint/Source/SwiftLintFramework/Protocols/Reporter.swift
T
2018-08-16 15:02:47 +09:00

30 lines
965 B
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 {
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
default:
queuedFatalError("no reporter with identifier '\(identifier)' available.")
}
}