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`.
This commit is contained in:
JP Simard 2023-04-26 12:17:10 -04:00 committed by GitHub
parent 2544dc79d3
commit 603fff9a82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 10 deletions

View File

@ -1,5 +1,4 @@
/// A value describing a SwiftLint violation that was corrected.
@_spi(TestHelper)
public struct Correction: Equatable {
/// The description of the rule for which this correction was applied.
public let ruleDescription: RuleDescription
@ -11,10 +10,11 @@ public struct Correction: Equatable {
return "\(location) Corrected \(ruleDescription.name)"
}
public init (
ruleDescription: RuleDescription,
location: Location
) {
/// 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
}

View File

@ -281,7 +281,6 @@ public struct CollectedLinter {
/// - parameter storage: The storage object containing all collected info.
///
/// - returns: All corrections that were applied.
@_spi(TestHelper)
public func correct(using storage: RuleStorage) -> [Correction] {
if let violations = cachedStyleViolations()?.0, violations.isEmpty {
return []

View File

@ -101,7 +101,6 @@ public protocol ConfigurationProviderRule: Rule {
}
/// A rule that can correct violations.
@_spi(TestHelper)
public protocol CorrectableRule: Rule {
/// Attempts to correct the violations to this rule in the specified file.
///

View File

@ -7,7 +7,6 @@ import Glibc
#error("Unsupported platform")
#endif
import Foundation
@_spi(TestHelper)
import SwiftLintFramework
import SwiftyTextTable

View File

@ -1,6 +1,5 @@
import Dispatch
import Foundation
@_spi(TestHelper)
import SwiftLintFramework
enum LintOrAnalyzeMode {

View File

@ -1,4 +1,3 @@
@_spi(TestHelper)
import SwiftLintFramework
extension RulesFilter {