mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
18 lines
660 B
Swift
18 lines
660 B
Swift
public struct StyleViolation: CustomStringConvertible, Equatable {
|
|
public let ruleDescription: RuleDescription
|
|
public let severity: ViolationSeverity
|
|
public let location: Location
|
|
public let reason: String
|
|
public var description: String {
|
|
return XcodeReporter.generateForSingleViolation(self)
|
|
}
|
|
|
|
public init(ruleDescription: RuleDescription, severity: ViolationSeverity = .warning,
|
|
location: Location, reason: String? = nil) {
|
|
self.ruleDescription = ruleDescription
|
|
self.severity = severity
|
|
self.location = location
|
|
self.reason = reason ?? ruleDescription.description
|
|
}
|
|
}
|