update swift samples, use swiftlint 0.41.0 (#8138)

This commit is contained in:
William Cheng
2020-12-09 18:19:27 +08:00
committed by GitHub
parent 933a5dc2c6
commit 2e70405084
64 changed files with 64 additions and 64 deletions

View File

@@ -12,7 +12,7 @@ public struct Animal: Codable {
public var className: String
public var color: String? = "red"
public init(className: String, color: String? = nil) {
public init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ public struct Cat: Codable {
public var color: String? = "red"
public var declawed: Bool?
public init(className: String, color: String? = nil, declawed: Bool? = nil) {
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ public struct Category: Codable {
public var id: Int64?
public var name: String = "default-name"
public init(id: Int64? = nil, name: String) {
public init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ public struct Dog: Codable {
public var color: String? = "red"
public var breed: String?
public init(className: String, color: String? = nil, breed: String? = nil) {
public init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ public struct Order: Codable {
public var status: Status?
public var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ public struct TypeHolderDefault: Codable {
public var boolItem: Bool = true
public var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -88,7 +88,7 @@ class StoreAPITests: XCTestCase {
let progressExpectation = self.expectation(description: "obtain progress")
let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000)
requestBuilder.onProgressReady = { (progress) in
requestBuilder.onProgressReady = { (_) in
progressExpectation.fulfill()
}

View File

@@ -12,7 +12,7 @@ public struct Animal: Codable {
public var className: String
public var color: String? = "red"
public init(className: String, color: String? = nil) {
public init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ public struct Cat: Codable {
public var color: String? = "red"
public var declawed: Bool?
public init(className: String, color: String? = nil, declawed: Bool? = nil) {
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ public struct Category: Codable {
public var id: Int64?
public var name: String = "default-name"
public init(id: Int64? = nil, name: String) {
public init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ public struct Dog: Codable {
public var color: String? = "red"
public var breed: String?
public init(className: String, color: String? = nil, breed: String? = nil) {
public init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ public struct Order: Codable {
public var status: Status?
public var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ public struct TypeHolderDefault: Codable {
public var boolItem: Bool = true
public var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -12,7 +12,7 @@ public struct Animal: Codable {
public var className: String
public var color: String? = "red"
public init(className: String, color: String? = nil) {
public init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ public struct Cat: Codable {
public var color: String? = "red"
public var declawed: Bool?
public init(className: String, color: String? = nil, declawed: Bool? = nil) {
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ public struct Category: Codable {
public var id: Int64?
public var name: String = "default-name"
public init(id: Int64? = nil, name: String) {
public init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ public struct Dog: Codable {
public var color: String? = "red"
public var breed: String?
public init(className: String, color: String? = nil, breed: String? = nil) {
public init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ public struct Order: Codable {
public var status: Status?
public var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ public struct TypeHolderDefault: Codable {
public var boolItem: Bool = true
public var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -88,7 +88,7 @@ class StoreAPITests: XCTestCase {
let progressExpectation = self.expectation(description: "obtain progress")
let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000)
requestBuilder.onProgressReady = { (progress) in
requestBuilder.onProgressReady = { (_) in
progressExpectation.fulfill()
}

View File

@@ -24,7 +24,7 @@ public struct Order: Codable {
public var status: Status?
public var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -12,7 +12,7 @@ internal struct Animal: Codable {
internal var className: String
internal var color: String? = "red"
internal init(className: String, color: String? = nil) {
internal init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ internal struct Cat: Codable {
internal var color: String? = "red"
internal var declawed: Bool?
internal init(className: String, color: String? = nil, declawed: Bool? = nil) {
internal init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ internal struct Category: Codable {
internal var id: Int64?
internal var name: String = "default-name"
internal init(id: Int64? = nil, name: String) {
internal init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ internal struct Dog: Codable {
internal var color: String? = "red"
internal var breed: String?
internal init(className: String, color: String? = nil, breed: String? = nil) {
internal init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ internal struct Order: Codable {
internal var status: Status?
internal var complete: Bool? = false
internal init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
internal init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ internal struct TypeHolderDefault: Codable {
internal var boolItem: Bool = true
internal var arrayItem: [Int]
internal init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
internal init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -12,7 +12,7 @@ import Foundation
public var _className: String
public var color: String? = "red"
public init(_className: String, color: String? = nil) {
public init(_className: String, color: String? = "red") {
self._className = _className
self.color = color
}

View File

@@ -18,7 +18,7 @@ import Foundation
}
}
public init(_className: String, color: String? = nil, declawed: Bool? = nil) {
public init(_className: String, color: String? = "red", declawed: Bool? = nil) {
self._className = _className
self.color = color
self.declawed = declawed

View File

@@ -17,7 +17,7 @@ import Foundation
}
public var name: String = "default-name"
public init(_id: Int64? = nil, name: String) {
public init(_id: Int64? = nil, name: String = "default-name") {
self._id = _id
self.name = name
}

View File

@@ -13,7 +13,7 @@ import Foundation
public var color: String? = "red"
public var breed: String?
public init(_className: String, color: String? = nil, breed: String? = nil) {
public init(_className: String, color: String? = "red", breed: String? = nil) {
self._className = _className
self.color = color
self.breed = breed

View File

@@ -42,7 +42,7 @@ import Foundation
}
}
public init(_id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(_id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self._id = _id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ import Foundation
public var boolItem: Bool = true
public var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -12,7 +12,7 @@ public struct Animal: Codable {
public var className: String
public var color: String? = "red"
public init(className: String, color: String? = nil) {
public init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ public struct Cat: Codable {
public var color: String? = "red"
public var declawed: Bool?
public init(className: String, color: String? = nil, declawed: Bool? = nil) {
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ public struct Category: Codable {
public var id: Int64?
public var name: String = "default-name"
public init(id: Int64? = nil, name: String) {
public init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ public struct Dog: Codable {
public var color: String? = "red"
public var breed: String?
public init(className: String, color: String? = nil, breed: String? = nil) {
public init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ public struct Order: Codable {
public var status: Status?
public var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ public struct TypeHolderDefault: Codable {
public var boolItem: Bool = true
public var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -12,7 +12,7 @@ public struct Animal: Codable {
public private(set) var className: String
public private(set) var color: String? = "red"
public init(className: String, color: String? = nil) {
public init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ public struct Cat: Codable {
public private(set) var color: String? = "red"
public private(set) var declawed: Bool?
public init(className: String, color: String? = nil, declawed: Bool? = nil) {
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ public struct Category: Codable {
public private(set) var id: Int64?
public private(set) var name: String = "default-name"
public init(id: Int64? = nil, name: String) {
public init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ public struct Dog: Codable {
public private(set) var color: String? = "red"
public private(set) var breed: String?
public init(className: String, color: String? = nil, breed: String? = nil) {
public init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ public struct Order: Codable {
public private(set) var status: Status?
public private(set) var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ public struct TypeHolderDefault: Codable {
public private(set) var boolItem: Bool = true
public private(set) var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -12,7 +12,7 @@ public struct Animal: Codable {
public var className: String
public var color: String? = "red"
public init(className: String, color: String? = nil) {
public init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ public struct Cat: Codable {
public var color: String? = "red"
public var declawed: Bool?
public init(className: String, color: String? = nil, declawed: Bool? = nil) {
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ public struct Category: Codable {
public var id: Int64?
public var name: String = "default-name"
public init(id: Int64? = nil, name: String) {
public init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ public struct Dog: Codable {
public var color: String? = "red"
public var breed: String?
public init(className: String, color: String? = nil, breed: String? = nil) {
public init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ public struct Order: Codable {
public var status: Status?
public var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ public struct TypeHolderDefault: Codable {
public var boolItem: Bool = true
public var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -12,7 +12,7 @@ public struct Animal: Codable {
public var className: String
public var color: String? = "red"
public init(className: String, color: String? = nil) {
public init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ public struct Cat: Codable {
public var color: String? = "red"
public var declawed: Bool?
public init(className: String, color: String? = nil, declawed: Bool? = nil) {
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ public struct Category: Codable {
public var id: Int64?
public var name: String = "default-name"
public init(id: Int64? = nil, name: String) {
public init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ public struct Dog: Codable {
public var color: String? = "red"
public var breed: String?
public init(className: String, color: String? = nil, breed: String? = nil) {
public init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ public struct Order: Codable {
public var status: Status?
public var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ public struct TypeHolderDefault: Codable {
public var boolItem: Bool = true
public var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -12,7 +12,7 @@ public struct Animal: Codable {
public var className: String
public var color: String? = "red"
public init(className: String, color: String? = nil) {
public init(className: String, color: String? = "red") {
self.className = className
self.color = color
}

View File

@@ -13,7 +13,7 @@ public struct Cat: Codable {
public var color: String? = "red"
public var declawed: Bool?
public init(className: String, color: String? = nil, declawed: Bool? = nil) {
public init(className: String, color: String? = "red", declawed: Bool? = nil) {
self.className = className
self.color = color
self.declawed = declawed

View File

@@ -12,7 +12,7 @@ public struct Category: Codable {
public var id: Int64?
public var name: String = "default-name"
public init(id: Int64? = nil, name: String) {
public init(id: Int64? = nil, name: String = "default-name") {
self.id = id
self.name = name
}

View File

@@ -13,7 +13,7 @@ public struct Dog: Codable {
public var color: String? = "red"
public var breed: String?
public init(className: String, color: String? = nil, breed: String? = nil) {
public init(className: String, color: String? = "red", breed: String? = nil) {
self.className = className
self.color = color
self.breed = breed

View File

@@ -22,7 +22,7 @@ public struct Order: Codable {
public var status: Status?
public var complete: Bool? = false
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = nil) {
public init(id: Int64? = nil, petId: Int64? = nil, quantity: Int? = nil, shipDate: Date? = nil, status: Status? = nil, complete: Bool? = false) {
self.id = id
self.petId = petId
self.quantity = quantity

View File

@@ -15,7 +15,7 @@ public struct TypeHolderDefault: Codable {
public var boolItem: Bool = true
public var arrayItem: [Int]
public init(stringItem: String, numberItem: Double, integerItem: Int, boolItem: Bool, arrayItem: [Int]) {
public init(stringItem: String = "what", numberItem: Double, integerItem: Int, boolItem: Bool = true, arrayItem: [Int]) {
self.stringItem = stringItem
self.numberItem = numberItem
self.integerItem = integerItem

View File

@@ -88,7 +88,7 @@ class StoreAPITests: XCTestCase {
let progressExpectation = self.expectation(description: "obtain progress")
let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000)
requestBuilder.onProgressReady = { (progress) in
requestBuilder.onProgressReady = { (_) in
progressExpectation.fulfill()
}