Files
SwiftLint/Source/SwiftLintFramework/Models/RuleDescription.swift
T
JP Simard b83e0991b9 Remove all file headers
The MIT license doesn't require that all files be prepended with this
licensing or copyright information. Realm confirmed that they're ok with this
change. This will enable some companies to contribute to SwiftLint and the
date & authorship information will remain accessible via git source control.
2018-05-04 13:42:02 -07:00

40 lines
1.4 KiB
Swift

public struct RuleDescription: Equatable {
public let identifier: String
public let name: String
public let description: String
public let kind: RuleKind
public let nonTriggeringExamples: [String]
public let triggeringExamples: [String]
public let corrections: [String: String]
public let deprecatedAliases: Set<String>
public let minSwiftVersion: SwiftVersion
public var consoleDescription: String { return "\(name) (\(identifier)): \(description)" }
public var allIdentifiers: [String] {
return Array(deprecatedAliases) + [identifier]
}
public init(identifier: String, name: String, description: String, kind: RuleKind,
minSwiftVersion: SwiftVersion = .three,
nonTriggeringExamples: [String] = [], triggeringExamples: [String] = [],
corrections: [String: String] = [:],
deprecatedAliases: Set<String> = []) {
self.identifier = identifier
self.name = name
self.description = description
self.kind = kind
self.nonTriggeringExamples = nonTriggeringExamples
self.triggeringExamples = triggeringExamples
self.corrections = corrections
self.deprecatedAliases = deprecatedAliases
self.minSwiftVersion = minSwiftVersion
}
}
// MARK: Equatable
public func == (lhs: RuleDescription, rhs: RuleDescription) -> Bool {
return lhs.identifier == rhs.identifier
}