Skip to content

Commit

Permalink
Let RuleConfigurations be equatable by default (realm#5257)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny authored Oct 3, 2023
1 parent e30065e commit 0934c18
Show file tree
Hide file tree
Showing 68 changed files with 68 additions and 81 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct AttributesConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct AttributesConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = AttributesRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct BlanketDisableCommandConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct BlanketDisableCommandConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = BlanketDisableCommandRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct CollectionAlignmentConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct CollectionAlignmentConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = CollectionAlignmentRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ColonConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ColonConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ColonRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ComputedAccessorsOrderConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ComputedAccessorsOrderConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ComputedAccessorsOrderRule

@MakeAcceptableByConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ConditionalReturnsOnNewlineConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ConditionalReturnsOnNewlineConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ConditionalReturnsOnNewlineRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SourceKittenFramework
import SwiftLintCore

@AutoApply
struct CyclomaticComplexityConfiguration: RuleConfiguration, Equatable {
struct CyclomaticComplexityConfiguration: RuleConfiguration {
typealias Parent = CyclomaticComplexityRule

private static let defaultComplexityStatements: Set<StatementKind> = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
struct DeploymentTargetConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct DeploymentTargetConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = DeploymentTargetRule

enum Platform: String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftLintCore
// swiftlint:disable let_var_whitespace

@AutoApply
struct DiscouragedDirectInitConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct DiscouragedDirectInitConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = DiscouragedDirectInitRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct EmptyCountConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct EmptyCountConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = EmptyCountRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ExpiringTodoConfiguration: RuleConfiguration, Equatable {
struct ExpiringTodoConfiguration: RuleConfiguration {
typealias Parent = ExpiringTodoRule
typealias Severity = SeverityConfiguration<Parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@AutoApply
struct ExplicitInitConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ExplicitInitConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ExplicitInitRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ExplicitTypeInterfaceConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ExplicitTypeInterfaceConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ExplicitTypeInterfaceRule

@MakeAcceptableByConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation
import SourceKittenFramework
import SwiftLintCore

struct FileHeaderConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct FileHeaderConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = FileHeaderRule

private static let fileNamePlaceholder = "SWIFTLINT_CURRENT_FILENAME"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct FileLengthConfiguration: RuleConfiguration, Equatable {
struct FileLengthConfiguration: RuleConfiguration {
typealias Parent = FileLengthRule

@ConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct FileNameConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct FileNameConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = FileNameRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct FileNameNoSpaceConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct FileNameNoSpaceConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = FileNameNoSpaceRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct FileTypesOrderConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct FileTypesOrderConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = FileTypesOrderRule

@MakeAcceptableByConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ForWhereConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ForWhereConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ForWhereRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct FunctionParameterCountConfiguration: RuleConfiguration, Equatable {
struct FunctionParameterCountConfiguration: RuleConfiguration {
typealias Parent = FunctionParameterCountRule

@ConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ImplicitReturnConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ImplicitReturnConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ImplicitReturnRule

@MakeAcceptableByConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ImplicitlyUnwrappedOptionalConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ImplicitlyUnwrappedOptionalConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ImplicitlyUnwrappedOptionalRule

@MakeAcceptableByConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct InclusiveLanguageConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct InclusiveLanguageConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = InclusiveLanguageRule

private static let defaultTerms: Set<String> = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SwiftLintCore
// swiftlint:disable let_var_whitespace

@AutoApply
struct IndentationWidthConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct IndentationWidthConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = IndentationWidthRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct LineLengthConfiguration: RuleConfiguration, Equatable {
struct LineLengthConfiguration: RuleConfiguration {
typealias Parent = LineLengthRule

@ConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SwiftLintCore

struct MissingDocsConfiguration: RuleConfiguration, Equatable {
struct MissingDocsConfiguration: RuleConfiguration {
typealias Parent = MissingDocsRule

private(set) var parameters = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SourceKittenFramework
import SwiftLintCore

@AutoApply
struct ModifierOrderConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ModifierOrderConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ModifierOrderRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct MultilineArgumentsConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct MultilineArgumentsConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = MultilineArgumentsRule

@MakeAcceptableByConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct MultilineParametersConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct MultilineParametersConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = MultilineParametersRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import SwiftLintCore

struct NameConfiguration<Parent: Rule>: RuleConfiguration, Equatable {
struct NameConfiguration<Parent: Rule>: RuleConfiguration {
typealias Severity = SeverityConfiguration<Parent>
typealias SeverityLevels = SeverityLevelsConfiguration<Parent>
typealias StartWithLowercaseConfiguration = ChildOptionSeverityConfiguration<Parent>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct NestingConfiguration: RuleConfiguration, Equatable {
struct NestingConfiguration: RuleConfiguration {
typealias Parent = NestingRule
typealias Severity = SeverityLevelsConfiguration<Parent>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply // swiftlint:disable:next type_name
struct NonOverridableClassDeclarationConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct NonOverridableClassDeclarationConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = NonOverridableClassDeclarationRule

@MakeAcceptableByConfigurationElement
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct NumberSeparatorConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct NumberSeparatorConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = NumberSeparatorRule

struct ExcludeRange: AcceptableByConfigurationElement, Equatable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SwiftLintCore
typealias DiscouragedObjectLiteralConfiguration = ObjectLiteralConfiguration<DiscouragedObjectLiteralRule>

@AutoApply
struct ObjectLiteralConfiguration<Parent: Rule>: SeverityBasedRuleConfiguration, Equatable {
struct ObjectLiteralConfiguration<Parent: Rule>: SeverityBasedRuleConfiguration {
@ConfigurationElement(key: "severity")
private(set) var severityConfiguration = SeverityConfiguration<Parent>(.warning)
@ConfigurationElement(key: "image_literal")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct OpeningBraceConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct OpeningBraceConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = OpeningBraceRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct OperatorUsageWhitespaceConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct OperatorUsageWhitespaceConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = OperatorUsageWhitespaceRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct OverriddenSuperCallConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct OverriddenSuperCallConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = OverriddenSuperCallRule

private static let defaultIncluded = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct PrefixedTopLevelConstantConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct PrefixedTopLevelConstantConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = PrefixedTopLevelConstantRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct PrivateOutletConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct PrivateOutletConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = PrivateOutletRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct PrivateOverFilePrivateConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct PrivateOverFilePrivateConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = PrivateOverFilePrivateRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import SwiftLintCore

struct PrivateUnitTestConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct PrivateUnitTestConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = PrivateUnitTestRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct ProhibitedSuperConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct ProhibitedSuperConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = ProhibitedSuperRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
struct RequiredEnumCaseConfiguration: RuleConfiguration, Equatable {
struct RequiredEnumCaseConfiguration: RuleConfiguration {
typealias Parent = RequiredEnumCaseRule

struct RequiredCase: Hashable {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct SelfBindingConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct SelfBindingConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = SelfBindingRule

@ConfigurationElement(key: "severity")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftLintCore

@AutoApply
struct SortedImportsConfiguration: SeverityBasedRuleConfiguration, Equatable {
struct SortedImportsConfiguration: SeverityBasedRuleConfiguration {
typealias Parent = SortedImportsRule

@MakeAcceptableByConfigurationElement
Expand Down
Loading

0 comments on commit 0934c18

Please sign in to comment.