Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
awush-stripe committed Mar 11, 2022
1 parent a1b96d2 commit ece22db
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ internal sealed class CardVerificationScanState(isFinal: Boolean) : ScanState(is

@Keep
internal open class CardImageVerificationActivity :
SimpleScanActivity<CardVerificationFlowParameters?>(), SimpleScanStateful<CardVerificationScanState> {
SimpleScanActivity<CardVerificationFlowParameters?>(),
SimpleScanStateful<CardVerificationScanState> {

override var scanState: CardVerificationScanState? = CardVerificationScanState.NotFound

Expand Down Expand Up @@ -117,8 +118,12 @@ internal open class CardImageVerificationActivity :
protected open val processingTextView by lazy { TextView(this) }

private val params: CardImageVerificationSheetParams by lazy {
intent.getParcelableExtra(INTENT_PARAM_REQUEST)
?: CardImageVerificationSheetParams("", CardImageVerificationSheet.Configuration(), "", "")
intent.getParcelableExtra(INTENT_PARAM_REQUEST) ?: CardImageVerificationSheetParams(
stripePublishableKey = "",
configuration = CardImageVerificationSheet.Configuration(),
cardImageVerificationIntentId = "",
cardImageVerificationIntentSecret = "",
)
}

/**
Expand Down Expand Up @@ -356,7 +361,9 @@ internal open class CardImageVerificationActivity :
private fun onScanDetailsAvailable(
cardVerificationFlowParameters: CardVerificationFlowParameters?,
) {
if (cardVerificationFlowParameters != null && !cardVerificationFlowParameters.lastFour.isNullOrEmpty()) {
if (cardVerificationFlowParameters != null &&
!cardVerificationFlowParameters.lastFour.isNullOrEmpty()
) {
this.requiredCardIssuer = cardVerificationFlowParameters.cardIssuer
this.requiredCardLastFour = cardVerificationFlowParameters.lastFour

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ internal sealed class MainLoopState(
requiredLastFour = requiredLastFour,
strictModeFrames = strictModeFrames,
)
else -> this // comparisonResult is CardMatchResult.NoPan or not enough visible cards
else -> this // comparisonResult is NoPan or not enough visible cards
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class MainLoopStateMachineTest {

@Test
@ExperimentalCoroutinesApi
fun `initial state does not transition when OCR is not found but a card is visible`() = runTest {
fun `initial state doesn't transition when OCR is not found but a card is visible`() = runTest {
val state = MainLoopState.Initial(
requiredCardIssuer = CardIssuer.Visa,
requiredLastFour = "8770",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RetryTest {

assertEquals(
1,
retry({ _, _-> 1.milliseconds }) {
retry({ _, _ -> 1.milliseconds }) {
executions++
1
}
Expand All @@ -34,7 +34,7 @@ class RetryTest {

assertEquals(
1,
retry({ _, _-> 1.milliseconds }) {
retry({ _, _ -> 1.milliseconds }) {
executions++
if (executions == 2) {
1
Expand All @@ -53,7 +53,7 @@ class RetryTest {
var executions = 0

assertFailsWith<RuntimeException> {
retry<Int>({ _, _-> 1.milliseconds }) {
retry<Int>({ _, _ -> 1.milliseconds }) {
executions++
throw RuntimeException()
}
Expand All @@ -68,7 +68,10 @@ class RetryTest {
var executions = 0

assertFailsWith<RuntimeException> {
retry<Int>({ _, _-> 1.milliseconds }, excluding = listOf(RuntimeException::class.java)) {
retry<Int>(
retryDelayFunction = { _, _ -> 1.milliseconds },
excluding = listOf(RuntimeException::class.java),
) {
executions++
throw RuntimeException()
}
Expand Down

0 comments on commit ece22db

Please sign in to comment.