Skip to content

Commit

Permalink
Code review feedback: move assertion for better locality with the pot…
Browse files Browse the repository at this point in the history
…ential bug.
  • Loading branch information
d-ronnqvist committed Aug 22, 2024
1 parent 4f58040 commit 4bda3c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SwiftDocCPluginUtilities/ParsedArguments.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ struct ParsedArguments {
pluginArguments = .init(extractingFrom: &arguments)
symbolGraphArguments = .init(extractingFrom: &arguments)

assert(arguments.extractOption(named: DocCArguments.outputPath).isEmpty,
"There shouldn't be any output path argument left in the remaining DocC arguments.")
self.arguments = arguments
}

Expand Down Expand Up @@ -108,8 +110,6 @@ struct ParsedArguments {
arguments.insertIfMissing(.option(DocCArguments.fallbackBundleIdentifier, value: targetName))

arguments.insertIfMissing(.option(DocCArguments.additionalSymbolGraphDirectory, value: symbolGraphDirectoryPath))

assert(arguments.extractOption(named: DocCArguments.outputPath).isEmpty,"The plugin arguments should have extracted the output path.")
arguments.insertIfMissing(.option(DocCArguments.outputPath, value: outputPath))

if pluginArguments.enableCombinedDocumentation {
Expand Down

0 comments on commit 4bda3c1

Please sign in to comment.