Baseline
public struct Baseline : Equatable
A set of violations that can be used to filter newly detected violations.
-
The stored violations.
Declaration
Swift
public var violations: [StyleViolation] { get } -
Creates a
Baselinefrom a saved file.Declaration
Swift
public init(fromPath path: String) throwsParameters
fromPathThe path to read from.
-
Creates a
Baselinefrom a list of violations.Declaration
Swift
public init(violations: [StyleViolation])Parameters
violationsThe violations for the baseline.
-
Writes a
Baselineto disk in JSON format.Declaration
Swift
public func write(toPath path: String) throwsParameters
toPathThe path to write to.
-
Filters out violations that are present in the
Baseline.Assumes that all violations are from the same file.
Declaration
Swift
public func filter(_ violations: [StyleViolation]) -> [StyleViolation]Parameters
violationsThe violations to filter.
Return Value
The new violations.
-
Returns the violations that are present in another
Baseline, but not in this one.The violations are filtered using the same algorithm as the
filtermethod above.Declaration
Swift
public func compare(_ otherBaseline: `Self`) -> [StyleViolation]Parameters
otherBaselineThe other
Baseline.
View on GitHub
Install in Dash