StyleViolation
public struct StyleViolation : CustomStringConvertible, Codable, Hashable
A value describing an instance of Swift source code that is considered invalid by a SwiftLint rule.
-
The identifier of the rule that generated this violation.
Declaration
Swift
public let ruleIdentifier: String -
The description of the rule that generated this violation.
Declaration
Swift
public let ruleDescription: String -
The name of the rule that generated this violation.
Declaration
Swift
public let ruleName: String -
The severity of this violation.
Declaration
Swift
public private(set) var severity: ViolationSeverity { get } -
The location of this violation.
Declaration
Swift
public private(set) var location: Location { get } -
The justification for this violation.
Declaration
Swift
public let reason: String -
A printable description for this violation.
Declaration
Swift
public var description: String { get } -
Creates a
StyleViolationby specifying its properties directly.Declaration
Swift
public init(ruleDescription: RuleDescription, severity: ViolationSeverity = .warning, location: Location, reason: String? = nil)Parameters
ruleDescriptionThe description of the rule that generated this violation.
severityThe severity of this violation.
locationThe location of this violation.
reasonThe justification for this violation. If not specified the rule’s description will be used.
-
Returns the same violation, but with the
severitythat is passed inDeclaration
Swift
public func with(severity: ViolationSeverity) -> StyleViolationParameters
severitythe new severity to use in the modified violation
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
View on GitHub
Install in Dash