From 49d21a2cbe53b7e26e4f931af2ea9237c750cbbe Mon Sep 17 00:00:00 2001 From: Dan Federman Date: Thu, 7 Dec 2023 21:43:01 -0800 Subject: [PATCH] Remove duplicated use of instantiablesOutput --- Sources/SafeDIPlugin/SafeDIPlugin.swift | 6 ------ .../SafeDIPluginTests/SafeDIPluginTests.swift | 19 +------------------ 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/Sources/SafeDIPlugin/SafeDIPlugin.swift b/Sources/SafeDIPlugin/SafeDIPlugin.swift index 566b695e..eae153a7 100644 --- a/Sources/SafeDIPlugin/SafeDIPlugin.swift +++ b/Sources/SafeDIPlugin/SafeDIPlugin.swift @@ -42,7 +42,6 @@ struct SafeDIPlugin: AsyncParsableCommand { func run() async throws { let output = try await Self.run( swiftFileContent: try await loadSwiftFiles(), - instantiablesOutput: instantiablesOutput, dependentModuleNames: instantiablesPaths.map { $0.asFileURL.deletingPathExtension().lastPathComponent }, dependentInstantiables: Self.findSafeDIFulfilledTypes(atInstantiablesPaths: instantiablesPaths), buildDependencyTreeOutput: dependencyTreeOutput != nil @@ -59,7 +58,6 @@ struct SafeDIPlugin: AsyncParsableCommand { static func run( swiftFileContent: [String], - instantiablesOutput: String?, dependentModuleNames: [String], dependentInstantiables: [[Instantiable]], buildDependencyTreeOutput: Bool @@ -75,10 +73,6 @@ struct SafeDIPlugin: AsyncParsableCommand { ) } - if let instantiablesOutput { - try writeInstantiables(module.instantiables, toPath: instantiablesOutput) - } - let dependencyTree: String? if buildDependencyTreeOutput { dependencyTree = try await DependencyTreeGenerator( diff --git a/Tests/SafeDIPluginTests/SafeDIPluginTests.swift b/Tests/SafeDIPluginTests/SafeDIPluginTests.swift index ae9f8832..e26946b2 100644 --- a/Tests/SafeDIPluginTests/SafeDIPluginTests.swift +++ b/Tests/SafeDIPluginTests/SafeDIPluginTests.swift @@ -29,7 +29,6 @@ final class SafeDIPluginTests: XCTestCase { func test_run_successfullyGeneratesOutputFileWhenNoCodeInput() async throws { let output = try await SafeDIPlugin.run( swiftFileContent: [], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -63,7 +62,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -110,7 +108,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -164,7 +161,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -218,7 +214,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -329,7 +324,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -459,7 +453,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -590,7 +583,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -721,7 +713,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -796,7 +787,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -842,7 +832,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -872,7 +861,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -907,7 +895,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -940,7 +927,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -973,7 +959,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -1035,7 +1020,6 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true @@ -1092,14 +1076,13 @@ final class SafeDIPluginTests: XCTestCase { } """, ], - instantiablesOutput: nil, dependentModuleNames: [], dependentInstantiables: [[]], buildDependencyTreeOutput: true ) } } - + private func assertThrowsError( _ errorDescription: String, line: UInt = #line,