diff --git a/platforms/swift/.swiftformat b/platforms/swift/.swiftformat index f601bcc1..1a7df57a 100644 --- a/platforms/swift/.swiftformat +++ b/platforms/swift/.swiftformat @@ -10,6 +10,5 @@ --swiftversion 5.7.1 --extensionacl on-declarations --exclude Sources/ShopifyCheckoutKit/Models.swift ---exclude Sources/ShopifyCheckoutProtocol/Generated --exclude Samples/MobileBuyIntegration/MobileBuyIntegration/Sources/Generated --exclude Samples/ShopifyAcceleratedCheckoutsApp/ShopifyAcceleratedCheckoutsApp/Generated diff --git a/platforms/swift/Scripts/lint b/platforms/swift/Scripts/lint index 22b82d4b..16902d67 100755 --- a/platforms/swift/Scripts/lint +++ b/platforms/swift/Scripts/lint @@ -99,15 +99,15 @@ if [[ "$VERBOSE" == "false" ]]; then QUIET_FLAG="--quiet" fi -if [[ "$MODE" == "fix" ]]; then - $SWIFTLINT lint --fix --no-cache $QUIET_FLAG -fi - # SwiftLint doesn't report errors when running in fix mode # Running again in strict mode to ensure no errors are missed. # Run from the directory containing .swiftlint.yml so its `included:` paths # resolve consistently. PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" +if [[ "$MODE" == "fix" ]]; then + (cd "$PROJECT_ROOT" && $SWIFTLINT lint --fix --no-cache $QUIET_FLAG) +fi + (cd "$PROJECT_ROOT" && $SWIFTLINT lint --strict --no-cache $QUIET_FLAG) LINT_STATUS=$?