Skip to content

Commit 07c8cdf

Browse files
committed
Linter fixed for kotlin 2.1
1 parent de2c131 commit 07c8cdf

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

build.gradle.kts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
plugins {
22
alias(libs.plugins.kotlin.jvm)
33
alias(libs.plugins.ktor)
4-
// https://github.com/jeremymailen/kotlinter-gradle/issues/414
5-
// alias(libs.plugins.kotlinter)
4+
alias(libs.plugins.kotlinter)
65
alias(libs.plugins.detekt)
76
alias(libs.plugins.versions)
87
alias(libs.plugins.serialization)

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ logback-version = "1.5.12"
66
prometheus-version = "1.14.1"
77
gradle_versions_filter_version = "0.1.16"
88
detekt_version = "1.23.7"
9-
kotlinter_version = "4.5.0"
9+
kotlinter_version = "5.0.0"
1010
kotlin_logging_version = "7.0.0"
1111
arrow_version = "1.2.4"
1212
search_client_version = "2.3.2"

src/main/kotlin/no/java/conf/plugins/Respond.kt

+11-10
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ import no.java.conf.model.ApiError
1010
suspend inline fun <reified A : Any> Either<ApiError, A>.respond(
1111
context: RoutingContext,
1212
status: HttpStatusCode = HttpStatusCode.OK
13-
) =
14-
when (this) {
15-
is Either.Left -> context.respond(value)
16-
is Either.Right -> context.call.respond(status, value)
17-
}
13+
) = when (this) {
14+
is Either.Left -> context.respond(value)
15+
is Either.Right -> context.call.respond(status, value)
16+
}
1817

1918
suspend fun RoutingContext.respond(error: ApiError) = call.respond(error.statusCode, error.messageMap())
2019

21-
suspend inline fun <reified A : Any> Either<ApiError, A>.respondRedirect(context: RoutingContext, url: String) =
22-
when (this) {
23-
is Either.Left -> context.respond(value)
24-
is Either.Right -> context.call.respondRedirect(url)
25-
}
20+
suspend inline fun <reified A : Any> Either<ApiError, A>.respondRedirect(
21+
context: RoutingContext,
22+
url: String
23+
) = when (this) {
24+
is Either.Left -> context.respond(value)
25+
is Either.Right -> context.call.respondRedirect(url)
26+
}

0 commit comments

Comments
 (0)