mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Split RulesTests into several test cases, generating them automatically
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import SwiftLintFramework
|
||||
import XCTest
|
||||
|
||||
// swiftlint:disable file_length single_test_class type_name
|
||||
|
||||
{% for rule in types.structs|based:"AutomaticTestableRule" %}
|
||||
class {{ rule.name }}Tests: XCTestCase {
|
||||
func testWithDefaultConfiguration() {
|
||||
verifyRule({{ rule.name }}.description)
|
||||
}
|
||||
}
|
||||
|
||||
{% endfor %}
|
||||
// just to avoid a file_name warning
|
||||
private struct AutomaticRuleTests {}
|
||||
@@ -35,16 +35,20 @@ VERSION_STRING=$(shell /usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionSt
|
||||
|
||||
all: build
|
||||
|
||||
sourcery: Tests/LinuxMain.swift Source/SwiftLintFramework/Models/MasterRuleList.swift
|
||||
sourcery: Tests/LinuxMain.swift Source/SwiftLintFramework/Models/MasterRuleList.swift Tests/SwiftLintFrameworkTests/AutomaticRuleTests.swift
|
||||
|
||||
Tests/LinuxMain.swift: Tests/*/*.swift .sourcery/LinuxMain.stencil
|
||||
sourcery --sources Tests --templates .sourcery/LinuxMain.stencil --output .sourcery
|
||||
sourcery --sources Tests --templates .sourcery/LinuxMain.stencil --output .sourcery --force-parse generated
|
||||
mv .sourcery/LinuxMain.generated.swift Tests/LinuxMain.swift
|
||||
|
||||
Source/SwiftLintFramework/Models/MasterRuleList.swift: Source/SwiftLintFramework/Rules/*.swift .sourcery/MasterRuleList.stencil
|
||||
sourcery --sources Source/SwiftLintFramework/Rules --templates .sourcery/MasterRuleList.stencil --output .sourcery
|
||||
mv .sourcery/MasterRuleList.generated.swift Source/SwiftLintFramework/Models/MasterRuleList.swift
|
||||
|
||||
Tests/SwiftLintFrameworkTests/AutomaticRuleTests.generated.swift: Source/SwiftLintFramework/Rules/*.swift .sourcery/AutomaticRuleTests.stencil
|
||||
sourcery --sources Source/SwiftLintFramework/Rules --templates .sourcery/AutomaticRuleTests.stencil --output .sourcery
|
||||
mv .sourcery/AutomaticRuleTests.generated.swift Tests/SwiftLintFrameworkTests/AutomaticRuleTests.generated.swift
|
||||
|
||||
bootstrap:
|
||||
script/bootstrap
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Generated using Sourcery 0.13.1 — https://github.com/krzysztofzablocki/Sourcery
|
||||
// Generated using Sourcery 0.11.2 — https://github.com/krzysztofzablocki/Sourcery
|
||||
// DO NOT EDIT
|
||||
|
||||
public let masterRuleList = RuleList(rules: [
|
||||
|
||||
@@ -23,6 +23,8 @@ extension Rule {
|
||||
|
||||
public protocol OptInRule: Rule {}
|
||||
|
||||
public protocol AutomaticTestableRule: Rule {}
|
||||
|
||||
public protocol ConfigurationProviderRule: Rule {
|
||||
associatedtype ConfigurationType: RuleConfiguration
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct AnyObjectProtocolRule: ASTRule, OptInRule, CorrectableRule, ConfigurationProviderRule {
|
||||
public struct AnyObjectProtocolRule: ASTRule, OptInRule, CorrectableRule,
|
||||
ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ArrayInitRule: ASTRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct ArrayInitRule: ASTRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct BlockBasedKVORule: ASTRule, ConfigurationProviderRule {
|
||||
public struct BlockBasedKVORule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ClassDelegateProtocolRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct ClassDelegateProtocolRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -7,7 +7,7 @@ private extension File {
|
||||
}
|
||||
}
|
||||
|
||||
public struct ClosingBraceRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct ClosingBraceRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ClosureEndIndentationRule: Rule, OptInRule, ConfigurationProviderRule {
|
||||
public struct ClosureEndIndentationRule: Rule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ClosureParameterPositionRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct ClosureParameterPositionRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -16,7 +16,7 @@ extension NSRange {
|
||||
}
|
||||
}
|
||||
|
||||
public struct ClosureSpacingRule: CorrectableRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct ClosureSpacingRule: CorrectableRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct CommaRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct CommaRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct CompilerProtocolInitRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct CompilerProtocolInitRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ConditionalReturnsOnNewlineRule: ConfigurationProviderRule, Rule, OptInRule {
|
||||
public struct ConditionalReturnsOnNewlineRule: ConfigurationProviderRule, Rule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ContainsOverFirstNotNilRule: CallPairRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct ContainsOverFirstNotNilRule: CallPairRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ControlStatementRule: ConfigurationProviderRule {
|
||||
public struct ControlStatementRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ConvenienceTypeRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct ConvenienceTypeRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct DiscardedNotificationCenterObserverRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct DiscardedNotificationCenterObserverRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct DiscouragedObjectLiteralRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct DiscouragedObjectLiteralRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct DiscouragedOptionalBooleanRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct DiscouragedOptionalBooleanRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct DiscouragedOptionalCollectionRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct DiscouragedOptionalCollectionRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct DynamicInlineRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct DynamicInlineRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.error)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct EmptyCountRule: ConfigurationProviderRule, OptInRule {
|
||||
public struct EmptyCountRule: ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.error)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -18,7 +18,7 @@ private func wrapInFunc(_ str: String) -> String {
|
||||
"""
|
||||
}
|
||||
|
||||
public struct EmptyEnumArgumentsRule: ASTRule, ConfigurationProviderRule, CorrectableRule {
|
||||
public struct EmptyEnumArgumentsRule: ASTRule, ConfigurationProviderRule, CorrectableRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct EmptyParametersRule: ConfigurationProviderRule, CorrectableRule {
|
||||
public struct EmptyParametersRule: ConfigurationProviderRule, CorrectableRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct EmptyParenthesesWithTrailingClosureRule: ASTRule, CorrectableRule, ConfigurationProviderRule {
|
||||
public struct EmptyParenthesesWithTrailingClosureRule: ASTRule, CorrectableRule, ConfigurationProviderRule,
|
||||
AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct EmptyStringRule: ConfigurationProviderRule, OptInRule {
|
||||
public struct EmptyStringRule: ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct EmptyXCTestMethodRule: Rule, OptInRule, ConfigurationProviderRule {
|
||||
public struct EmptyXCTestMethodRule: Rule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import SourceKittenFramework
|
||||
|
||||
private typealias SourceKittenElement = [String: SourceKitRepresentable]
|
||||
|
||||
public struct ExplicitACLRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct ExplicitACLRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ExplicitEnumRawValueRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct ExplicitEnumRawValueRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ExplicitInitRule: ASTRule, ConfigurationProviderRule, CorrectableRule, OptInRule {
|
||||
public struct ExplicitInitRule: ASTRule, ConfigurationProviderRule, CorrectableRule, OptInRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ExplicitTopLevelACLRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct ExplicitTopLevelACLRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ExtensionAccessModifierRule: ASTRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct ExtensionAccessModifierRule: ASTRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct FallthroughRule: ConfigurationProviderRule, OptInRule {
|
||||
public struct FallthroughRule: ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct FatalErrorMessageRule: ASTRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct FatalErrorMessageRule: ASTRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct FirstWhereRule: CallPairRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct FirstWhereRule: CallPairRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ForWhereRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct ForWhereRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ForceCastRule: ConfigurationProviderRule {
|
||||
public struct ForceCastRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.error)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ForceTryRule: ConfigurationProviderRule {
|
||||
public struct ForceTryRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.error)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ForceUnwrappingRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct ForceUnwrappingRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct FunctionDefaultParameterAtEndRule: ASTRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct FunctionDefaultParameterAtEndRule: ASTRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ImplicitGetterRule: ConfigurationProviderRule {
|
||||
public struct ImplicitGetterRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ImplicitReturnRule: ConfigurationProviderRule, CorrectableRule, OptInRule {
|
||||
public struct ImplicitReturnRule: ConfigurationProviderRule, CorrectableRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct IsDisjointRule: ConfigurationProviderRule {
|
||||
public struct IsDisjointRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct JoinedDefaultParameterRule: ASTRule, ConfigurationProviderRule, OptInRule, CorrectableRule {
|
||||
public struct JoinedDefaultParameterRule: ASTRule, ConfigurationProviderRule, OptInRule, CorrectableRule,
|
||||
AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -10,7 +10,7 @@ private enum RangeKind {
|
||||
case generic
|
||||
}
|
||||
|
||||
public struct LargeTupleRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct LargeTupleRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityLevelsConfiguration(warning: 2, error: 3)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct LegacyCGGeometryFunctionsRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct LegacyCGGeometryFunctionsRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct LegacyConstantRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct LegacyConstantRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct LegacyConstructorRule: ASTRule, CorrectableRule, ConfigurationProviderRule {
|
||||
public struct LegacyConstructorRule: ASTRule, CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct LegacyNSGeometryFunctionsRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct LegacyNSGeometryFunctionsRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct LetVarWhitespaceRule: ConfigurationProviderRule, OptInRule {
|
||||
public struct LetVarWhitespaceRule: ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct LiteralExpressionEndIdentationRule: Rule, ConfigurationProviderRule, OptInRule {
|
||||
public struct LiteralExpressionEndIdentationRule: Rule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct LowerACLThanParentRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct LowerACLThanParentRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct MultilineFunctionChainsRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct MultilineFunctionChainsRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct MultilineParametersRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct MultilineParametersRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
private typealias ParameterRange = (offset: Int, length: Int)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct MultipleClosuresWithTrailingClosureRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct MultipleClosuresWithTrailingClosureRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct NestingRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct NestingRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = NestingConfiguration(typeLevelWarning: 1,
|
||||
typeLevelError: nil,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct NimbleOperatorRule: ConfigurationProviderRule, OptInRule, CorrectableRule {
|
||||
public struct NimbleOperatorRule: ConfigurationProviderRule, OptInRule, CorrectableRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct NoExtensionAccessModifierRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct NoExtensionAccessModifierRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.error)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct NoFallthroughOnlyRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct NoFallthroughOnlyRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct NoGroupingExtensionRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct NoGroupingExtensionRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct NotificationCenterDetachmentRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct NotificationCenterDetachmentRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -14,7 +14,7 @@ private extension File {
|
||||
}
|
||||
}
|
||||
|
||||
public struct OpeningBraceRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct OpeningBraceRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct OperatorFunctionWhitespaceRule: ConfigurationProviderRule {
|
||||
public struct OperatorFunctionWhitespaceRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct OperatorUsageWhitespaceRule: OptInRule, CorrectableRule, ConfigurationProviderRule {
|
||||
public struct OperatorUsageWhitespaceRule: OptInRule, CorrectableRule, ConfigurationProviderRule,
|
||||
AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct OverriddenSuperCallRule: ConfigurationProviderRule, ASTRule, OptInRule {
|
||||
public struct OverriddenSuperCallRule: ConfigurationProviderRule, ASTRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = OverridenSuperCallConfiguration()
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct OverrideInExtensionRule: ConfigurationProviderRule, OptInRule {
|
||||
public struct OverrideInExtensionRule: ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct PatternMatchingKeywordsRule: ASTRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct PatternMatchingKeywordsRule: ASTRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct PrefixedTopLevelConstantRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct PrefixedTopLevelConstantRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
private let topLevelPrefix = "k"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct PrivateActionRule: ASTRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct PrivateActionRule: ASTRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -28,7 +28,7 @@ private extension Dictionary where Key: ExpressibleByStringLiteral {
|
||||
}
|
||||
}
|
||||
|
||||
public struct PrivateUnitTestRule: ASTRule, ConfigurationProviderRule, CacheDescriptionProvider {
|
||||
public struct PrivateUnitTestRule: ASTRule, ConfigurationProviderRule, CacheDescriptionProvider, AutomaticTestableRule {
|
||||
|
||||
public var configuration: PrivateUnitTestConfiguration = {
|
||||
var configuration = PrivateUnitTestConfiguration(identifier: "private_unit_test")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ProhibitedSuperRule: ConfigurationProviderRule, ASTRule, OptInRule {
|
||||
public struct ProhibitedSuperRule: ConfigurationProviderRule, ASTRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = ProhibitedSuperConfiguration()
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ProtocolPropertyAccessorsOrderRule: ConfigurationProviderRule, CorrectableRule {
|
||||
public struct ProtocolPropertyAccessorsOrderRule: ConfigurationProviderRule, CorrectableRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct QuickDiscouragedCallRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct QuickDiscouragedCallRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct QuickDiscouragedFocusedTestRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct QuickDiscouragedFocusedTestRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct QuickDiscouragedPendingTestRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct QuickDiscouragedPendingTestRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct RedundantDiscardableLetRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct RedundantDiscardableLetRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ private extension File {
|
||||
}
|
||||
}
|
||||
|
||||
public struct RedundantNilCoalescingRule: OptInRule, CorrectableRule, ConfigurationProviderRule {
|
||||
public struct RedundantNilCoalescingRule: OptInRule, CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct RedundantOptionalInitializationRule: ASTRule, CorrectableRule, ConfigurationProviderRule {
|
||||
public struct RedundantOptionalInitializationRule: ASTRule, CorrectableRule, ConfigurationProviderRule,
|
||||
AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct RedundantSetAccessControlRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct RedundantSetAccessControlRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -12,7 +12,7 @@ private func children(of dict: [String: SourceKitRepresentable],
|
||||
}
|
||||
}
|
||||
|
||||
public struct RedundantStringEnumValueRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct RedundantStringEnumValueRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct RedundantVoidReturnRule: ASTRule, ConfigurationProviderRule, CorrectableRule {
|
||||
public struct RedundantVoidReturnRule: ASTRule, ConfigurationProviderRule, CorrectableRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ReturnArrowWhitespaceRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct ReturnArrowWhitespaceRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct ShorthandOperatorRule: ConfigurationProviderRule {
|
||||
public struct ShorthandOperatorRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.error)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct SingleTestClassRule: Rule, OptInRule, ConfigurationProviderRule {
|
||||
public struct SingleTestClassRule: Rule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public static let description = RuleDescription(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct SortedFirstLastRule: CallPairRule, OptInRule, ConfigurationProviderRule {
|
||||
public struct SortedFirstLastRule: CallPairRule, OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -46,7 +46,7 @@ private extension Sequence where Element == Line {
|
||||
}
|
||||
}
|
||||
|
||||
public struct SortedImportsRule: CorrectableRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct SortedImportsRule: CorrectableRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct StrictFilePrivateRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct StrictFilePrivateRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -5,7 +5,7 @@ private func wrapInSwitch(_ str: String) -> String {
|
||||
return "switch foo {\n \(str)\n}\n"
|
||||
}
|
||||
|
||||
public struct SwitchCaseOnNewlineRule: ASTRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct SwitchCaseOnNewlineRule: ASTRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct SyntacticSugarRule: ConfigurationProviderRule {
|
||||
public struct SyntacticSugarRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct TrailingClosureRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct TrailingClosureRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -8,7 +8,7 @@ private extension File {
|
||||
}
|
||||
}
|
||||
|
||||
public struct TrailingSemicolonRule: CorrectableRule, ConfigurationProviderRule {
|
||||
public struct TrailingSemicolonRule: CorrectableRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ private func example(_ type: String,
|
||||
repeatElement(template, count: count).joined() + "\(add)}\n"
|
||||
}
|
||||
|
||||
public struct TypeBodyLengthRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct TypeBodyLengthRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityLevelsConfiguration(warning: 200, error: 350)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct UnavailableFunctionRule: ASTRule, ConfigurationProviderRule, OptInRule {
|
||||
public struct UnavailableFunctionRule: ASTRule, ConfigurationProviderRule, OptInRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -7,7 +7,7 @@ private func embedInSwitch(_ text: String, case: String = "case .bar") -> String
|
||||
" \(text)\n" +
|
||||
"}"
|
||||
}
|
||||
public struct UnneededBreakInSwitchRule: ConfigurationProviderRule {
|
||||
public struct UnneededBreakInSwitchRule: ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct UnneededParenthesesInClosureArgumentRule: ConfigurationProviderRule, CorrectableRule, OptInRule {
|
||||
public struct UnneededParenthesesInClosureArgumentRule: ConfigurationProviderRule, CorrectableRule, OptInRule,
|
||||
AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct UntypedErrorInCatchRule: OptInRule, ConfigurationProviderRule {
|
||||
public struct UntypedErrorInCatchRule: OptInRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct UnusedClosureParameterRule: ASTRule, ConfigurationProviderRule, CorrectableRule {
|
||||
public struct UnusedClosureParameterRule: ASTRule, ConfigurationProviderRule, CorrectableRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
import SourceKittenFramework
|
||||
|
||||
public struct UnusedEnumeratedRule: ASTRule, ConfigurationProviderRule {
|
||||
public struct UnusedEnumeratedRule: ASTRule, ConfigurationProviderRule, AutomaticTestableRule {
|
||||
public var configuration = SeverityConfiguration(.warning)
|
||||
|
||||
public init() {}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user