Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Swiftlint 0.22.0 #270

Merged
merged 2 commits into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion SwiftyStoreKit-iOS-Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
SwiftyStoreKit.completeTransactions(atomically: true) { purchases in

for purchase in purchases {
// swiftlint:disable:next for_where
if purchase.transaction.transactionState == .purchased || purchase.transaction.transactionState == .restored {

if purchase.needsFinishTransaction {
Expand Down
1 change: 0 additions & 1 deletion SwiftyStoreKit-macOS-Demo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
SwiftyStoreKit.completeTransactions(atomically: true) { purchases in

for purchase in purchases {
// swiftlint:disable:next for_where
if purchase.transaction.transactionState == .purchased || purchase.transaction.transactionState == .restored {

if purchase.needsFinishTransaction {
Expand Down
34 changes: 17 additions & 17 deletions SwiftyStoreKitTests/InAppReceiptVerificatorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
refreshCalled = true
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(refreshCalled)
}

Expand All @@ -100,9 +100,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
refreshCalled = true
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(refreshCalled)
}

Expand All @@ -120,9 +120,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
refreshCalled = true
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(refreshCalled)
}

Expand All @@ -137,10 +137,10 @@ class InAppReceiptVerificatorTests: XCTestCase {
callback(.error(e: refreshError))
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { result in
}, completion: { result in

XCTAssertEqual(result, VerifyReceiptResult.error(error: ReceiptError.networkError(error: refreshError)))
}
})
}

func testVerifyReceipt_when_appStoreReceiptURLIsNil_refreshCallbackSuccess_receiptDataNotWritten_then_errorNoReceiptData_validateNotCalled() {
Expand All @@ -152,11 +152,11 @@ class InAppReceiptVerificatorTests: XCTestCase {

callback(.success)
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)
}) { result in

}, completion: { result in

XCTAssertEqual(result, VerifyReceiptResult.error(error: ReceiptError.noReceiptData))
}
})
XCTAssertFalse(validator.validateCalled)
}

Expand All @@ -173,10 +173,10 @@ class InAppReceiptVerificatorTests: XCTestCase {
callback(.success)
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { result in
}, completion: { result in

XCTAssertEqual(result, VerifyReceiptResult.error(error: ReceiptError.noReceiptData))
}
})
XCTAssertFalse(validator.validateCalled)
removeReceiptData(at: testReceiptURL)
}
Expand All @@ -194,9 +194,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
callback(.success)
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(validator.validateCalled)
removeReceiptData(at: testReceiptURL)
}
Expand All @@ -215,9 +215,9 @@ class InAppReceiptVerificatorTests: XCTestCase {
XCTFail("refresh should not be called if we already have a receipt")
return TestInAppReceiptRefreshRequest(receiptProperties: properties, callback: callback)

}) { _ in
}, completion: { _ in

}
})
XCTAssertTrue(validator.validateCalled)
removeReceiptData(at: testReceiptURL)
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_swiftlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
set -e

SWIFTLINT_PKG_PATH="/tmp/SwiftLint.pkg"
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.21.0/SwiftLint.pkg"
SWIFTLINT_PKG_URL="https://github.com/realm/SwiftLint/releases/download/0.22.0/SwiftLint.pkg"

wget --output-document=$SWIFTLINT_PKG_PATH $SWIFTLINT_PKG_URL

Expand Down