mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
7933d7c23a
pre-correction keys map to post-correction values
36 lines
1.1 KiB
Swift
36 lines
1.1 KiB
Swift
//
|
|
// RuleDescription.swift
|
|
// SwiftLint
|
|
//
|
|
// Created by Chris Eidhof on 25/05/15.
|
|
// Copyright (c) 2015 Realm. All rights reserved.
|
|
//
|
|
|
|
public struct RuleDescription: Equatable {
|
|
public let identifier: String
|
|
public let name: String
|
|
public let description: String
|
|
public let nonTriggeringExamples: [String]
|
|
public let triggeringExamples: [String]
|
|
public let corrections: [String: String]
|
|
|
|
public var consoleDescription: String { return "\(name) (\(identifier)): \(description)" }
|
|
|
|
public init(identifier: String, name: String, description: String,
|
|
nonTriggeringExamples: [String] = [], triggeringExamples: [String] = [],
|
|
corrections: [String: String] = [:]) {
|
|
self.identifier = identifier
|
|
self.name = name
|
|
self.description = description
|
|
self.nonTriggeringExamples = nonTriggeringExamples
|
|
self.triggeringExamples = triggeringExamples
|
|
self.corrections = corrections
|
|
}
|
|
}
|
|
|
|
// MARK: Equatable
|
|
|
|
public func == (lhs: RuleDescription, rhs: RuleDescription) -> Bool {
|
|
return lhs.identifier == rhs.identifier
|
|
}
|