Skip to content

Commit

Permalink
Don't show linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
okhan-okbay-cko committed Oct 26, 2023
1 parent e78fd77 commit 2067a7d
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/lintEditedFiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if EDITED_FILES=$(git diff HEAD origin/main --name-only --diff-filter=d | grep "
if [ -z "$EDITED_FILES" ]; then
echo "No edited .swift files found."
else
swiftlint lint $EDITED_FILES | sed -E 's/^(.*):([0-9]+):([0-9]+): (warning|error|[^:]+): (.*)/::\4 title=Lint error,file=\1,line=\2,col=\3::\5\n\1:\2:\3/'
swiftlint lint $EDITED_FILES | sed -E -n 's/^(.*):([0-9]+):([0-9]+): error: (.*)/::error file=\1,line=\2,col=\3::\4\n\1:\2:\3/p'
fi
else
echo "No changes in .swift files found."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ extension DefaultSecurityCodeFormStyle {
normalColor: .clear,
focusColor: .clear,
errorColor: .clear))



}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ extension SecurityCodeComponent {

extension SecurityCodeComponent: SecurityCodeViewDelegate {
func update(securityCode: String) {
guard securityCode.isEmpty else {
guard !securityCode.isEmpty else {
isSecurityCodeValid(false)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ public struct SecurityCodeComponentConfiguration {
let environment: Environment
public var style: SecurityCodeComponentStyle
public var cardScheme: Card.Scheme?

public init(apiKey: String,
environment: Environment,
style: SecurityCodeComponentStyle? = nil,
cardScheme: Card.Scheme? = nil) {
self.apiKey = apiKey
self.environment = environment
self.cardScheme = cardScheme

if let style = style {
self.style = style
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
16857B7E2A65F3F3005CAE39 /* XCUIApplication+TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16857B7D2A65F3F3005CAE39 /* XCUIApplication+TestHelpers.swift */; };
168CEC952AC5C71700BB52B0 /* SecurityCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 168CEC942AC5C71700BB52B0 /* SecurityCodeViewController.swift */; };
16900D442AE6BA38009A7CE9 /* SecurityCodeComponentUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16900D432AE6BA38009A7CE9 /* SecurityCodeComponentUITests.swift */; };
16900D4B2AE70F90009A7CE9 /* Frames in Frameworks */ = {isa = PBXBuildFile; productRef = 16900D4A2AE70F90009A7CE9 /* Frames */; };
16900D522AE7508C009A7CE9 /* Frames in Frameworks */ = {isa = PBXBuildFile; productRef = 16900D512AE7508C009A7CE9 /* Frames */; };
16900D542AE7C021009A7CE9 /* Frames in Frameworks */ = {isa = PBXBuildFile; productRef = 16900D532AE7C021009A7CE9 /* Frames */; };
16900D562AE7C025009A7CE9 /* Frames in Frameworks */ = {isa = PBXBuildFile; productRef = 16900D552AE7C025009A7CE9 /* Frames */; };
169DF1482A7BFB1B00891DF0 /* CardSchemeFormatSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 169DF1472A7BFB1B00891DF0 /* CardSchemeFormatSnapshotTests.swift */; };
16C3F8402A7927ED00690639 /* SnapshotTesting in Frameworks */ = {isa = PBXBuildFile; productRef = 16C3F83F2A7927ED00690639 /* SnapshotTesting */; };
16C3F8422A7956EA00690639 /* CardValidationSnapshotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 16C3F8412A7956EA00690639 /* CardValidationSnapshotTests.swift */; };
Expand Down Expand Up @@ -206,6 +208,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
16900D562AE7C025009A7CE9 /* Frames in Frameworks */,
16C3F8402A7927ED00690639 /* SnapshotTesting in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -214,14 +217,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
16900D542AE7C021009A7CE9 /* Frames in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
E6646F8720CE6C0900D8353A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
16900D4B2AE70F90009A7CE9 /* Frames in Frameworks */,
16900D522AE7508C009A7CE9 /* Frames in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -472,6 +476,7 @@
name = "iOS Example Frame Regression Tests";
packageProductDependencies = (
16C3F83F2A7927ED00690639 /* SnapshotTesting */,
16900D552AE7C025009A7CE9 /* Frames */,
);
productName = "iOS Example Frame Regression Tests";
productReference = 16857B712A65F15F005CAE39 /* iOS Example Frame Regression Tests.xctest */;
Expand All @@ -492,6 +497,7 @@
);
name = "iOS Example FrameUITests";
packageProductDependencies = (
16900D532AE7C021009A7CE9 /* Frames */,
);
productName = "iOS Example FrameUITests";
productReference = 16AE74C42A5C1EBB0031F794 /* iOS Example FrameUITests.xctest */;
Expand All @@ -511,7 +517,7 @@
);
name = "iOS Example Frame";
packageProductDependencies = (
16900D4A2AE70F90009A7CE9 /* Frames */,
16900D512AE7508C009A7CE9 /* Frames */,
);
productName = "iOS Example Frame";
productReference = 16AE74C32A5C1EBB0031F794 /* iOS Example Frame.app */;
Expand Down Expand Up @@ -560,7 +566,7 @@
mainGroup = E6646F8120CE6C0900D8353A;
packageReferences = (
16C3F83E2A7927ED00690639 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */,
16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */,
16900D502AE7508C009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */,
);
productRefGroup = E6646F8120CE6C0900D8353A;
projectDirPath = "";
Expand Down Expand Up @@ -1213,12 +1219,12 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */ = {
16900D502AE7508C009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/checkout/frames-ios";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 4.2.1;
branch = "feature/cvv-component";
kind = branch;
};
};
16C3F83E2A7927ED00690639 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */ = {
Expand All @@ -1232,9 +1238,19 @@
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
16900D4A2AE70F90009A7CE9 /* Frames */ = {
16900D512AE7508C009A7CE9 /* Frames */ = {
isa = XCSwiftPackageProductDependency;
package = 16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */;
package = 16900D502AE7508C009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */;
productName = Frames;
};
16900D532AE7C021009A7CE9 /* Frames */ = {
isa = XCSwiftPackageProductDependency;
package = 16900D502AE7508C009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */;
productName = Frames;
};
16900D552AE7C025009A7CE9 /* Frames */ = {
isa = XCSwiftPackageProductDependency;
package = 16900D502AE7508C009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */;
productName = Frames;
};
16C3F83F2A7927ED00690639 /* SnapshotTesting */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HomeViewController: UIViewController {
@IBOutlet private weak var defaultButton: UIButton!
@IBOutlet private weak var theme1Button: UIButton!
@IBOutlet weak var securityCodeComponentButton: UIButton!

private var notificationCenter: NotificationCenter = .default
private lazy var checkoutAPIService = Frames.CheckoutAPIService(publicKey: Factory.apiKey, environment: .sandbox)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ final class SecurityCodeViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()

defaultSecurityCodeComponent.accessibilityIdentifier = "DefaultSecurityCodeComponent"
defaultPayButton.accessibilityIdentifier = "DefaultPayButton"
customSecurityCodeComponent.accessibilityIdentifier = "CustomSecurityCodeComponent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ final class SecurityCodeComponentUITests: XCTestCase {
XCTAssertFalse(testData.payButton.isEnabled)
}
app.enterText(testData.text, into: testData.component)
XCTAssertEqual(testData.payButton.isEnabled, testData.isPayButtonEnabled)
XCTAssertEqual(testData.payButton.isEnabled,
testData.isPayButtonEnabled,
"Failed at component: \(testData.component), text: \(testData.text)")
}

// TODO: Add tokenisation test
Expand Down

0 comments on commit 2067a7d

Please sign in to comment.