Files
SwiftLint/Source/swiftlint/Extensions/Reporter+CommandLine.swift
T
JP Simard 86308adf6b refactor LintCommand
mostly by moving things out of run(_:) and out of the file
2016-12-30 18:43:51 -08:00

26 lines
697 B
Swift

//
// Reporter+CommandLine.swift
// SwiftLint
//
// Created by JP Simard on 12/30/16.
// Copyright © 2016 Realm. All rights reserved.
//
import SwiftLintFramework
extension Reporter {
static func reportViolations(_ violations: [StyleViolation], realtimeCondition: Bool) {
if isRealtime == realtimeCondition {
let report = generateReport(violations)
if !report.isEmpty {
queuedPrint(report)
}
}
}
}
func reporterFrom(options: LintOptions, configuration: Configuration) -> Reporter.Type {
let string = options.reporter.isEmpty ? configuration.reporter : options.reporter
return reporterFromString(string)
}