Skip to content

Commit

Permalink
Specify rule properties in attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
SimplyDanny committed Dec 26, 2024
1 parent 9f38075 commit ff21ff7
Show file tree
Hide file tree
Showing 121 changed files with 294 additions and 241 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct AnonymousArgumentInMultilineClosureRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct AnonymousArgumentInMultilineClosureRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct ConvenienceTypeRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ConvenienceTypeRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct DiscouragedAssertRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct DiscouragedAssertRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct DiscouragedNoneNameRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct DiscouragedNoneNameRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct DiscouragedObjectLiteralRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct DiscouragedObjectLiteralRule: Rule {
var configuration = DiscouragedObjectLiteralConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct DiscouragedOptionalBooleanRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct DiscouragedOptionalBooleanRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct DiscouragedOptionalCollectionRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct DiscouragedOptionalCollectionRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SwiftLintCore
import SwiftSyntax

@SwiftSyntaxRule
struct ExplicitACLRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ExplicitACLRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct ExplicitEnumRawValueRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ExplicitEnumRawValueRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SwiftSyntax
import SwiftSyntaxBuilder

@SwiftSyntaxRule(explicitRewriter: true)
struct ExplicitInitRule: OptInRule {
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
struct ExplicitInitRule: Rule {
var configuration = ExplicitInitConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct ExplicitTopLevelACLRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ExplicitTopLevelACLRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct ExplicitTypeInterfaceRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ExplicitTypeInterfaceRule: Rule {
var configuration = ExplicitTypeInterfaceConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SwiftLintCore
import SwiftSyntax

@SwiftSyntaxRule
struct ExtensionAccessModifierRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ExtensionAccessModifierRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct FallthroughRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct FallthroughRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct FatalErrorMessageRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct FatalErrorMessageRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct ForceUnwrappingRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ForceUnwrappingRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct FunctionDefaultParameterAtEndRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct FunctionDefaultParameterAtEndRule: Rule {
var configuration = FunctionDefaultParameterAtEndConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct ImplicitlyUnwrappedOptionalRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ImplicitlyUnwrappedOptionalRule: Rule {
var configuration = ImplicitlyUnwrappedOptionalConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule(explicitRewriter: true)
struct JoinedDefaultParameterRule: OptInRule {
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
struct JoinedDefaultParameterRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule(foldExpressions: true)
struct LegacyMultipleRule: OptInRule {
@SwiftSyntaxRule(foldExpressions: true, optIn: true)
struct LegacyMultipleRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ private let legacyObjcTypes = [
"NSUUID",
]

@SwiftSyntaxRule
struct LegacyObjcTypeRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct LegacyObjcTypeRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SwiftLintCore
import SwiftSyntax

@SwiftSyntaxRule(explicitRewriter: true)
struct NimbleOperatorRule: OptInRule {
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
struct NimbleOperatorRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SwiftLintCore
import SwiftSyntax

@SwiftSyntaxRule
struct NoEmptyBlockRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct NoEmptyBlockRule: Rule {
var configuration = NoEmptyBlockConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct NoExtensionAccessModifierRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct NoExtensionAccessModifierRule: Rule {
var configuration = SeverityConfiguration<Self>(.error)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct NoGroupingExtensionRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct NoGroupingExtensionRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule(foldExpressions: true)
struct NoMagicNumbersRule: OptInRule {
@SwiftSyntaxRule(foldExpressions: true, optIn: true)
struct NoMagicNumbersRule: Rule {
var configuration = NoMagicNumbersConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct ObjectLiteralRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct ObjectLiteralRule: Rule {
var configuration = ObjectLiteralConfiguration<Self>()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct OneDeclarationPerFileRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct OneDeclarationPerFileRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct PatternMatchingKeywordsRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct PatternMatchingKeywordsRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SwiftLintCore
import SwiftSyntax

@SwiftSyntaxRule(explicitRewriter: true)
struct PreferKeyPathRule: OptInRule {
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
struct PreferKeyPathRule: Rule {
var configuration = PreferKeyPathConfiguration()

private static let extendedMode = ["restrict_to_standard_functions": false]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct PreferNimbleRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct PreferNimbleRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule(explicitRewriter: true)
struct PreferZeroOverExplicitInitRule: OptInRule {
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
struct PreferZeroOverExplicitInitRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct PrivateOverFilePrivateRule: SwiftSyntaxCorrectableRule {
@SwiftSyntaxRule(correctable: true)
struct PrivateOverFilePrivateRule: Rule {
var configuration = PrivateOverFilePrivateConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule(explicitRewriter: true)
struct RedundantNilCoalescingRule: OptInRule {
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
struct RedundantNilCoalescingRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SwiftLintCore
import SwiftSyntax

@SwiftSyntaxRule
struct RedundantTypeAnnotationRule: OptInRule, SwiftSyntaxCorrectableRule {
@SwiftSyntaxRule(correctable: true, optIn: true)
struct RedundantTypeAnnotationRule: Rule {
var configuration = RedundantTypeAnnotationConfiguration()

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule(explicitRewriter: true)
struct ReturnValueFromVoidFunctionRule: OptInRule {
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
struct ReturnValueFromVoidFunctionRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule(explicitRewriter: true)
struct ShorthandOptionalBindingRule: OptInRule {
@SwiftSyntaxRule(explicitRewriter: true, optIn: true)
struct ShorthandOptionalBindingRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct StaticOperatorRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct StaticOperatorRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SwiftSyntax

@SwiftSyntaxRule
struct StrictFilePrivateRule: OptInRule {
@SwiftSyntaxRule(optIn: true)
struct StrictFilePrivateRule: Rule {
var configuration = SeverityConfiguration<Self>(.warning)

static let description = RuleDescription(
Expand Down
Loading

0 comments on commit ff21ff7

Please sign in to comment.