Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update plugin.kotlinter to v4.4.0 #195

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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