ReasonedRuleViolation
public struct ReasonedRuleViolation : Comparable, Hashable
A violation produced by ViolationsSyntaxVisitors.
-
The correction of a violation that is basically the violation’s range in the source code and a replacement for this range that would fix the violation.
See moreDeclaration
Swift
public struct ViolationCorrection : Hashable -
The violation’s position.
Declaration
Swift
public let position: AbsolutePosition -
A specific reason for the violation.
Declaration
Swift
public let reason: String? -
The violation’s severity.
Declaration
Swift
public let severity: ViolationSeverity? -
An optional correction of the violation to be used in rewriting (see
SwiftSyntaxCorrectableRule). Can be left unset when creating a violation, especially if the rule is not correctable or provides a custom rewriter.Declaration
Swift
public let correction: ViolationCorrection? -
Creates a
ReasonedRuleViolation.Declaration
Swift
public init(position: AbsolutePosition, reason: String? = nil, severity: ViolationSeverity? = nil, correction: ViolationCorrection? = nil)Parameters
positionThe violations position in the analyzed source file.
reasonThe reason for the violation if different from the rule’s description.
severityThe severity of the violation if different from the rule’s default configured severity.
correctionAn optional correction of the violation to be used in rewriting.
-
Declaration
Swift
public static func < (lhs: `Self`, rhs: `Self`) -> Bool
View on GitHub
Install in Dash