Skip to content

Commit 659e861

Browse files
authored
chore: resolve SwiftLint errors and warnings (#3451)
* chore: resolve swiftlint errors and warnings in amplify categories and amplify core (#3440) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings for Amplify API plugin (#3441) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings for Amplify Auth plugin (#3442) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings for Amplify Datastore plugin (#3443) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings in Amplify Storage plugin (#3444) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings for Analytics plugin (#3445) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings for Amplify Push Notifications plugin (#3446) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings for Amplify Predictions plugin (#3447) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings for Amplify Logging plugin (#3448) * chore: resolve swiftlint errors * chore: resolve swiftlint warnings * chore: resolve swiftlint warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve swiftlint errors and warnings * chore: resolve merge conflicts
1 parent 2b47321 commit 659e861

File tree

332 files changed

+1143
-1081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+1143
-1081
lines changed

Amplify/Categories/API/APICategory.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final public class APICategory: Category {
1111
public var categoryType: CategoryType {
1212
.api
1313
}
14-
14+
1515
var plugins = [PluginKey: APICategoryPlugin]()
1616

1717
/// Returns the plugin added to the category, if only one plugin is added. Accessing this property if no plugins
@@ -49,7 +49,7 @@ final public class APICategory: Category {
4949
public var isConfigured = false
5050

5151
// MARK: - Plugin handling
52-
52+
5353
/// Adds `plugin` to the list of Plugins that implement functionality for this category.
5454
///
5555
/// - Parameter plugin: The Plugin to add

Amplify/Categories/API/ClientBehavior/APICategory+GraphQLBehavior.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@
66
//
77

88
extension APICategory: APICategoryGraphQLBehavior {
9-
9+
1010
// MARK: - Request-based GraphQL operations
1111
public func query<R: Decodable>(request: GraphQLRequest<R>) async throws -> GraphQLTask<R>.Success {
1212
try await plugin.query(request: request)
1313
}
14-
14+
1515
public func mutate<R: Decodable>(request: GraphQLRequest<R>) async throws -> GraphQLTask<R>.Success {
1616
try await plugin.mutate(request: request)
1717
}
18-
18+
1919
public func subscribe<R>(request: GraphQLRequest<R>) -> AmplifyAsyncThrowingSequence<GraphQLSubscriptionEvent<R>> {
2020
plugin.subscribe(request: request)
2121
}

Amplify/Categories/API/ClientBehavior/APICategory+RESTBehavior.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import Foundation
99

1010
extension APICategory: APICategoryRESTBehavior {
11-
11+
1212
public func get(request: RESTRequest) async throws -> RESTTask.Success {
1313
try await plugin.get(request: request)
1414
}

Amplify/Categories/API/ClientBehavior/APICategoryGraphQLBehavior.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public protocol APICategoryGraphQLBehavior: AnyObject {
1818
/// - listener: The event listener for the operation
1919
/// - Returns: The AmplifyOperation being enqueued
2020
func query<R: Decodable>(request: GraphQLRequest<R>) async throws -> GraphQLTask<R>.Success
21-
21+
2222
/// Perform a GraphQL mutate operation against a previously configured API. This operation
2323
/// will be asynchronous, with the callback accessible both locally and via the Hub.
2424
///
@@ -36,5 +36,7 @@ public protocol APICategoryGraphQLBehavior: AnyObject {
3636
/// - valueListener: Invoked when the GraphQL subscription receives a new value from the service
3737
/// - completionListener: Invoked when the subscription has terminated
3838
/// - Returns: The AmplifyInProcessReportingOperation being enqueued
39-
func subscribe<R: Decodable>(request: GraphQLRequest<R>) -> AmplifyAsyncThrowingSequence<GraphQLSubscriptionEvent<R>>
39+
func subscribe<R: Decodable>(
40+
request: GraphQLRequest<R>
41+
) -> AmplifyAsyncThrowingSequence<GraphQLSubscriptionEvent<R>>
4042
}

Amplify/Categories/API/ClientBehavior/APICategoryRESTBehavior.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ public protocol APICategoryRESTBehavior {
2727
/// - Parameter request: Contains information such as path, query parameters, body.
2828
/// - Returns: An operation that can be observed for its value
2929
func post(request: RESTRequest) async throws -> RESTTask.Success
30-
30+
3131
/// Perform an HTTP DELETE operation
3232
///
3333
/// - Parameter request: Contains information such as path, query parameters, body.
3434
/// - Returns: An operation that can be observed for its value
3535
func delete(request: RESTRequest) async throws -> RESTTask.Success
36-
36+
3737
/// Perform an HTTP HEAD operation
3838
///
3939
/// - Parameter request: Contains information such as path, query parameters, body.

Amplify/Categories/API/Operation/RetryableGraphQLOperation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public final class RetryableGraphQLOperation<Payload: Decodable>: Operation, Ret
116116
self.operationFactory = operationFactory
117117
self.resultListener = resultListener
118118
}
119-
119+
120120
public override func main() {
121121
Task {
122122
start(request: await requestFactory())

Amplify/Categories/Analytics/AnalyticsCategory+ClientBehavior.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extension AnalyticsCategory {
5050
public func unregisterGlobalProperties(_ keys: String...) {
5151
plugin.unregisterGlobalProperties(keys.isEmpty ? nil : Set<String>(keys))
5252
}
53-
53+
5454
/// Registered global properties can be unregistered though this method. In case no keys are provided, *all*
5555
/// registered global properties will be unregistered. Duplicate keys will be ignored. This method can be called
5656
/// from `Amplify.Analytics` and is a wrapper for `unregisterGlobalProperties(_ keys: Set<String>? = nil)`

Amplify/Categories/Auth/AuthCategory+ClientBehavior.swift

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import Foundation
99

1010
extension AuthCategory: AuthCategoryBehavior {
1111

12-
public func signUp( username: String, password: String? = nil, options: AuthSignUpRequest.Options? = nil) async throws -> AuthSignUpResult {
12+
public func signUp(
13+
username: String,
14+
password: String? = nil,
15+
options: AuthSignUpRequest.Options? = nil
16+
) async throws -> AuthSignUpResult {
1317
return try await plugin.signUp(username: username, password: password, options: options)
1418
}
1519

@@ -19,7 +23,10 @@ extension AuthCategory: AuthCategoryBehavior {
1923
return try await plugin.confirmSignUp(for: username, confirmationCode: confirmationCode, options: options)
2024
}
2125

22-
public func resendSignUpCode(for username: String, options: AuthResendSignUpCodeRequest.Options? = nil) async throws -> AuthCodeDeliveryDetails {
26+
public func resendSignUpCode(
27+
for username: String,
28+
options: AuthResendSignUpCodeRequest.Options? = nil
29+
) async throws -> AuthCodeDeliveryDetails {
2330
return try await plugin.resendSignUpCode(for: username, options: options)
2431
}
2532

@@ -46,14 +53,17 @@ extension AuthCategory: AuthCategoryBehavior {
4653
}
4754
#endif
4855

49-
public func confirmSignIn(challengeResponse: String, options: AuthConfirmSignInRequest.Options? = nil) async throws -> AuthSignInResult {
56+
public func confirmSignIn(
57+
challengeResponse: String,
58+
options: AuthConfirmSignInRequest.Options? = nil
59+
) async throws -> AuthSignInResult {
5060
return try await plugin.confirmSignIn(challengeResponse: challengeResponse, options: options)
5161
}
5262

5363
public func signOut(options: AuthSignOutRequest.Options? = nil) async -> AuthSignOutResult {
5464
return await plugin.signOut(options: options)
5565
}
56-
66+
5767
public func deleteUser() async throws {
5868
try await plugin.deleteUser()
5969
}
@@ -62,8 +72,11 @@ extension AuthCategory: AuthCategoryBehavior {
6272
return try await plugin.fetchAuthSession(options: options)
6373
}
6474

65-
public func resetPassword(for username: String, options: AuthResetPasswordRequest.Options? = nil) async throws -> AuthResetPasswordResult {
66-
return try await plugin.resetPassword(for: username,options: options)
75+
public func resetPassword(
76+
for username: String,
77+
options: AuthResetPasswordRequest.Options? = nil
78+
) async throws -> AuthResetPasswordResult {
79+
return try await plugin.resetPassword(for: username, options: options)
6780
}
6881

6982
public func confirmResetPassword(
@@ -72,7 +85,12 @@ extension AuthCategory: AuthCategoryBehavior {
7285
confirmationCode: String,
7386
options: AuthConfirmResetPasswordRequest.Options? = nil
7487
) async throws {
75-
try await plugin.confirmResetPassword(for: username, with: newPassword, confirmationCode: confirmationCode, options: options)
88+
try await plugin.confirmResetPassword(
89+
for: username,
90+
with: newPassword,
91+
confirmationCode: confirmationCode,
92+
options: options
93+
)
7694
}
7795

7896
public func setUpTOTP() async throws -> TOTPSetupDetails {

Amplify/Categories/Auth/AuthCategory+DeviceBehavior.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,16 @@ import Foundation
99

1010
extension AuthCategory: AuthCategoryDeviceBehavior {
1111

12-
public func fetchDevices( options: AuthFetchDevicesRequest.Options? = nil) async throws -> [AuthDevice] {
12+
public func fetchDevices(
13+
options: AuthFetchDevicesRequest.Options? = nil
14+
) async throws -> [AuthDevice] {
1315
return try await plugin.fetchDevices(options: options)
1416
}
1517

16-
public func forgetDevice( _ device: AuthDevice? = nil, options: AuthForgetDeviceRequest.Options? = nil) async throws {
18+
public func forgetDevice(
19+
_ device: AuthDevice? = nil,
20+
options: AuthForgetDeviceRequest.Options? = nil
21+
) async throws {
1722
try await plugin.forgetDevice(device, options: options)
1823
}
1924

Amplify/Categories/Auth/AuthCategory+UserBehavior.swift

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ extension AuthCategory: AuthCategoryUserBehavior {
1313
try await plugin.getCurrentUser()
1414
}
1515

16-
public func fetchUserAttributes(options: AuthFetchUserAttributesRequest.Options? = nil) async throws -> [AuthUserAttribute] {
16+
public func fetchUserAttributes(
17+
options: AuthFetchUserAttributesRequest.Options? = nil
18+
) async throws -> [AuthUserAttribute] {
1719
try await plugin.fetchUserAttributes(options: options)
1820
}
1921

20-
public func update(userAttribute: AuthUserAttribute, options: AuthUpdateUserAttributeRequest.Options? = nil) async throws -> AuthUpdateAttributeResult {
22+
public func update(
23+
userAttribute: AuthUserAttribute,
24+
options: AuthUpdateUserAttributeRequest.Options? = nil
25+
) async throws -> AuthUpdateAttributeResult {
2126
try await plugin.update(userAttribute: userAttribute, options: options)
2227
}
2328

@@ -45,10 +50,18 @@ extension AuthCategory: AuthCategoryUserBehavior {
4550
public func confirm(userAttribute: AuthUserAttributeKey,
4651
confirmationCode: String,
4752
options: AuthConfirmUserAttributeRequest.Options? = nil) async throws {
48-
try await plugin.confirm(userAttribute: userAttribute, confirmationCode: confirmationCode, options: options)
53+
try await plugin.confirm(
54+
userAttribute: userAttribute,
55+
confirmationCode: confirmationCode,
56+
options: options
57+
)
4958
}
5059

51-
public func update(oldPassword: String, to newPassword: String, options: AuthChangePasswordRequest.Options? = nil) async throws {
60+
public func update(
61+
oldPassword: String,
62+
to newPassword: String,
63+
options: AuthChangePasswordRequest.Options? = nil
64+
) async throws {
5265
try await plugin.update(oldPassword: oldPassword, to: newPassword, options: options)
5366
}
5467

0 commit comments

Comments
 (0)