mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
There's no reason to expose these publicly and this will make it nicer to move to a new module outside of the core SwiftLint functionality.
22 lines
797 B
Swift
22 lines
797 B
Swift
struct MultilineParametersConfiguration: SeverityBasedRuleConfiguration, Equatable {
|
|
private(set) var severityConfiguration = SeverityConfiguration(.warning)
|
|
private(set) var allowsSingleLine = true
|
|
|
|
var consoleDescription: String {
|
|
severityConfiguration.consoleDescription
|
|
+ ", allowsSingleLine: \(allowsSingleLine)"
|
|
}
|
|
|
|
mutating func apply(configuration: Any) throws {
|
|
guard let configuration = configuration as? [String: Any] else {
|
|
throw ConfigurationError.unknownConfiguration
|
|
}
|
|
|
|
allowsSingleLine = configuration["allows_single_line"] as? Bool ?? true
|
|
|
|
if let severityString = configuration["severity"] as? String {
|
|
try severityConfiguration.apply(configuration: severityString)
|
|
}
|
|
}
|
|
}
|