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 24, 2023
1 parent 0b349fd commit aebfc18
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 9 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 @@ -30,6 +30,8 @@
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 */; };
16900D4D2AE73FF4009A7CE9 /* Frames in Frameworks */ = {isa = PBXBuildFile; productRef = 16900D4C2AE73FF4009A7CE9 /* Frames */; };
16900D4F2AE741B7009A7CE9 /* Frames in Frameworks */ = {isa = PBXBuildFile; productRef = 16900D4E2AE741B7009A7CE9 /* 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 = (
16900D4F2AE741B7009A7CE9 /* Frames in Frameworks */,
16C3F8402A7927ED00690639 /* SnapshotTesting in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -214,6 +217,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
16900D4D2AE73FF4009A7CE9 /* Frames in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -472,6 +476,7 @@
name = "iOS Example Frame Regression Tests";
packageProductDependencies = (
16C3F83F2A7927ED00690639 /* SnapshotTesting */,
16900D4E2AE741B7009A7CE9 /* 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 = (
16900D4C2AE73FF4009A7CE9 /* Frames */,
);
productName = "iOS Example FrameUITests";
productReference = 16AE74C42A5C1EBB0031F794 /* iOS Example FrameUITests.xctest */;
Expand Down Expand Up @@ -1237,6 +1243,16 @@
package = 16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */;
productName = Frames;
};
16900D4C2AE73FF4009A7CE9 /* Frames */ = {
isa = XCSwiftPackageProductDependency;
package = 16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */;
productName = Frames;
};
16900D4E2AE741B7009A7CE9 /* Frames */ = {
isa = XCSwiftPackageProductDependency;
package = 16900D492AE70F90009A7CE9 /* XCRemoteSwiftPackageReference "frames-ios" */;
productName = Frames;
};
16C3F83F2A7927ED00690639 /* SnapshotTesting */ = {
isa = XCSwiftPackageProductDependency;
package = 16C3F83E2A7927ED00690639 /* XCRemoteSwiftPackageReference "swift-snapshot-testing" */;
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 aebfc18

Please sign in to comment.