mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
25 lines
650 B
Swift
25 lines
650 B
Swift
//
|
|
// RuleConfiguration.swift
|
|
// SwiftLint
|
|
//
|
|
// Created by Scott Hoyt on 1/19/16.
|
|
// Copyright © 2016 Realm. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public protocol RuleConfiguration {
|
|
mutating func applyConfiguration(configuration: AnyObject) throws
|
|
func isEqualTo(ruleConfiguration: RuleConfiguration) -> Bool
|
|
var consoleDescription: String { get }
|
|
}
|
|
|
|
extension RuleConfiguration where Self: Equatable {
|
|
public func isEqualTo(ruleConfiguration: RuleConfiguration) -> Bool {
|
|
if let ruleConfiguration = ruleConfiguration as? Self {
|
|
return self == ruleConfiguration
|
|
}
|
|
return false
|
|
}
|
|
}
|