Skip to content

Commit 1a4e14b

Browse files
committed
Revert internal identifier
1 parent 6370e08 commit 1a4e14b

4 files changed

Lines changed: 48 additions & 57 deletions

File tree

.swiftformat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--indent 4
2+
--linebreaks lf
3+
--wraparguments before-first
4+
--wrapcollections before-first
5+
--commas inline
6+
--allman false
7+
--semicolons inline
8+
--trimwhitespace always
9+
--disable redundantReturn,hoistAwait,preferKeyPath,redundantInternal,redundantPublic
10+
--swiftversion 5.7.1
11+
--extensionacl on-declarations

modules/@shopify/checkout-sheet-kit/.swiftlint.yml renamed to .swiftlint.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ disabled_rules:
99
- function_body_length
1010
- trailing_comma
1111

12-
included:
13-
ios
14-
1512
opt_in_rules:
1613
- array_init
1714
- collection_alignment
@@ -32,6 +29,7 @@ opt_in_rules:
3229
- switch_case_alignment:
3330
indented_cases: false
3431
- fallthrough
32+
- explicit_acl
3533

3634
nesting:
3735
type_level:

modules/@shopify/checkout-sheet-kit/ios/ShopifyCheckoutSheetKit.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
/*
2-
MIT License
2+
MIT License
33

4-
Copyright 2023 - Present, Shopify Inc.
4+
Copyright 2023 - Present, Shopify Inc.
55

6-
Permission is hereby granted, free of charge, to any person obtaining a copy
7-
of this software and associated documentation files (the "Software"), to deal
8-
in the Software without restriction, including without limitation the rights
9-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
copies of the Software, and to permit persons to whom the Software is
11-
furnished to do so, subject to the following conditions:
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
1212

13-
The above copyright notice and this permission notice shall be included in all
14-
copies or substantial portions of the Software.
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
1515

16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22-
*/
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22+
*/
2323

2424
import Foundation
2525
import React
@@ -30,7 +30,7 @@ import UIKit
3030
class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
3131
private var hasListeners = false
3232

33-
var checkoutSheet: UIViewController?
33+
internal var checkoutSheet: UIViewController?
3434

3535
override var methodQueue: DispatchQueue! {
3636
return DispatchQueue.main
@@ -78,7 +78,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
7878
"__typename": "CheckoutExpiredError",
7979
"message": message,
8080
"code": code.rawValue,
81-
"recoverable": recoverable,
81+
"recoverable": recoverable
8282
])
8383
} else if case let .checkoutUnavailable(message, code, recoverable) = error {
8484
switch code {
@@ -87,38 +87,38 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
8787
"__typename": "CheckoutClientError",
8888
"message": message,
8989
"code": clientErrorCode.rawValue,
90-
"recoverable": recoverable,
90+
"recoverable": recoverable
9191
])
9292
case let .httpError(statusCode):
9393
sendEvent(withName: "error", body: [
9494
"__typename": "CheckoutHTTPError",
9595
"message": message,
9696
"code": "http_error",
9797
"statusCode": statusCode,
98-
"recoverable": recoverable,
98+
"recoverable": recoverable
9999
])
100100
}
101101
} else if case let .configurationError(message, code, recoverable) = error {
102102
sendEvent(withName: "error", body: [
103103
"__typename": "ConfigurationError",
104104
"message": message,
105105
"code": code.rawValue,
106-
"recoverable": recoverable,
106+
"recoverable": recoverable
107107
])
108108
} else if case let .sdkError(underlying, recoverable) = error {
109109
var errorMessage = "\(underlying.localizedDescription)"
110110
sendEvent(withName: "error", body: [
111111
"__typename": "InternalError",
112112
"code": "unknown",
113113
"message": errorMessage,
114-
"recoverable": recoverable,
114+
"recoverable": recoverable
115115
])
116116
} else {
117117
sendEvent(withName: "error", body: [
118118
"__typename": "UnknownError",
119119
"code": "unknown",
120120
"message": error.localizedDescription,
121-
"recoverable": error.isRecoverable,
121+
"recoverable": error.isRecoverable
122122
])
123123
}
124124
}
@@ -148,7 +148,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
148148

149149
@objc override func constantsToExport() -> [AnyHashable: Any]! {
150150
return [
151-
"version": ShopifyCheckoutSheetKit.version,
151+
"version": ShopifyCheckoutSheetKit.version
152152
]
153153
}
154154

