Skip to content

Commit

Permalink
Use violation as part of the key as well, as we use that when compari…
Browse files Browse the repository at this point in the history
…ng equality
  • Loading branch information
mildm8nnered committed Mar 24, 2024
1 parent 590d2da commit 795d71c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/SwiftLintCore/Models/Baseline.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ private typealias GroupedViolations = [String: [BaselineViolation]]
private struct BaselineViolation: Equatable, Codable, Hashable {
let violation: StyleViolation
let text: String
var key: String { text + violation.reason }
var key: String { text + violation.reason + violation.severity.rawValue }

init(violation: StyleViolation, text: String) {
let location = violation.location
Expand Down Expand Up @@ -56,6 +56,8 @@ public struct Baseline: Equatable {

/// Filters out violations that are present in the `Baseline`.
///
/// Assumes that all violations are from the same file.
///
/// - parameter violations: The violations to filter.
/// - Returns: The new violations.
public func filter(_ violations: [StyleViolation]) -> [StyleViolation] {
Expand Down

0 comments on commit 795d71c

Please sign in to comment.