Skip to content

Commit 08d7313

Browse files
authored
chore: Fixing SwiftLint warnings (#2732)
* chore: Fixing SwiftLint warnings in Amplify project * chore: Fixing SwiftLint warnings in APICategoryPlugin project * chore: Fixing SwiftLint warnings in AnalyticsCategoryPlugin project * chore: Fixing SwiftLint warnings in AWSCognitoAuthPlugin project * chore: Fixing SwiftLint warnings in DataStoreCategoryPlugin project * chore: Fixing SwiftLint warnings in PredictionsCategoryPlugin project * chore: Fixing SwiftLint warnings in StoragePlugin project
1 parent f575243 commit 08d7313

File tree

243 files changed

+686
-337
lines changed

Some content is hidden

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

243 files changed

+686
-337
lines changed

Amplify/Categories/API/Interceptor/URLRequestInterceptor.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import Foundation
1919
/// plugin.
2020
public protocol URLRequestInterceptor {
2121

22+
// swiftlint:disable:next todo
2223
// TODO: turn async https://github.com/aws-amplify/amplify-ios/issues/73
2324
/// Inspect and optionally modify the request, returning either the original
2425
/// unmodified request or a modified copy.

Amplify/Categories/API/Operation/GraphQLOperation.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ open class GraphQLOperation<R: Decodable>: AmplifyOperation<
1212
APIError
1313
> { }
1414

15-
1615
/// GraphQL Subscription Operation
1716
open class GraphQLSubscriptionOperation<R: Decodable>: AmplifyInProcessReportingOperation<
1817
GraphQLOperationRequest<R>,

Amplify/Categories/API/Request/GraphQLOperationRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public struct GraphQLOperationRequest<R: Decodable>: AmplifyOperationRequest {
4646
}
4747
}
4848

49-
// MARK: GraphQLOperationRequest + Options
49+
// MARK: GraphQLOperationRequest + Options
5050
public extension GraphQLOperationRequest {
5151
struct Options {
5252
public let pluginOptions: Any?

Amplify/Categories/API/Request/GraphQLRequest.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public struct GraphQLRequest<R: Decodable> {
4444
}
4545
}
4646

47-
4847
// MARK: GraphQLRequest + Options
4948

5049
public extension GraphQLRequest {

Amplify/Categories/Auth/Request/AuthChangePasswordRequest.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public extension AuthChangePasswordRequest {
3232

3333
struct Options {
3434

35+
// swiftlint:disable:next todo
3536
// TODO: Move this metadata to plugin options. All other request has the metadata
3637
// inside the plugin options.
3738

Amplify/Categories/Auth/Request/AuthDeleteUserRequest.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ public struct AuthDeleteUserRequest: AmplifyOperationRequest {
2020
public extension AuthDeleteUserRequest {
2121
struct Options {}
2222
}
23-

Amplify/Categories/DataStore/DataStoreCategory+Behavior.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ extension DataStoreCategory: DataStoreBaseBehavior {
2222
byIdentifier id: String,
2323
completion: (DataStoreResult<M?>) -> Void) where M: ModelIdentifiable,
2424
M.IdentifierFormat == ModelIdentifierFormat.Default {
25+
// swiftlint:disable:previous line_length
2526
plugin.query(modelType, byIdentifier: id, completion: completion)
2627
}
2728

@@ -57,7 +58,7 @@ extension DataStoreCategory: DataStoreBaseBehavior {
5758
where predicate: QueryPredicate? = nil,
5859
completion: @escaping DataStoreCallback<Void>) where M: ModelIdentifiable,
5960
M.IdentifierFormat == ModelIdentifierFormat.Default {
60-
61+
// swiftlint:disable:previous line_length
6162
plugin.delete(modelType, withIdentifier: id, where: predicate, completion: completion)
6263
}
6364

Amplify/Categories/DataStore/DataStoreCategoryBehavior.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ public protocol DataStoreBaseBehavior {
5151
where predicate: QueryPredicate?,
5252
completion: @escaping DataStoreCallback<Void>) where M: ModelIdentifiable,
5353
M.IdentifierFormat == ModelIdentifierFormat.Default
54+
// swiftlint:disable:previous line_length
5455

5556
func delete<M: Model>(_ modelType: M.Type,
5657
withIdentifier id: ModelIdentifier<M, M.IdentifierFormat>,
5758
where predicate: QueryPredicate?,
5859
completion: @escaping DataStoreCallback<Void>) where M: ModelIdentifiable
5960

6061
func delete<M: Model>(_ modelType: M.Type,
61-
where predicate: QueryPredicate,
62-
completion: @escaping DataStoreCallback<Void>)
62+
where predicate: QueryPredicate,
63+
completion: @escaping DataStoreCallback<Void>)
6364

6465
/**
6566
Synchronization starts automatically whenever you run any DataStore operation (query(), save(), delete())

Amplify/Categories/DataStore/DataStoreError.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ extension DataStoreError: AmplifyError {
6363
case .invalidDatabase(let path, _):
6464
return "Make sure the path \(path) is valid and the device has available storage space."
6565
case .invalidModelName(let modelName):
66+
// swiftlint:disable:next todo
6667
// TODO: Is this the right command to run to generate models?
6768
return "Make sure the model named '\(modelName)' is registered by running `amplify codegen`"
6869
case .invalidOperation(let causedBy):

Amplify/Categories/DataStore/Model/Collection/List+Model.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public class List<ModelType: Model>: Collection, Codable, ExpressibleByArrayLite
125125
// MARK: - Persistent Operations
126126

127127
public var totalCount: Int {
128+
// swiftlint:disable:next todo
128129
// TODO handle total count
129130
return 0
130131
}
@@ -143,6 +144,7 @@ public class List<ModelType: Model>: Collection, Codable, ExpressibleByArrayLite
143144
/// the plugin to successfully return an instance of `ModelListProvider`.
144145
required convenience public init(from decoder: Decoder) throws {
145146
for listDecoder in ModelListDecoderRegistry.listDecoders.get() {
147+
// swiftlint:disable:next for_where
146148
if listDecoder.shouldDecode(modelType: ModelType.self, decoder: decoder) {
147149
let listProvider = try listDecoder.makeListProvider(modelType: ModelType.self, decoder: decoder)
148150
self.init(listProvider: listProvider)

0 commit comments

Comments
 (0)