Skip to content

Fixup several warnings #9009

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions Sources/Commands/Utilities/PluginDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ final class PluginDelegate: PluginInvocationDelegate {
func lookupDescription(
for moduleName: String,
destination: BuildParameters.Destination
) throws -> ModuleBuildDescription? {
try buildPlan.buildModules.first {
) -> ModuleBuildDescription? {
buildPlan.buildModules.first {
$0.module.name == moduleName && $0.buildParameters.destination == destination
}
}
Expand All @@ -434,9 +434,9 @@ final class PluginDelegate: PluginInvocationDelegate {
// historically how this was setup. Ideally we should be building for both "host"
// and "target" if module is configured for them but that would require changing
// `PluginInvocationSymbolGraphResult` to carry multiple directories.
let description = if let targetDescription = try lookupDescription(for: targetName, destination: .target) {
let description = if let targetDescription = lookupDescription(for: targetName, destination: .target) {
targetDescription
} else if let hostDescription = try lookupDescription(for: targetName, destination: .host) {
} else if let hostDescription = lookupDescription(for: targetName, destination: .host) {
hostDescription
} else {
throw InternalError("could not find a target named: \(targetName)")
Expand Down
2 changes: 1 addition & 1 deletion Tests/FunctionalTests/StaticBinaryLibrary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct StaticBinaryLibraryTests {

try await withKnownIssue {
try await fixture(name: "BinaryLibraries") { fixturePath in
let (stdout, stderr) = try await executeSwiftRun(
let (stdout, _) = try await executeSwiftRun(
fixturePath.appending("Static").appending("Package1"),
"Example",
extraArgs: ["--experimental-prune-unused-dependencies"],
Expand Down
2 changes: 1 addition & 1 deletion Tests/IntegrationTests/SwiftPMTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import struct SPMBuildCore.BuildSystemProvider
private struct SwiftPMTests {
@Test(.requireHostOS(.macOS))
func binaryTargets() async throws {
try await withKnownIssue("error: the path does not point to a valid framework:") {
await withKnownIssue("error: the path does not point to a valid framework:") {
try await binaryTargetsFixture { fixturePath in
do {
await withKnownIssue("error: local binary target ... does not contain a binary artifact") {
Expand Down
2 changes: 1 addition & 1 deletion Tests/PackageGraphTests/ModulesGraphTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2283,7 +2283,7 @@ struct ModulesGraphTests {
let observability = try loadUnsafeModulesGraph(toolsVersion: .v6_1)

#expect(observability.diagnostics.count == 3)
try testDiagnostics(observability.diagnostics) { result in
testDiagnostics(observability.diagnostics) { result in
var expectedMetadata = ObservabilityMetadata()
expectedMetadata.moduleName = "Foo2"
let diagnostic1 = try #require(result.checkUnordered(
Expand Down
18 changes: 6 additions & 12 deletions Tests/PackageSigningTests/SigningTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,8 @@ struct SigningTests {
return
}
switch signingEntity {
case .recognized(_, let name, let organizationalUnit, let organization):
#expect(name != nil)
#expect(organizationalUnit != nil)
#expect(organization != nil)
case .recognized:
break
case .unrecognized(let name, let organizationalUnit, let organization):
#expect(name != nil)
#expect(organizationalUnit != nil)
Expand Down Expand Up @@ -841,10 +839,8 @@ struct SigningTests {
return
}
switch signingEntity {
case .recognized(_, let name, let organizationalUnit, let organization):
#expect(name != nil)
#expect(organizationalUnit != nil)
#expect(organization != nil)
case .recognized:
break
case .unrecognized(let name, let organizationalUnit, let organization):
#expect(name != nil)
#expect(organizationalUnit != nil)
Expand Down Expand Up @@ -896,10 +892,8 @@ struct SigningTests {
return
}
switch signingEntity {
case .recognized(_, let name, let organizationalUnit, let organization):
#expect(name != nil)
#expect(organizationalUnit != nil)
#expect(organization != nil)
case .recognized:
break
case .unrecognized(let name, let organizationalUnit, let organization):
#expect(name != nil)
#expect(organizationalUnit != nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ fileprivate struct ToolsVersionSpecificationRewriterTests {
)

// resultHandler(try inMemoryFileSystem.readFileContents(manifestFilePath))
let actual = try #require(try inMemoryFileSystem.readFileContents(manifestFilePath))
let actual = try inMemoryFileSystem.readFileContents(manifestFilePath)
#expect(actual.validDescription == expected, "Actual is not expected")
}

Expand Down