mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
18 lines
732 B
Swift
18 lines
732 B
Swift
/// A configuration parameter for rules.
|
|
@preconcurrency
|
|
public struct RuleParameter<T: Equatable>: Equatable, Sendable where T: Sendable {
|
|
/// The severity that should be assigned to the violation of this parameter's value is met.
|
|
public let severity: ViolationSeverity
|
|
/// The value to configure the rule.
|
|
public let value: T
|
|
|
|
/// Creates a `RuleParameter` by specifying its properties directly.
|
|
///
|
|
/// - parameter severity: The severity that should be assigned to the violation of this parameter's value is met.
|
|
/// - parameter value: The value to configure the rule.
|
|
public init(severity: ViolationSeverity, value: T) {
|
|
self.severity = severity
|
|
self.value = value
|
|
}
|
|
}
|