ViolationsSyntaxRewriter
open class ViolationsSyntaxRewriter<Configuration> : SyntaxRewriter where Configuration : RuleConfiguration
A SwiftSyntax SyntaxRewriter
that produces absolute positions where corrections were applied.
-
A rule’s configuration.
Declaration
Swift
public let configuration: Configuration
-
The file from which the traversed syntax tree stems from.
Declaration
Swift
public let file: SwiftLintFile
-
A converter of positions in the traversed source file.
Declaration
Swift
public lazy var locationConverter: SourceLocationConverter { get set }
-
The regions in the traversed file that are disabled by a command.
Declaration
Swift
public lazy var disabledRegions: [SourceRange] { get set }
-
Positions in a source file where corrections were applied.
Declaration
Swift
public var correctionPositions: [AbsolutePosition]
-
Initializer for a
ViolationsSyntaxRewriter
.Declaration
Swift
@inlinable public init(configuration: Configuration, file: SwiftLintFile)
Parameters
configuration
Configuration of a rule.
file
File from which the syntax tree stems from.
-
Declaration
Swift
override open func visitAny(_ node: Syntax) -> Syntax?