Files
SwiftLint/Source/SwiftLintFramework/Protocols/Reporter.swift
T
Johnykutty Mathew 6fb7ca1246 HTML Reporter added
2016-10-27 18:11:20 +05:30

33 lines
934 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 func generateReport(violations: [StyleViolation]) -> String
static var isRealtime: Bool { get }
}
public func reporterFromString(string: String) -> Reporter.Type {
switch string {
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
default:
fatalError("no reporter with identifier '\(string)' available.")
}
}