Skip to content

Commit

Permalink
Update plugin.kotlinter to v4.4.0 (#195)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Jun 27, 2024
1 parent a4402b1 commit 76bf466
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,5 @@ public fun httpApiFake(phraseApi: PhraseApi = FakePhraseApi): HttpApi =
}

private object FakePhraseApi : PhraseApi {
override suspend fun getPhrase(): Phrase {
return Phrase("Fake phrase")
}
override suspend fun getPhrase(): Phrase = Phrase("Fake phrase")
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ public class HttpApiImpl(
private fun createRetrofit(
baseUrl: String,
okHttpClient: OkHttpClient,
) = Retrofit.Builder()
) = Retrofit
.Builder()
.baseUrl(baseUrl)
.callFactory(okHttpClient)
.addConverterFactory(Json.asConverterFactory("application/json".toMediaType()))
.build()

private fun createOkHttpClient() =
OkHttpClient.Builder()
OkHttpClient
.Builder()
.apply {
addNetworkInterceptor(
HttpLoggingInterceptor().apply {
Expand All @@ -44,6 +46,5 @@ public class HttpApiImpl(
}
},
)
}
.build()
}.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ public class GetPhrasesUseCase
private val database: SVPoliticianDatabase,
) {
public operator fun invoke(): Flow<List<Phrase>> =
database.phraseQueries.selectAll().asFlow().mapToList(Dispatchers.IO)
database.phraseQueries
.selectAll()
.asFlow()
.mapToList(Dispatchers.IO)
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ private fun PhrasesList(
items(phrases, { it.id }) {
val formattedDate =
remember(it.id, it.date) {
DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM)
DateTimeFormatter
.ofLocalizedDateTime(FormatStyle.MEDIUM)
.format(it.date.atZone(ZoneId.systemDefault()))
}
Phrase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ public class HistoryViewModel
HistoryUiState(
loading = false,
phrases =
phrases.map {
HistoryUiState.Phrase(
id = it.id,
message = it.message,
date = it.date,
)
}.toImmutableList(),
phrases
.map {
HistoryUiState.Phrase(
id = it.id,
message = it.message,
date = it.date,
)
}.toImmutableList(),
)
}
.stateIn(
}.stateIn(
scope = viewModelScope,
started = SharingStarted.WhileSubscribed(5000),
initialValue = HistoryUiState(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ public class GetMostRecentPhraseUseCase
private val database: SVPoliticianDatabase,
) {
public operator fun invoke(): Flow<Phrase?> =
database.phraseQueries.selectMostRecent().asFlow().mapToOneOrNull(Dispatchers.IO)
database.phraseQueries
.selectMostRecent()
.asFlow()
.mapToOneOrNull(Dispatchers.IO)
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ public fun HomeScreen(
else -> {
val formattedDate =
remember(state.phrase.date) {
DateTimeFormatter.ofLocalizedDateTime(FormatStyle.SHORT)
DateTimeFormatter
.ofLocalizedDateTime(FormatStyle.SHORT)
.format(state.phrase.date.atZone(ZoneId.systemDefault()))
}
Phrase(
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ kotlin = "2.0.0"
kotlinx-coroutines = "1.8.1"
kotlinx-serialization = "1.7.1"
plugin-android = "8.5.0"
plugin-kotlinter = "4.3.0"
plugin-kotlinter = "4.4.0"
plugin-doctor = "0.10.0"
square-okhttp = "4.12.0"
square-retrofit2 = "2.11.0"
Expand Down

0 comments on commit 76bf466

Please sign in to comment.