mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
28 lines
969 B
Swift
28 lines
969 B
Swift
import SwiftLintCore
|
|
|
|
@AutoConfigParser
|
|
struct IndentationWidthConfiguration: SeverityBasedRuleConfiguration {
|
|
typealias Parent = IndentationWidthRule
|
|
|
|
private static let defaultIndentationWidth = 4
|
|
|
|
@ConfigurationElement(key: "severity")
|
|
private(set) var severityConfiguration = SeverityConfiguration<Parent>.warning
|
|
@ConfigurationElement(
|
|
key: "indentation_width",
|
|
postprocessor: {
|
|
if $0 < 1 {
|
|
Issue.invalidConfiguration(ruleID: Parent.identifier).print()
|
|
$0 = Self.defaultIndentationWidth
|
|
}
|
|
}
|
|
)
|
|
private(set) var indentationWidth = 4
|
|
@ConfigurationElement(key: "include_comments")
|
|
private(set) var includeComments = true
|
|
@ConfigurationElement(key: "include_compiler_directives")
|
|
private(set) var includeCompilerDirectives = true
|
|
@ConfigurationElement(key: "include_multiline_strings")
|
|
private(set) var includeMultilineStrings = true
|
|
}
|