mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
21 lines
830 B
Swift
21 lines
830 B
Swift
import SwiftLintCore
|
|
|
|
@AutoApply
|
|
struct SortedImportsConfiguration: SeverityBasedRuleConfiguration, Equatable {
|
|
typealias Parent = SortedImportsRule
|
|
|
|
@MakeAcceptableByConfigurationElement
|
|
enum SortedImportsGroupingConfiguration: String {
|
|
/// Sorts import lines based on any import attributes (e.g. `@testable`, `@_exported`, etc.), followed by a case
|
|
/// insensitive comparison of the imported module name.
|
|
case attributes
|
|
/// Sorts import lines based on a case insensitive comparison of the imported module name.
|
|
case names
|
|
}
|
|
|
|
@ConfigurationElement(key: "severity")
|
|
private(set) var severityConfiguration = SeverityConfiguration<Parent>(.warning)
|
|
@ConfigurationElement(key: "grouping")
|
|
private(set) var grouping = SortedImportsGroupingConfiguration.names
|
|
}
|