ViolationsSyntaxVisitor

open class ViolationsSyntaxVisitor<Configuration> : SyntaxVisitor where Configuration : RuleConfiguration

A SwiftSyntax SyntaxVisitor that produces absolute positions where violations should be reported.

  • 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 source location converter associated with the syntax tree being traversed.

    Declaration

    Swift

    public lazy var locationConverter: SourceLocationConverter { get set }
  • Initializer for a ViolationsSyntaxVisitor.

    Declaration

    Swift

    @inlinable
    public init(configuration: Configuration, file: SwiftLintFile)

    Parameters

    configuration

    Configuration of a rule.

    file

    File from which the syntax tree stems from.

  • Positions in a source file where violations should be reported.

    Declaration

    Swift

    public var violations: [ReasonedRuleViolation]
  • List of declaration types that shall be skipped while traversing the AST.

    Declaration

    Swift

    open var skippableDeclarations: [any DeclSyntaxProtocol.Type] { get }
  • Declaration

    Swift

    override open func visit(_ node: ActorDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: ClassDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: EnumDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: ExtensionDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: InitializerDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: ProtocolDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: StructDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: SubscriptDeclSyntax) -> SyntaxVisitorContinueKind
  • Declaration

    Swift

    override open func visit(_ node: VariableDeclSyntax) -> SyntaxVisitorContinueKind