Skip to content

Commit

Permalink
Update code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
0xLeif committed Nov 7, 2024
1 parent a9c987c commit 941ef89
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Sources/MockedMacros/MockedMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,17 @@ public struct MockedMacro: PeerMacro {

// Functions

let functions: [Function] = functionBuilder(
protocolDecl: protocolDecl,
members: members
)
let functions: [Function] = functionBuilder(protocolDecl: protocolDecl, members: members)

let functionVariableDefinitions: String = functionVariableDefinitions(functions: functions)
let functionVariableInitDefinitions: String = functionVariableInitDefinitions(functions: functions)
let functionVariableInitAssignments: String = functionVariableInitAssignments(functions: functions)
let functionImplementations: String = functionImplementations(functions: functions, accessLevel: accessLevel)

// Check if the protocol conforms to AnyObject
let requiresClassConformance = protocolDecl.inheritanceClause?.inheritedTypes.contains(where: {
$0.type.description.trimmingCharacters(in: .whitespacesAndNewlines) == "AnyObject"
}) ?? false
let requiresClassConformance = protocolDecl.inheritanceClause?.inheritedTypes.contains(
where: { $0.type.description.trimmingCharacters(in: .whitespacesAndNewlines) == "AnyObject" }
) ?? false

let objectType: String = requiresClassConformance ? "class" : "struct"

Expand Down

0 comments on commit 941ef89

Please sign in to comment.