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

Fix backwards compatibility issue with Swift 5.7 #96

Merged
merged 2 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Plugins/Swift-DocC Convert/SwiftDocCConvert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ import PackagePlugin
}

let archiveOutputPath = archiveOutputDir(for: target)
let dependencyArchivePaths: [String] = if isCombinedDocumentationEnabled {
task.dependencies.map { archiveOutputDir(for: $0.target) }
} else {
[]
}
let dependencyArchivePaths: [String] = isCombinedDocumentationEnabled ? task.dependencies.map { archiveOutputDir(for: $0.target) } : []

if verbose {
print("documentation archive output path: '\(archiveOutputPath)'")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public struct CommandLineArguments {
}

/// All remaining (not-yet extracted) options or flags, up to the the first `--` separator (if there is one).
private var remainingOptionsOrFlags: [String].SubSequence
private var remainingOptionsOrFlags: Array<String>.SubSequence

/// All literals after the first `--` separator (if there is one).
private var literalValues: [String].SubSequence
private var literalValues: Array<String>.SubSequence

// MARK: Extract

Expand Down
7 changes: 4 additions & 3 deletions Sources/SwiftDocCPluginUtilities/HelpInformation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,16 @@ private extension DocumentedFlag {
flagListText += " / \(inverseNames.listForHelpDescription)"
}

var description = if flagListText.count < 23 {
var description: String
if flagListText.count < 23 {
// The flag is short enough to fit the abstract on the same line
"""
description = """
\(flagListText.padding(toLength: 23, withPad: " ", startingAt: 0)) \(abstract)

"""
} else {
// The flag is too long to fit the abstract on the same line
"""
description = """
\(flagListText)
\(abstract)

Expand Down