mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
9bc16b539b
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
28 lines
1.0 KiB
Swift
28 lines
1.0 KiB
Swift
import SwiftLintCore
|
|
|
|
@AutoConfigParser
|
|
struct IndentationWidthConfiguration: SeverityBasedRuleConfiguration {
|
|
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
|
|
@ConfigurationElement(key: "include_multiline_conditions")
|
|
private(set) var includeMultilineConditions = false
|
|
}
|