From 9c38b05a2535e2ab23d7488381d4e76b7cd4e79b Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Sat, 18 May 2024 12:51:53 +0100 Subject: [PATCH] Deprecate explicit `default` value for `--reporter` --- Sources/CommandLine.swift | 7 ++++++- Sources/Reporter.swift | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/CommandLine.swift b/Sources/CommandLine.swift index 1c7386f6..b2fc75cb 100644 --- a/Sources/CommandLine.swift +++ b/Sources/CommandLine.swift @@ -359,7 +359,12 @@ func processArguments(_ args: [String], environment: [String: String] = [:], in } // Reporter - let reporter: Reporter = try args["reporter"].map { identifier in + let reporter: Reporter = try args["reporter"].flatMap { identifier in + if identifier.lowercased() == "default" { + // Avoid errors for explicit `default` added to work around bug in 0.53.9 + print("warning: Passing 'default' for --reporter is deprecated.", as: .warning) + return nil + } guard let reporter = Reporters.reporter( named: identifier, environment: environment diff --git a/Sources/Reporter.swift b/Sources/Reporter.swift index 580c573e..975f880a 100644 --- a/Sources/Reporter.swift +++ b/Sources/Reporter.swift @@ -67,7 +67,6 @@ final class DefaultReporter: Reporter { enum Reporters { static let all: [Reporter.Type] = [ - DefaultReporter.self, JSONReporter.self, GithubActionsLogReporter.self, ]