Skip to content

Commit

Permalink
Remove unused SubstitutionCorrectableASTRule protocol (realm#5312)
Browse files Browse the repository at this point in the history
Last use was removed in realm#4192.
  • Loading branch information
jpsim authored Oct 30, 2023
1 parent 686dc3d commit bc7d3c0
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions Source/SwiftLintCore/Protocols/Rule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,28 +198,6 @@ public extension SubstitutionCorrectableRule {
}
}

/// A `SubstitutionCorrectableRule` that is also an `ASTRule`.
public protocol SubstitutionCorrectableASTRule: SubstitutionCorrectableRule, ASTRule {
/// Returns the NSString-based `NSRange`s to be replaced in the specified file.
///
/// - parameter file: The file in which to find ranges of violations for this rule.
/// - parameter kind: The kind of token being recursed over.
/// - parameter dictionary: The dictionary for an AST subset to validate.
///
/// - returns: The NSString-based `NSRange`s to be replaced in the specified file.
func violationRanges(in file: SwiftLintFile, kind: KindType,
dictionary: SourceKittenDictionary) -> [NSRange]
}

public extension SubstitutionCorrectableASTRule {
func violationRanges(in file: SwiftLintFile) -> [NSRange] {
return file.structureDictionary.traverseDepthFirst { subDict in
guard let kind = self.kind(from: subDict) else { return nil }
return violationRanges(in: file, kind: kind, dictionary: subDict)
}
}
}

/// A rule that does not need SourceKit to operate and can still operate even after SourceKit has crashed.
public protocol SourceKitFreeRule: Rule {}

Expand Down

0 comments on commit bc7d3c0

Please sign in to comment.