Skip to content

Commit

Permalink
[#12] Move Mockable import order for PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
blyscuit committed Dec 1, 2022
1 parent bbb9670 commit 4c741ff
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
9 changes: 5 additions & 4 deletions detekt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ complexity:
threshold: 150
LongMethod:
active: true
threshold: 30
threshold: 20
excludes: &testFolders
- '**/commonTest/**'
- '**/androidTest/**'
LongParameterList:
active: true
threshold: 5
Expand Down Expand Up @@ -298,9 +301,7 @@ style:
maxLineLength: 120
excludePackageStatements: false
excludeImportStatements: false
excludes: &testFolders
- '**/commonTest/**'
- '**/androidTest/**'
excludes: *testFolders
ModifierOrder:
active: true
NestedClassesVisibility:
Expand Down
2 changes: 1 addition & 1 deletion iosApp/tools/sourcery/templates/AutoMockable.stencil
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Foundation
import UserNotifications
#if os(iOS) || os(tvOS) || os(watchOS)
import UIKit
#elseif os(OSX)
import AppKit
#endif
import UserNotifications

{% for import in argument.autoMockableTestableImports %}
@testable import {{ import }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package co.nimblehq.blisskmmic.di.koin.modules

import co.nimblehq.blisskmmic.presentation.modules.login.LoginViewModel
import co.nimblehq.blisskmmic.presentation.modules.resetpassword.ResetPasswordViewModel
import org.koin.core.module.dsl.singleOf
import org.koin.dsl.module

val viewModelModule = module {
single<LoginViewModel> { LoginViewModel(get()) }
single { ResetPasswordViewModel(get()) }

singleOf(::LoginViewModel)
singleOf(::ResetPasswordViewModel)
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,8 @@ class ResetPasswordViewModel(
setStateLoading()
viewModelScope.launch {
resetPasswordUseCase(email)
.catch { error ->
catchResetPasswordError(error)
}
.collect { _ ->
resetPasswordSuccess()
}
.catch { handleResetPasswordError(it) }
.collect { _ -> resetPasswordSuccess() }
}
}

Expand All @@ -48,7 +44,7 @@ class ResetPasswordViewModel(
}
}

private fun catchResetPasswordError(error: Throwable) {
private fun handleResetPasswordError(error: Throwable) {
mutableViewState.update {
ResetPasswordViewState(error.toErrorMessage())
}
Expand Down

0 comments on commit 4c741ff

Please sign in to comment.