mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
19 lines
661 B
Swift
19 lines
661 B
Swift
import SwiftLintCore
|
|
|
|
@AutoConfigParser
|
|
struct VerticalWhitespaceConfiguration: SeverityBasedRuleConfiguration {
|
|
static let defaultDescriptionReason = "Limit vertical whitespace to a single empty line"
|
|
|
|
@ConfigurationElement(key: "severity")
|
|
private(set) var severityConfiguration = SeverityConfiguration<Parent>(.warning)
|
|
@ConfigurationElement(key: "max_empty_lines")
|
|
private(set) var maxEmptyLines = 1
|
|
|
|
var configuredDescriptionReason: String {
|
|
guard maxEmptyLines == 1 else {
|
|
return "Limit vertical whitespace to maximum \(maxEmptyLines) empty lines"
|
|
}
|
|
return Self.defaultDescriptionReason
|
|
}
|
|
}
|