@@ -250,7 +250,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
250250
"preloading": ShopifyCheckoutSheetKit.configuration.preloading.enabled,
251251
"colorScheme": ShopifyCheckoutSheetKit.configuration.colorScheme.rawValue,
252252
"tintColor": ShopifyCheckoutSheetKit.configuration.tintColor,
253-
"backgroundColor": ShopifyCheckoutSheetKit.configuration.backgroundColor,
253+
"backgroundColor": ShopifyCheckoutSheetKit.configuration.backgroundColor
254254
]
255255

256256
resolve(config)
@@ -290,7 +290,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
290290
"id": encoded["id"],
291291
"name": encoded["name"],
292292
"timestamp": encoded["timestamp"],
293-
"type": "STANDARD",
293+
"type": "STANDARD"
294294
] as [String: Any]
295295
}
296296

@@ -311,7 +311,7 @@ class RCTShopifyCheckoutSheetKit: RCTEventEmitter, CheckoutDelegate {
311311
"id": event.id,
312312
"name": event.name,
313313
"timestamp": event.timestamp,
314-
"type": "CUSTOM",
314+
"type": "CUSTOM"
315315
] as [String: Any]
316316
}
317317
}

scripts/lint_swift

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,14 @@
11
#!/bin/bash
22

33
DIR=modules/@shopify/checkout-sheet-kit
4-
5-
# Check for verbose flag
6-
VERBOSE=false
7-
if [[ "$*" == *"--verbose"* ]]; then
8-
VERBOSE=true
9-
fi
10-
11-
# Accept --verbose before check/fix
12-
if [[ "$1" == "--verbose" ]]; then
13-
MODE="${2:-check}"
14-
else
15-
MODE="${1:-check}"
16-
fi
4+
MODE="${1:-check}"
175

186
# Validate the mode
197
if [[ "$MODE" != "check" && "$MODE" != "fix" ]]; then
208
echo "❌ Invalid mode: $MODE"
21-
echo "Usage: $0 [check|fix] [--verbose]"
9+
echo "Usage: $0 [check|fix]"
2210
echo " check: Run linters in check mode (default)"
2311
echo " fix: Run linters in fix mode to auto-fix issues"
24-
echo " --verbose: Show detailed output from linters"
2512
exit 1
2613
fi
2714

@@ -49,30 +36,25 @@ if ! which swiftformat >/dev/null; then
4936
fi
5037

5138
# Run SwiftLint
52-
QUIET_FLAG=""
53-
if [[ "$VERBOSE" == "false" ]]; then
54-
QUIET_FLAG="--quiet"
55-
fi
56-
5739
if [[ "$MODE" == "check" ]]; then
5840
echo "🔄 Running SwiftLint in check mode..."
59-
swiftlint lint --strict $QUIET_FLAG $DIR
41+
swiftlint lint --strict $DIR
6042
LINT_STATUS=$?
6143
else
6244
echo "🔄 Running SwiftLint in fix mode..."
63-
swiftlint lint --fix $QUIET_FLAG $DIR
45+
swiftlint lint --fix $DIR
6446
LINT_STATUS=$?
6547
fi
6648
echo "SwiftLint exit status: $LINT_STATUS"
6749

6850
# Run SwiftFormat
6951
if [[ "$MODE" == "check" ]]; then
7052
echo "🔄 Running SwiftFormat in check mode..."
71-
swiftformat $DIR $QUIET_FLAG --lint
53+
swiftformat $DIR --lint
7254
FORMAT_STATUS=$?
7355
else
7456
echo "🔄 Running SwiftFormat in fix mode..."
75-
swiftformat $DIR $QUIET_FLAG
57+
swiftformat $DIR
7658
FORMAT_STATUS=$?
7759
fi
7860
echo "SwiftFormat exit status: $FORMAT_STATUS"
@@ -82,8 +64,8 @@ print_linting_error() {
8264
local tool_name=$1
8365
echo "$tool_name detected issues that need to be fixed."
8466
echo "🔧 How to fix:"
85-
echo " Shopify employee? Run 'dev fix' or 'dev lint --verbose' to see detailed output"
86-
echo " Not a Shopify employee? Run './Scripts/lint fix' to auto-fix issues"
67+
echo " Shopify employee? Run 'dev fix' or 'dev check' to see detailed output"
68+
echo " Not a Shopify employee? Run './scripts/lint_swift fix' to auto-fix issues"
8769
if [[ "$tool_name" == "SwiftLint" ]]; then
8870
echo " Then fix any remaining non-autofixable issues manually"
8971
fi

0 commit comments

Comments
 (0)