Files
SwiftLint/Source/SwiftLintFramework/Models/Correction.swift
T
JP SimardandGitHub 603fff9a82 Make Correction and CorrectableRule declarations public (#4937)
The CLI target shouldn't be importing SwiftLintFramework with
`@_spi(TestHelper)`. If the CLI target needs to access something in
SwiftLintFramework, that declaration should be `public`.
2023-04-26 12:17:10 -04:00

22 lines
905 B
Swift

/// A value describing a SwiftLint violation that was corrected.
public struct Correction: Equatable {
/// The description of the rule for which this correction was applied.
public let ruleDescription: RuleDescription
/// The location of the original violation that was corrected.
public let location: Location
/// The console-printable description for this correction.
public var consoleDescription: String {
return "\(location) Corrected \(ruleDescription.name)"
}
/// Memberwise initializer.
///
/// - parameter ruleDescription: The description of the rule for which this correction was applied.
/// - parameter location: The location of the original violation that was corrected.
public init(ruleDescription: RuleDescription, location: Location) {
self.ruleDescription = ruleDescription
self.location = location
}
}