EffectiveAccessControlSyntaxVisitor

open class EffectiveAccessControlSyntaxVisitor<Configuration: RuleConfiguration>:
        ViolationsSyntaxVisitor<Configuration>

A ViolationsSyntaxVisitor with helpers to compute effective access control levels for declarations.

  • Whether to apply the effective access control level computation or to use the explicitly declared access control level.

    Declaration

    Swift

    public let evaluateEffectiveAcl: Bool
  • Creates a new EffectiveAccessControlSyntaxVisitor.

    Declaration

    Swift

    @inlinable
    public init(configuration: Configuration, file: SwiftLintFile, evaluateEffectiveAcl: Bool = true)

    Parameters

    configuration

    The rule configuration to use for this visitor.

    file

    The file to analyze.

    evaluateEffectiveAcl

    Whether to apply the effective access control level computation or to use the explicitly declared access control level.

  • Computes the effective access control level for a declaration.

    Declaration

    Swift

    public func effectiveAccessControlLevel(for modifiers: DeclModifierListSyntax) -> AccessControlLevel

    Parameters

    modifiers

    Declaration modifiers that may contain an explicit access control level.

    Return Value

    Effective access control level of this declaration.

  • Access control level of the current enum scope.

    Declaration

    Swift

    public var enumAccessControlLevel: AccessControlLevel? { get }

    Return Value

    Access control level if currently in an enum scope.

  • Whether the current declaration context is local.

    Declaration

    Swift

    public var isInLocalAccessControlScope: Bool { get }

Automatic Scope Management