Files
SwiftLint/Source/SwiftLintFramework/Protocols/Reporter.swift
T
Marcelo Fabri be341f90b9 Introduce queuedFatalError
`fatalError` prints the full path of the file, which leaks filesystem information from the machine that built the binary. Now that we release via CocoaPods, this is more critical.
2017-09-30 15:07:23 -03:00

36 lines
1018 B
Swift

//
// Reporter.swift
// SwiftLint
//
// Created by JP Simard on 9/19/15.
// Copyright © 2015 Realm. All rights reserved.
//
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
default:
queuedFatalError("no reporter with identifier '\(identifier)' available.")
}
}