mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Ideally, SwiftLintCore would some day only contain components that are needed to define rules. Consequently, it would be the only bundle required to import for (external) rule development.
22 lines
794 B
Swift
22 lines
794 B
Swift
/// Reports violations in the format Xcode uses to display in the IDE. (default)
|
|
struct XcodeReporter: Reporter {
|
|
// MARK: - Reporter Conformance
|
|
|
|
static let identifier = "xcode"
|
|
static let isRealtime = true
|
|
static let description = "Reports violations in the format Xcode uses to display in the IDE. (default)"
|
|
|
|
static func generateReport(_ violations: [StyleViolation]) -> String {
|
|
violations.map(generateForSingleViolation).joined(separator: "\n")
|
|
}
|
|
|
|
/// Generates a report for a single violation.
|
|
///
|
|
/// - parameter violation: The violation to report.
|
|
///
|
|
/// - returns: The report for a single violation.
|
|
internal static func generateForSingleViolation(_ violation: StyleViolation) -> String {
|
|
violation.description
|
|
}
|
|
}
|