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

Adds swiftlint #63

Merged
merged 7 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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: 1 addition & 0 deletions Chargebee/Classes/Purchase/CBPurchaseManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ extension CBPurchase: SKProductsRequestDelegate {

// MARK: - SKPaymentTransactionObserver delegates
extension CBPurchase: SKPaymentTransactionObserver {
// swiftlint:disable:next cyclomatic_complexity
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporarily disables lint check. This will be refactored separately. cc: @cb-gadagoju

public func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
transactions.forEach { (transaction) in
switch transaction.transactionState {
Expand Down
2 changes: 1 addition & 1 deletion Chargebee/Classes/Restore/BackgroundOperationQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class BackgroundOperationQueue: OperationQueue {

func observeValueForKeyPath(keyPath: String?, ofObject object: AnyObject?, change: [String : AnyObject]?, context: UnsafeMutableRawPointer) {
if let operationPath = keyPath, operationPath == BackgroundOperationQueue.operationsKeyPath {
if self.operations.count == 0 {
if self.operations.isEmpty {
OperationQueue.main.addOperation({
self.completionBlock?()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ extension CBPurchase{
let productIdsList = restoreResult.inAppSubscriptions.map { planID in
return planID.planID
}
if productIdsList.count > 0 {
if !productIdsList.isEmpty {
self.getPruchaseProductsList(productIds: productIdsList)
}
case .error(let error):
Expand Down
5 changes: 4 additions & 1 deletion .swiftlint.yml → Example/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ opt_in_rules:
- trailing_semicolon
- trailing_whitespace

included:
- ../Chargebee

excluded:
- Pods
- Tests/chargebee-iosTests
- Example
- Chargebee

file_header:
required_pattern: |
Expand Down
34 changes: 29 additions & 5 deletions Example/Chargebee Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
0C218DF26D79BAD52E24597C /* Pods-Chargebee Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Chargebee Example.debug.xcconfig"; path = "Target Support Files/Pods-Chargebee Example/Pods-Chargebee Example.debug.xcconfig"; sourceTree = "<group>"; };
11D26FE36CF981E946EE2FFA /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
20CCB492265ACAAD003E7AAD /* CBSDKProductsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBSDKProductsTableViewController.swift; sourceTree = "<group>"; };
20CCB4B4265BB090003E7AAD /* CBSDKSubscriptionStatusViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBSDKSubscriptionStatusViewController.swift; sourceTree = "<group>"; };
2172435AB6EDB8C0EB2804F6 /* Pods_Chargebee_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Chargebee_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2B70DA172A863ACA009E7DE5 /* Pods_Chargebee_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_Chargebee_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2BF2D52D29A3C6F400E22D21 /* Chargebee.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Chargebee.xcodeproj; path = ../Chargebee.xcodeproj; sourceTree = "<group>"; };
372AB47A894F58E78F9AFA7C /* Pods-Chargebee_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Chargebee_Tests.debug.xcconfig"; path = "Target Support Files/Pods-Chargebee_Tests/Pods-Chargebee_Tests.debug.xcconfig"; sourceTree = "<group>"; };
607FACD01AFB9204008FA782 /* Chargebee Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Chargebee Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -83,6 +85,7 @@
90C8D07D26A9CB260004EE81 /* CBSDKItemTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBSDKItemTableViewCell.swift; sourceTree = "<group>"; };
90C8D07F26A9CDC10004EE81 /* CBSDKItemsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBSDKItemsTableViewController.swift; sourceTree = "<group>"; };
90C8D08526AAA8480004EE81 /* CBSDKItemViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CBSDKItemViewController.swift; sourceTree = "<group>"; };
B4938B9769F3B86207C03888 /* Pods-Chargebee Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Chargebee Example.release.xcconfig"; path = "Target Support Files/Pods-Chargebee Example/Pods-Chargebee Example.release.xcconfig"; sourceTree = "<group>"; };
C7F2A43A1A9BBA92A21E3458 /* Pods-Chargebee_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Chargebee_Tests.release.xcconfig"; path = "Target Support Files/Pods-Chargebee_Tests/Pods-Chargebee_Tests.release.xcconfig"; sourceTree = "<group>"; };
D16C7EFA579E1C49742E668F /* Pods-Chargebee_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Chargebee_Example.release.xcconfig"; path = "Target Support Files/Pods-Chargebee_Example/Pods-Chargebee_Example.release.xcconfig"; sourceTree = "<group>"; };
D4796B64270ACC0500E8313F /* Configuration.storekit */ = {isa = PBXFileReference; lastKnownFileType = text; path = Configuration.storekit; sourceTree = "<group>"; };
Expand Down Expand Up @@ -176,6 +179,8 @@
D16C7EFA579E1C49742E668F /* Pods-Chargebee_Example.release.xcconfig */,
372AB47A894F58E78F9AFA7C /* Pods-Chargebee_Tests.debug.xcconfig */,
C7F2A43A1A9BBA92A21E3458 /* Pods-Chargebee_Tests.release.xcconfig */,
0C218DF26D79BAD52E24597C /* Pods-Chargebee Example.debug.xcconfig */,
B4938B9769F3B86207C03888 /* Pods-Chargebee Example.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -236,6 +241,7 @@
AAD4F8DC1372EE4D1A09D929 /* Frameworks */ = {
isa = PBXGroup;
children = (
2B70DA172A863ACA009E7DE5 /* Pods_Chargebee_Example.framework */,
FB2113E429E5CB2E00BE0ED2 /* StoreKit.framework */,
2BF2D52D29A3C6F400E22D21 /* Chargebee.xcodeproj */,
2172435AB6EDB8C0EB2804F6 /* Pods_Chargebee_Example.framework */,
Expand Down Expand Up @@ -264,6 +270,7 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
153FF0938DA9A89FF4740119 /* [CP] Embed Pods Frameworks */,
2BFC1E3829CCCB9900805257 /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -372,7 +379,7 @@
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Chargebee_Example-checkManifestLockResult.txt",
"$(DERIVED_FILE_DIR)/Pods-Chargebee Example-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -385,7 +392,7 @@
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Chargebee_Example/Pods-Chargebee_Example-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-Chargebee Example/Pods-Chargebee Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Chargebee/Chargebee.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -394,9 +401,26 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Chargebee_Example/Pods-Chargebee_Example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Chargebee Example/Pods-Chargebee Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
2BFC1E3829CCCB9900805257 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/SwiftLint/swiftlint\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand Down Expand Up @@ -565,7 +589,7 @@
};
607FACF01AFB9204008FA782 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 880524BD03DBC913F225A876 /* Pods-Chargebee_Example.debug.xcconfig */;
baseConfigurationReference = 0C218DF26D79BAD52E24597C /* Pods-Chargebee Example.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
Expand All @@ -590,7 +614,7 @@
};
607FACF11AFB9204008FA782 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D16C7EFA579E1C49742E668F /* Pods-Chargebee_Example.release.xcconfig */;
baseConfigurationReference = B4938B9769F3B86207C03888 /* Pods-Chargebee Example.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "swiftyreachability",
"kind" : "remoteSourceControl",
"location" : "https://github.com/antonio-war/SwiftyReachability",
"state" : {
"revision" : "726839ecab67923a02974fb63b52294de2beb39b",
"version" : "1.0.1"
}
}
],
"version" : 2
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "swiftyreachability",
"kind" : "remoteSourceControl",
"location" : "https://github.com/antonio-war/SwiftyReachability",
"state" : {
"revision" : "726839ecab67923a02974fb63b52294de2beb39b",
"version" : "1.0.1"
}
}
],
"version" : 2
}
3 changes: 2 additions & 1 deletion Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use_frameworks!

target 'Chargebee_Example' do
target 'Chargebee Example' do
pod 'Chargebee', :path => '../'
pod 'SwiftLint'

end
15 changes: 11 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
PODS:
- Chargebee (1.0.5)
- Chargebee (1.0.19)
- SwiftLint (0.50.3)

DEPENDENCIES:
- Chargebee (from `../`)
- SwiftLint

SPEC REPOS:
trunk:
- SwiftLint

EXTERNAL SOURCES:
Chargebee:
:path: "../"

SPEC CHECKSUMS:
Chargebee: b2d0e391cee23c019a69e9315710085f6ae7dc94
Chargebee: ea68cc06a7e806fc5bd319c435e079690fd0b3c0
SwiftLint: 77f7cb2b9bb81ab4a12fcc86448ba3f11afa50c6

PODFILE CHECKSUM: 77557d41e3cf386682df6c3bcbe52a22ff0c898c
PODFILE CHECKSUM: 69e5230dbd3b9821c28c620fcedf2f5e626375c3

COCOAPODS: 1.10.2
COCOAPODS: 1.11.3

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions Example/Pods/Local Podspecs/Chargebee.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading