Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#5461 added ib_segue_action case in TypeContent #5524

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ private let declarationKindsToSkip: Set<SwiftDeclarationKind> = [
]

private let declarationAttributesToSkip: Set<SwiftDeclarationAttributeKind> = [
.ibsegueaction,
.ibaction,
.main,
.nsApplicationMain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum TypeContent: String {
case otherMethod = "other_method"
case `subscript` = "subscript"
case deinitializer = "deinitializer"
case ibSegueAction = "ib_segue_action"
}

@AutoApply
Expand All @@ -40,6 +41,7 @@ struct TypeContentsOrderConfiguration: SeverityBasedRuleConfiguration {
[.ibAction],
[.otherMethod],
[.subscript],
[.deinitializer]
[.deinitializer],
[.ibSegueAction]
SimplyDanny marked this conversation as resolved.
Show resolved Hide resolved
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ struct TypeContentsOrderRule: OptInRule {
if typeContentStructure.enclosedSwiftAttributes.contains(SwiftDeclarationAttributeKind.ibaction) {
return .ibAction
}
if typeContentStructure.enclosedSwiftAttributes.contains(SwiftDeclarationAttributeKind.ibsegueaction) {
return .ibSegueAction
}
return .otherMethod

case .functionSubscript:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public extension SwiftDeclarationAttributeKind {
.nonobjc,
.objcMembers,
.ibaction,
.ibsegueaction,
.iboutlet,
.ibdesignable,
.ibinspectable,
Expand Down
Loading