BodyLengthVisitor
open class BodyLengthVisitor<LevelConfig> : ViolationsSyntaxVisitor<LevelConfig> where LevelConfig : SeverityLevelsBasedRuleConfiguration
Violation visitor customized to collect violations of code blocks that exceed a specified number of lines.
-
Declaration
Swift
@inlinable override public init(configuration: LevelConfig, file: SwiftLintFile) -
Registers a violation if a body exceeds the configured line count.
Declaration
Swift
public func registerViolations(leftBrace: TokenSyntax, rightBrace: TokenSyntax, violationNode: some SyntaxProtocol, objectName: String)Parameters
leftBraceThe left brace token of the body.
rightBraceThe right brace token of the body.
violationNodeThe syntax node where the violation is to be reported.
objectNameThe name of the object (e.g., “Function”, “Closure”) used in the violation message.
View on GitHub
Install in Dash