Skip to content

Commit

Permalink
Update to swiftformat 0.51.12 (#11531)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Heard <[email protected]>
Co-authored-by: Nick Cooke <[email protected]>
  • Loading branch information
3 people authored Jul 11, 2023
1 parent 98b8da1 commit ae871b9
Show file tree
Hide file tree
Showing 80 changed files with 665 additions and 427 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
// If any sessions were discarded while the application was not running, this will be called
// shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they
// will not return.
}
}
20 changes: 12 additions & 8 deletions CoreOnly/Tests/FirebasePodTest/FirebasePodTest/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,26 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func scene(_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Use this method to optionally configure and attach the UIWindow `window` to the provided
// UIWindowScene `scene`. If using a storyboard, the `window` property will automatically
// be initialized and attached to the scene. This delegate does not imply the connecting
// scene or session are new (see `application:configurationForConnectingSceneSession`
// instead).
guard let _ = (scene as? UIWindowScene) else { return }
}

func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
// Release any resources associated with this scene that can be re-created the next time the
// scene connects. The scene may re-connect later, as its session was not neccessarily
// discarded (see `application:didDiscardSceneSessions` instead).
}

func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was
// inactive.
}

func sceneWillResignActive(_ scene: UIScene) {
Expand All @@ -50,7 +54,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
// Use this method to save data, release shared resources, and store enough scene-specific state
// information to restore the scene back to its current state.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class NotificationService: UNNotificationServiceExtension {

override func serviceExtensionTimeWillExpire() {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the
// original push payload will be used.
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
contentHandler(bestAttemptContent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import FirebaseAppCheck
class MyAppCheckProvider: NSObject, AppCheckProvider {
func getToken(completion handler: @escaping AppCheckTokenHandler) {
DispatchQueue.main.async {
// Create or request Firebase App Check token. Usually the token is requested from your server.
// Create or request Firebase App Check token. Usually the token is requested from your
// server.
let myToken = AppCheckToken(
token: "MyToken",
expirationDate: Date(timeIntervalSinceNow: 60 * 60)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

func scene(_ scene: UIScene, willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Use this method to optionally configure and attach the UIWindow `window` to the provided
// UIWindowScene `scene`. If using a storyboard, the `window` property will automatically
// be initialized and attached to the scene. This delegate does not imply the connecting
// scene or session are new (see `application:configurationForConnectingSceneSession`
// instead).

// Create the SwiftUI view that provides the window contents.
let contentView = ContentView()
Expand All @@ -41,13 +43,15 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
// Release any resources associated with this scene that can be re-created the next time the
// scene connects. The scene may re-connect later, as its session was not necessarily
// discarded (see `application:didDiscardSceneSessions` instead).
}

func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was
// inactive.
}

func sceneWillResignActive(_ scene: UIScene) {
Expand All @@ -62,7 +66,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
// Use this method to save data, release shared resources, and store enough scene-specific state
// information to restore the scene back to its current state.
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication,
didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
// If any sessions were discarded while the application was not running, this will be called
// shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they
// will not return.
}

// MARK: App Check providers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,26 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

func scene(_ scene: UIScene, willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
// Use this method to optionally configure and attach the UIWindow `window` to the provided
// UIWindowScene `scene`. If using a storyboard, the `window` property will automatically
// be initialized and attached to the scene. This delegate does not imply the connecting
// scene or session are new (see `application:configurationForConnectingSceneSession`
// instead).
guard let _ = (scene as? UIWindowScene) else { return }
}

func sceneDidDisconnect(_ scene: UIScene) {
// Called as the scene is being released by the system.
// This occurs shortly after the scene enters the background, or when its session is discarded.
// Release any resources associated with this scene that can be re-created the next time the scene connects.
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
// Release any resources associated with this scene that can be re-created the next time the
// scene connects. The scene may re-connect later, as its session was not necessarily
// discarded (see `application:didDiscardSceneSessions` instead).
}

func sceneDidBecomeActive(_ scene: UIScene) {
// Called when the scene has moved from an inactive state to an active state.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
// Use this method to restart any tasks that were paused (or not yet started) when the scene was
// inactive.
}

func sceneWillResignActive(_ scene: UIScene) {
Expand All @@ -51,7 +55,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {

func sceneDidEnterBackground(_ scene: UIScene) {
// Called as the scene transitions from the foreground to the background.
// Use this method to save data, release shared resources, and store enough scene-specific state information
// to restore the scene back to its current state.
// Use this method to save data, release shared resources, and store enough scene-specific state
// information to restore the scene back to its current state.
}
}
6 changes: 4 additions & 2 deletions FirebaseAppDistributionInternal/Sources/ApiService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,10 @@ struct FeedbackReport: Codable {
})
}

@objc(fetchReleasesWithCompletion:) public static func fetchReleases(completion: @escaping (_ releases: [Any]?,
_ error: Error?)
@objc(fetchReleasesWithCompletion:) public static func fetchReleases(completion: @escaping (_ releases: [
Any,
]?,
_ error: Error?)
-> Void) {
guard let app = FirebaseApp.app() else {
return
Expand Down
4 changes: 2 additions & 2 deletions FirebaseAppDistributionInternal/Sources/InAppFeedback.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ import Photos
static func getPhotoPermissionIfNecessary(completionHandler: @escaping (_ authorized: Bool)
-> Void) {
if #available(iOS 14, *) {
// The iOS 14 API is used to prompt users for permission if they previously provided limited access,
// but have now taken an additional screenshot.
// The iOS 14 API is used to prompt users for permission if they previously provided limited
// access, but have now taken an additional screenshot.
guard PHPhotoLibrary.authorizationStatus(for: .readWrite) != .authorized else {
completionHandler(true)
return
Expand Down
11 changes: 5 additions & 6 deletions FirebaseAuth/Tests/Sample/SwiftApiTests/FacebookTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,8 @@ import XCTest
// }
// #endif
//
// /// ** Creates a Facebook testing account using Facebook Graph API and return a dictionary that
// // * constains "id", "access_token", "login_url", "email" and "password" of the created account.
// // */
// /// Creates a Facebook testing account using Facebook Graph API and return a dictionary that
// /// constrains "id", "access_token", "login_url", "email" and "password" of the created account.
// func createFacebookTestingAccount() -> [String: Any] {
// var returnValue: [String: Any] = [:]
// let urltoCreateTestUser = "https://graph.facebook.com/\(Credentials.kFacebookAppID)" +
Expand Down Expand Up @@ -154,9 +153,9 @@ import XCTest
//
// #if compiler(>=5.5.2) && canImport(_Concurrency)
// @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
// /// ** Creates a Facebook testing account using Facebook Graph API and return a dictionary that
// // * constains "id", "access_token", "login_url", "email" and "password" of the created account.
// // */
// /// Creates a Facebook testing account using Facebook Graph API and return a dictionary that
// /// constains "id", "access_token", "login_url", "email" and "password" of the created
// /// account.
// func createFacebookTestingAccountAsync() async throws -> [String: Any] {
// let urltoCreateTestUser = "https://graph.facebook.com/\(Credentials.kFacebookAppID)" +
// "/accounts/test-users"
Expand Down
20 changes: 10 additions & 10 deletions FirebaseAuth/Tests/Sample/SwiftApiTests/GoogleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ class GoogleTests: TestsBase {
}
#endif

/// ** Sends http request to Google OAuth2 token server to use refresh token to exchange for Google
// * access token. Returns a dictionary that constains "access_token", "token_type", "expires_in" and
// * sometimes the "id_token". (The id_token is not guaranteed to be returned during a refresh
// * exchange; see https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokenResponse)
// */
/// Sends http request to Google OAuth2 token server to use refresh token to exchange for Google
/// access token.
/// Returns a dictionary that constains "access_token", "token_type", "expires_in" and sometimes
/// the "id_token". (The id_token is not guaranteed to be returned during a refresh exchange; see
/// https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokenResponse)
func getGoogleAccessToken() -> [String: Any] {
var returnValue: [String: Any] = [:]
let googleOauth2TokenServerUrl = "https://www.googleapis.com/oauth2/v4/token"
Expand Down Expand Up @@ -86,11 +86,11 @@ class GoogleTests: TestsBase {

#if compiler(>=5.5.2) && canImport(_Concurrency)
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
/// ** Sends http request to Google OAuth2 token server to use refresh token to exchange for Google
// * access token. Returns a dictionary that constains "access_token", "token_type", "expires_in" and
// * sometimes the "id_token". (The id_token is not guaranteed to be returned during a refresh
// * exchange; see https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokenResponse)
// */
/// Sends http request to Google OAuth2 token server to use refresh token to exchange for Google
/// access token.
/// Returns a dictionary that constains "access_token", "token_type", "expires_in" and sometimes
/// the "id_token". (The id_token is not guaranteed to be returned during a refresh exchange;
/// see https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokenResponse)
func getGoogleAccessTokenAsync() async throws -> [String: Any] {
let googleOauth2TokenServerUrl = "https://www.googleapis.com/oauth2/v4/token"
let bodyString = "client_id=\(Credentials.kGoogleClientID)&grant_type=refresh_token" +
Expand Down
Loading

0 comments on commit ae871b9

Please sign in to comment.