diff --git a/App/Previews/GameOverPreview/GameOverPreviewApp.swift b/App/Previews/GameOverPreview/GameOverPreviewApp.swift index fcfcdea1..cf61e7a6 100644 --- a/App/Previews/GameOverPreview/GameOverPreviewApp.swift +++ b/App/Previews/GameOverPreview/GameOverPreviewApp.swift @@ -16,7 +16,7 @@ struct GameOverPreviewApp: App { WindowGroup { GameOverView( store: .solo - // store: .multiplayer + // store: .multiplayer ) } } diff --git a/App/Previews/LeaderboardsPreview/LeaderboardsPreviewApp.swift b/App/Previews/LeaderboardsPreview/LeaderboardsPreviewApp.swift index 71a5f306..bb4dbd84 100644 --- a/App/Previews/LeaderboardsPreview/LeaderboardsPreviewApp.swift +++ b/App/Previews/LeaderboardsPreview/LeaderboardsPreviewApp.swift @@ -37,17 +37,17 @@ struct LeaderboardsPreviewApp: App { score: 4_000 - index * 100 ) } - + [ - .init( - id: .init(rawValue: UUID()), - isSupporter: false, - isYourScore: true, - outOf: 2_000, - playerDisplayName: "Blob Sr.", - rank: 100, - score: 1_000 - ) - ] + + [ + .init( + id: .init(rawValue: UUID()), + isSupporter: false, + isYourScore: true, + outOf: 2_000, + playerDisplayName: "Blob Sr.", + rank: 100, + score: 1_000 + ) + ] ) ) } diff --git a/App/Previews/SettingsPreview/SettingsPreviewApp.swift b/App/Previews/SettingsPreview/SettingsPreviewApp.swift index df45a499..3351deb3 100644 --- a/App/Previews/SettingsPreview/SettingsPreviewApp.swift +++ b/App/Previews/SettingsPreview/SettingsPreviewApp.swift @@ -39,7 +39,9 @@ struct SettingsPreviewApp: App { setUserInterfaceStyle: { userInterfaceStyle in await MainActor.run { guard - let scene = UIApplication.shared.connectedScenes.first(where: { $0 is UIWindowScene }) + let scene = UIApplication.shared.connectedScenes.first(where: { + $0 is UIWindowScene + }) as? UIWindowScene else { return } scene.keyWindow?.overrideUserInterfaceStyle = userInterfaceStyle diff --git a/Sources/ApiClient/Client.swift b/Sources/ApiClient/Client.swift index b1042718..fb91c74e 100644 --- a/Sources/ApiClient/Client.swift +++ b/Sources/ApiClient/Client.swift @@ -8,7 +8,7 @@ public struct ApiClient { public var authenticate: @Sendable (ServerRoute.AuthenticateRequest) async throws -> CurrentPlayerEnvelope public var baseUrl: @Sendable () -> URL - public var currentPlayer: @Sendable() -> CurrentPlayerEnvelope? + public var currentPlayer: @Sendable () -> CurrentPlayerEnvelope? public var logout: @Sendable () async -> Void public var refreshCurrentPlayer: @Sendable () async throws -> CurrentPlayerEnvelope public var request: @Sendable (ServerRoute) async throws -> (Data, URLResponse) diff --git a/Sources/AppFeature/AppView.swift b/Sources/AppFeature/AppView.swift index 8593442e..714de350 100644 --- a/Sources/AppFeature/AppView.swift +++ b/Sources/AppFeature/AppView.swift @@ -235,10 +235,9 @@ let appReducerCore = Reducer { state, actio } case let .appDelegate(.userNotifications(.didReceiveResponse(response, completionHandler))): - if - let data = - try? JSONSerialization - .data(withJSONObject: response.notification.request.content.userInfo), + if let data = + try? JSONSerialization + .data(withJSONObject: response.notification.request.content.userInfo), let pushNotificationContent = try? JSONDecoder() .decode(PushNotificationContent.self, from: data) { diff --git a/Sources/AppFeature/StoreKitCore.swift b/Sources/AppFeature/StoreKitCore.swift index cbaecd70..b97f5155 100644 --- a/Sources/AppFeature/StoreKitCore.swift +++ b/Sources/AppFeature/StoreKitCore.swift @@ -28,8 +28,7 @@ extension Reducer where Action == AppAction, Environment == AppEnvironment { let verifiableTransactions = transactions.filter { $0.transactionState.canBeVerified } let otherTransactions = transactions.filter { !$0.transactionState.canBeVerified } - if - !verifiableTransactions.isEmpty, + if !verifiableTransactions.isEmpty, let appStoreReceiptURL = environment.storeKit.appStoreReceiptURL(), let receiptData = try? Data(contentsOf: appStoreReceiptURL, options: .alwaysMapped) { @@ -66,8 +65,9 @@ extension Reducer where Action == AppAction, Environment == AppEnvironment { return .fireAndForget { for transaction in envelope.transactions where envelope.verifyEnvelope.verifiedProductIds - .contains(where: { $0 == transaction.payment.productIdentifier }) { - await environment.storeKit.finishTransaction(transaction) + .contains(where: { $0 == transaction.payment.productIdentifier }) + { + await environment.storeKit.finishTransaction(transaction) } } diff --git a/Sources/AudioPlayerClient/Client.swift b/Sources/AudioPlayerClient/Client.swift index 4226d770..4c0ff349 100644 --- a/Sources/AudioPlayerClient/Client.swift +++ b/Sources/AudioPlayerClient/Client.swift @@ -7,7 +7,7 @@ public struct AudioPlayerClient { public var secondaryAudioShouldBeSilencedHint: @Sendable () async -> Bool public var setGlobalVolumeForMusic: @Sendable (Float) async -> Void public var setGlobalVolumeForSoundEffects: @Sendable (Float) async -> Void - public var setVolume: @Sendable (Sound, Float) async ->Void + public var setVolume: @Sendable (Sound, Float) async -> Void public var stop: @Sendable (Sound) async -> Void public struct Sound: Hashable { diff --git a/Sources/ComposableGameCenter/CrossPlatformSupport.swift b/Sources/ComposableGameCenter/CrossPlatformSupport.swift index c999916c..f1a26d65 100644 --- a/Sources/ComposableGameCenter/CrossPlatformSupport.swift +++ b/Sources/ComposableGameCenter/CrossPlatformSupport.swift @@ -6,7 +6,7 @@ public func present() { guard let scene = UIKit.UIApplication.shared.connectedScenes.first(where: { $0 is UIWindowScene }) - as? UIWindowScene + as? UIWindowScene else { return } scene.keyWindow?.rootViewController?.present(self, animated: true) } diff --git a/Sources/ComposableStoreKit/Live.swift b/Sources/ComposableStoreKit/Live.swift index 562926b5..c7e5d345 100644 --- a/Sources/ComposableStoreKit/Live.swift +++ b/Sources/ComposableStoreKit/Live.swift @@ -42,7 +42,7 @@ extension StoreKitClient { guard let scene = await UIApplication.shared.connectedScenes .first(where: { $0 is UIWindowScene }) - as? UIWindowScene + as? UIWindowScene else { return } await SKStoreReviewController.requestReview(in: scene) }, diff --git a/Sources/ComposableUserNotifications/Interface.swift b/Sources/ComposableUserNotifications/Interface.swift index f923e3bb..423b1e93 100644 --- a/Sources/ComposableUserNotifications/Interface.swift +++ b/Sources/ComposableUserNotifications/Interface.swift @@ -7,8 +7,7 @@ public struct UserNotificationClient { public var delegate: @Sendable () -> AsyncStream public var getNotificationSettings: @Sendable () async -> Notification.Settings public var removeDeliveredNotificationsWithIdentifiers: @Sendable ([String]) async -> Void - public var removePendingNotificationRequestsWithIdentifiers: - @Sendable ([String]) async -> Void + public var removePendingNotificationRequestsWithIdentifiers: @Sendable ([String]) async -> Void public var requestAuthorization: @Sendable (UNAuthorizationOptions) async throws -> Bool public enum DelegateEvent: Equatable { diff --git a/Sources/FileClient/Client.swift b/Sources/FileClient/Client.swift index d2eefb69..a6159873 100644 --- a/Sources/FileClient/Client.swift +++ b/Sources/FileClient/Client.swift @@ -12,7 +12,7 @@ public struct FileClient { try await JSONDecoder().decode(A.self, from: self.load(fileName)) } - public func save(_ data: A, to fileName: String) async throws -> Void { + public func save(_ data: A, to fileName: String) async throws { try await self.save(fileName, JSONEncoder().encode(data)) } } diff --git a/Sources/FileClient/Mocks.swift b/Sources/FileClient/Mocks.swift index e2417f43..88a92ce3 100644 --- a/Sources/FileClient/Mocks.swift +++ b/Sources/FileClient/Mocks.swift @@ -20,7 +20,7 @@ extension FileClient { public mutating func override(load file: String, _ data: A) { let fulfill = expectation(description: "FileClient.load(\(file))") - self.load = { @Sendable [self] in + self.load = { @Sendable[self] in if $0 == file { fulfill() return try JSONEncoder().encode(data) diff --git a/Sources/GameCore/GameCore.swift b/Sources/GameCore/GameCore.swift index 9082f9da..17954dde 100644 --- a/Sources/GameCore/GameCore.swift +++ b/Sources/GameCore/GameCore.swift @@ -1128,12 +1128,10 @@ extension Reducer where State == GameState, Action == GameAction, Environment == TaskResult { if state.isGameOver { let completedGame = CompletedGame(gameState: state) - if - let completedMatch = CompletedMatch( - completedGame: completedGame, - turnBasedContext: turnBasedContext - ) - { + if let completedMatch = CompletedMatch( + completedGame: completedGame, + turnBasedContext: turnBasedContext + ) { try await environment.gameCenter.turnBasedMatch.endMatchInTurn( .init( for: turnBasedContext.match.matchId, diff --git a/Sources/GameCore/SoundsCore.swift b/Sources/GameCore/SoundsCore.swift index ea392368..288650d5 100644 --- a/Sources/GameCore/SoundsCore.swift +++ b/Sources/GameCore/SoundsCore.swift @@ -89,13 +89,15 @@ extension Reducer where State == GameState, Action == GameAction, Environment == if cubeIsShaking { state.cubeStartedShakingAt = state.cubeStartedShakingAt ?? environment.date() - return cubeWasShaking ? .none : .fireAndForget { - await environment.audioPlayer.play(.cubeShake) - for await _ in environment.mainQueue.timer(interval: .seconds(2)) { + return cubeWasShaking + ? .none + : .fireAndForget { await environment.audioPlayer.play(.cubeShake) + for await _ in environment.mainQueue.timer(interval: .seconds(2)) { + await environment.audioPlayer.play(.cubeShake) + } } - } - .cancellable(id: CubeShakingID.self) + .cancellable(id: CubeShakingID.self) } else { state.cubeStartedShakingAt = nil diff --git a/Sources/LeaderboardFeature/Leaderboard.swift b/Sources/LeaderboardFeature/Leaderboard.swift index 2dbfb15e..f4a4ec4d 100644 --- a/Sources/LeaderboardFeature/Leaderboard.swift +++ b/Sources/LeaderboardFeature/Leaderboard.swift @@ -347,7 +347,7 @@ extension ApiClient { } ) } - ?? .init() + ?? .init() } } @@ -374,7 +374,7 @@ extension ApiClient { results: response.map(ResultEnvelope.Result.init) ) } - ?? .init() + ?? .init() } } diff --git a/Sources/LowPowerModeClient/Mocks.swift b/Sources/LowPowerModeClient/Mocks.swift index 38171efc..64d53556 100644 --- a/Sources/LowPowerModeClient/Mocks.swift +++ b/Sources/LowPowerModeClient/Mocks.swift @@ -8,7 +8,7 @@ extension LowPowerModeClient { public static let `false` = Self( start: { AsyncStream { $0.yield(false) } } ) - + public static let `true` = Self( start: { AsyncStream { $0.yield(true) } } ) @@ -25,7 +25,8 @@ extension LowPowerModeClient { Task { await continuation.yield(isLowPowerModeEnabled.value) for await _ in DispatchQueue.main.timer(interval: 2) { - let isLowPowerModeEnabled = await isLowPowerModeEnabled + let isLowPowerModeEnabled = + await isLowPowerModeEnabled .withValue { isLowPowerModeEnabled -> Bool in isLowPowerModeEnabled.toggle() return isLowPowerModeEnabled diff --git a/Sources/ServerConfigClient/Live.swift b/Sources/ServerConfigClient/Live.swift index b8071754..3967b1b5 100644 --- a/Sources/ServerConfigClient/Live.swift +++ b/Sources/ServerConfigClient/Live.swift @@ -8,8 +8,8 @@ extension ServerConfigClient { Self( config: { (UserDefaults.standard.object(forKey: serverConfigKey) as? Data) - .flatMap { try? jsonDecoder.decode(ServerConfig.self, from: $0) } - ?? ServerConfig() + .flatMap { try? jsonDecoder.decode(ServerConfig.self, from: $0) } + ?? ServerConfig() }, refresh: { let config = try await fetch() diff --git a/Sources/SettingsFeature/FileClientEffects.swift b/Sources/SettingsFeature/FileClientEffects.swift index 63acfe08..af379a16 100644 --- a/Sources/SettingsFeature/FileClientEffects.swift +++ b/Sources/SettingsFeature/FileClientEffects.swift @@ -6,7 +6,7 @@ extension FileClient { try await self.load(UserSettings.self, from: userSettingsFileName) } - public func save(userSettings: UserSettings) async throws -> Void { + public func save(userSettings: UserSettings) async throws { try await self.save(userSettings, to: userSettingsFileName) } } diff --git a/Sources/SettingsFeature/Settings.swift b/Sources/SettingsFeature/Settings.swift index f91d5efe..34f2bbf5 100644 --- a/Sources/SettingsFeature/Settings.swift +++ b/Sources/SettingsFeature/Settings.swift @@ -551,18 +551,19 @@ public let settingsReducer = Reducer