diff --git a/core/common/src/main/kotlin/com/ninecraft/booket/core/common/extensions/Context.kt b/core/common/src/main/kotlin/com/ninecraft/booket/core/common/extensions/Context.kt index d1fa560b..17b29ffa 100644 --- a/core/common/src/main/kotlin/com/ninecraft/booket/core/common/extensions/Context.kt +++ b/core/common/src/main/kotlin/com/ninecraft/booket/core/common/extensions/Context.kt @@ -16,7 +16,6 @@ import androidx.core.content.FileProvider import com.orhanobut.logger.Logger import java.io.File -@Suppress("TooGenericExceptionCaught") fun Context.externalShareForBitmap(bitmap: ImageBitmap) { try { val file = File(bitmap.saveToDisk(this)) @@ -31,7 +30,6 @@ fun Context.externalShareForBitmap(bitmap: ImageBitmap) { } } -@Suppress("TooGenericExceptionCaught") fun Context.saveImageToGallery(bitmap: ImageBitmap) { try { val fileName = "reed_record_${System.currentTimeMillis()}.png" diff --git a/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/HandleException.kt b/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/HandleException.kt index e8e9ee56..7474fcb8 100644 --- a/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/HandleException.kt +++ b/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/HandleException.kt @@ -93,7 +93,6 @@ fun postErrorDialog( ErrorEventHelper.sendError(event = ErrorEvent.ShowDialog(spec)) } -@Suppress("TooGenericExceptionCaught") private fun HttpException.parseErrorMessage(): String? { return try { val errorBody = response()?.errorBody()?.string() diff --git a/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/RunSuspendCatching.kt b/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/RunSuspendCatching.kt index b0152b27..59853c23 100644 --- a/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/RunSuspendCatching.kt +++ b/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/RunSuspendCatching.kt @@ -14,7 +14,7 @@ import kotlin.contracts.ExperimentalContracts */ @OptIn(ExperimentalContracts::class) -@Suppress("WRONG_INVOCATION_KIND", "TooGenericExceptionCaught") +@Suppress("WRONG_INVOCATION_KIND") inline fun runSuspendCatching(block: () -> T): Result { // 계약(contract): 컴파일러에게 'block' 람다의 실행 시점과 횟수를 명시적으로 알림 // 'callsInPlace'와 'EXACTLY_ONCE'는 'block'이 이 함수 내에서 즉시, 그리고 정확히 한 번만 실행됨을 보장 diff --git a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt index ba0e0e96..9ed28eb9 100644 --- a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt +++ b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt @@ -193,7 +193,7 @@ internal fun RecordRegisterResponse.toModel(): RecordRegisterModel { pageNumber = pageNumber, quote = quote, emotionTags = emotionTags, - review = review, + review = review ?: "", createdAt = createdAt, updatedAt = updatedAt, ) @@ -215,7 +215,7 @@ internal fun ReadingRecord.toModel(): ReadingRecordModel { userBookId = userBookId, pageNumber = pageNumber, quote = quote, - review = review, + review = review ?: "", emotionTags = emotionTags, createdAt = createdAt, updatedAt = updatedAt, @@ -232,7 +232,7 @@ internal fun RecordDetailResponse.toModel(): RecordDetailModel { userBookId = userBookId, pageNumber = pageNumber, quote = quote, - review = review, + review = review ?: "", emotionTags = emotionTags, createdAt = createdAt.toFormattedDate(), updatedAt = updatedAt.toFormattedDate(), diff --git a/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt b/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt index 2694b2a9..457ea401 100644 --- a/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt +++ b/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultBookRecentSearchDataSource.kt @@ -17,7 +17,6 @@ import javax.inject.Inject class DefaultBookRecentSearchDataSource @Inject constructor( @BookRecentSearchDataStore private val dataStore: DataStore, ) : BookRecentSearchDataSource { - @Suppress("TooGenericExceptionCaught") override val recentSearches: Flow> = dataStore.data .handleIOException() .map { prefs -> @@ -34,7 +33,6 @@ class DefaultBookRecentSearchDataSource @Inject constructor( } ?: emptyList() } - @Suppress("TooGenericExceptionCaught") override suspend fun addRecentSearch(query: String) { if (query.isBlank()) return @@ -66,7 +64,6 @@ class DefaultBookRecentSearchDataSource @Inject constructor( } } - @Suppress("TooGenericExceptionCaught") override suspend fun deleteRecentSearch(query: String) { dataStore.edit { prefs -> val currentSearches = prefs[BOOK_RECENT_SEARCHES]?.let { jsonString -> diff --git a/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt b/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt index b666c888..97cd15d7 100644 --- a/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt +++ b/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultLibraryRecentSearchDataSource.kt @@ -17,7 +17,6 @@ import javax.inject.Inject class DefaultLibraryRecentSearchDataSource @Inject constructor( @LibraryRecentSearchDataStore private val dataStore: DataStore, ) : LibraryRecentSearchDataSource { - @Suppress("TooGenericExceptionCaught") override val recentSearches: Flow> = dataStore.data .handleIOException() .map { prefs -> @@ -34,7 +33,6 @@ class DefaultLibraryRecentSearchDataSource @Inject constructor( } ?: emptyList() } - @Suppress("TooGenericExceptionCaught") override suspend fun addRecentSearch(query: String) { if (query.isBlank()) return @@ -66,7 +64,6 @@ class DefaultLibraryRecentSearchDataSource @Inject constructor( } } - @Suppress("TooGenericExceptionCaught") override suspend fun deleteRecentSearch(query: String) { dataStore.edit { prefs -> val currentSearches = prefs[LIBRARY_RECENT_SEARCHES]?.let { jsonString -> diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/TokenAuthenticator.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/TokenAuthenticator.kt index 1300b8b3..011ab824 100644 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/TokenAuthenticator.kt +++ b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/TokenAuthenticator.kt @@ -12,7 +12,6 @@ import okhttp3.Route import javax.inject.Inject import javax.inject.Provider -@Suppress("TooGenericExceptionCaught") class TokenAuthenticator @Inject constructor( private val tokenDataSource: TokenDataSource, private val serviceProvider: Provider, diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt index 324c5784..f1148819 100644 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt +++ b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt @@ -28,7 +28,7 @@ data class ReadingRecord( @SerialName("quote") val quote: String, @SerialName("review") - val review: String = "", + val review: String?, @SerialName("emotionTags") val emotionTags: List = emptyList(), @SerialName("createdAt") diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordDetailResponse.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordDetailResponse.kt index 1c5441f7..c78a219b 100644 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordDetailResponse.kt +++ b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordDetailResponse.kt @@ -14,7 +14,7 @@ data class RecordDetailResponse( @SerialName("quote") val quote: String, @SerialName("review") - val review: String, + val review: String?, @SerialName("emotionTags") val emotionTags: List, @SerialName("createdAt") diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordRegisterResponse.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordRegisterResponse.kt index b83b33d9..a6a4c2b5 100644 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordRegisterResponse.kt +++ b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordRegisterResponse.kt @@ -16,7 +16,7 @@ data class RecordRegisterResponse( @SerialName("emotionTags") val emotionTags: List, @SerialName("review") - val review: String, + val review: String?, @SerialName("createdAt") val createdAt: String, @SerialName("updatedAt") diff --git a/detekt-config.yml b/detekt-config.yml index 36951a0c..e37e154c 100644 --- a/detekt-config.yml +++ b/detekt-config.yml @@ -68,6 +68,10 @@ style: MaxLineLength: active: false +exceptions: + TooGenericExceptionCaught: + active: false + naming: TopLevelPropertyNaming: constantPattern: '[A-Z][A-Za-z0-9_]*' diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt index 67d3e962..ce5bf499 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt @@ -87,7 +87,6 @@ class BookDetailPresenter @AssistedInject constructor( var isBookDeleteDialogVisible by rememberRetained { mutableStateOf(false) } var sideEffect by rememberRetained { mutableStateOf(null) } - @Suppress("TooGenericExceptionCaught") fun initialLoad() { uiState = UiState.Loading diff --git a/feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/record/RecordEditPresenter.kt b/feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/record/RecordEditPresenter.kt index 427ce11e..0c1b7220 100644 --- a/feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/record/RecordEditPresenter.kt +++ b/feature/edit/src/main/kotlin/com/ninecraft/booket/feature/edit/record/RecordEditPresenter.kt @@ -67,7 +67,6 @@ class RecordEditPresenter @AssistedInject constructor( derivedStateOf { recordPageState.text.isNotEmpty() && recordQuoteState.text.isNotEmpty() && - recordImpressionState.text.isNotEmpty() && !isPageError && hasChanges } diff --git a/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt b/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt index 36b7b33e..bb49fec0 100644 --- a/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt +++ b/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/EmotionStep.kt @@ -111,7 +111,7 @@ fun EmotionStep( .padding(horizontal = ReedTheme.spacing.spacing5) .padding(bottom = ReedTheme.spacing.spacing4), enabled = state.isNextButtonEnabled, - text = stringResource(R.string.record_next_button), + text = stringResource(R.string.record_next_button_text), multipleEventsCutterEnabled = false, ) } diff --git a/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/ImpressionStep.kt b/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/ImpressionStep.kt index b9a6e275..4a1dd16b 100644 --- a/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/ImpressionStep.kt +++ b/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/ImpressionStep.kt @@ -189,7 +189,7 @@ fun ImpressionStep( vertical = ReedTheme.spacing.spacing4, ), enabled = state.isNextButtonEnabled, - text = stringResource(R.string.record_next_button), + text = stringResource(R.string.record_finish_button_text), multipleEventsCutterEnabled = true, ) } diff --git a/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt b/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt index b9318765..42a76fa6 100644 --- a/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt +++ b/feature/record/src/main/kotlin/com/ninecraft/booket/feature/record/step/QuoteStep.kt @@ -176,7 +176,7 @@ internal fun QuoteStep( vertical = ReedTheme.spacing.spacing4, ), enabled = state.isNextButtonEnabled, - text = stringResource(R.string.record_next_button), + text = stringResource(R.string.record_next_button_text), multipleEventsCutterEnabled = false, ) } diff --git a/feature/record/src/main/res/values/strings.xml b/feature/record/src/main/res/values/strings.xml index 981d5653..29c6c553 100644 --- a/feature/record/src/main/res/values/strings.xml +++ b/feature/record/src/main/res/values/strings.xml @@ -16,7 +16,8 @@ 카메라 권한이 필요해요 문장 인식을 위해 설정에서 권한을 허용해주세요. 설정으로 이동하기 - 다음 + 다음 + 기록 완료 기록하고 싶은 페이지와\n문장을 등록해보세요 책 페이지 문장 기록