Skip to content

Commit

Permalink
Remove duplicated use of instantiablesOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
dfed committed Dec 8, 2023
1 parent 2a5ceaf commit 49d21a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
6 changes: 0 additions & 6 deletions Sources/SafeDIPlugin/SafeDIPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -59,7 +58,6 @@ struct SafeDIPlugin: AsyncParsableCommand {

static func run(
swiftFileContent: [String],
instantiablesOutput: String?,
dependentModuleNames: [String],
dependentInstantiables: [[Instantiable]],
buildDependencyTreeOutput: Bool
Expand All @@ -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(
Expand Down
19 changes: 1 addition & 18 deletions Tests/SafeDIPluginTests/SafeDIPluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,7 +62,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -110,7 +108,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -164,7 +161,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -218,7 +214,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -329,7 +324,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -459,7 +453,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -590,7 +583,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -721,7 +713,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -796,7 +787,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -842,7 +832,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -872,7 +861,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -907,7 +895,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -940,7 +927,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -973,7 +959,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -1035,7 +1020,6 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
Expand Down Expand Up @@ -1092,14 +1076,13 @@ final class SafeDIPluginTests: XCTestCase {
}
""",
],
instantiablesOutput: nil,
dependentModuleNames: [],
dependentInstantiables: [[]],
buildDependencyTreeOutput: true
)
}
}

private func assertThrowsError<ReturnType>(
_ errorDescription: String,
line: UInt = #line,
Expand Down

0 comments on commit 49d21a2

Please sign in to comment.