mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
be341f90b9
`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.
36 lines
1018 B
Swift
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.")
|
|
}
|
|
}
|